	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_unregister_mem                 ## -- Begin function unregister_mem
	.p2align	4, 0x90
_unregister_mem:                        ## @unregister_mem
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	$0, -32(%rbp)
	movq	_mmio_rwlock@GOTPCREL(%rip), %rdi
	callq	_pthread_rwlock_wrlock
	movq	(%rbx), %rsi
	movq	_mmio_rb_root@GOTPCREL(%rip), %rdi
	leaq	-32(%rbp), %rdx
	callq	_mmio_rb_lookup
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_1
LBB0_15:
	movq	_mmio_rwlock@GOTPCREL(%rip), %rdi
	callq	_pthread_rwlock_unlock
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_assert
	movq	-32(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_17
## %bb.16:
	callq	_free
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	-32(%rbp), %r15
	movq	8(%r15), %rax
	xorl	%edi, %edi
	cmpq	8(%rbx), %rax
	sete	%dil
	callq	_assert
	movq	(%r15), %rax
	xorl	%edi, %edi
	cmpq	(%rbx), %rax
	jne	LBB0_3
## %bb.2:
	movq	16(%r15), %rax
	xorl	%edi, %edi
	cmpq	16(%rbx), %rax
	sete	%dil
LBB0_3:
	callq	_assert
	movq	_MEM_F_IMMUTABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%edi, %edi
	andl	24(%r15), %eax
	sete	%dil
	callq	_assert
	movq	_mmio_rb_tree@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-32(%rbp), %rdx
	movq	_mmio_rb_root@GOTPCREL(%rip), %rsi
	callq	_RB_REMOVE
	movq	_VM_MAXCPU@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_15
## %bb.4:
	cmpl	$1, %eax
	jne	LBB0_6
## %bb.5:
	xorl	%ecx, %ecx
LBB0_12:
	testb	$1, %al
	je	LBB0_15
## %bb.13:
	movq	_mmio_hint@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax,%rcx,8), %rdx
	cmpq	-32(%rbp), %rdx
	jne	LBB0_15
## %bb.14:
	movq	$0, (%rax,%rcx,8)
	jmp	LBB0_15
LBB0_6:
	movl	%eax, %edx
	andl	$-2, %edx
	xorl	%ecx, %ecx
	movq	_mmio_hint@GOTPCREL(%rip), %rsi
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	addq	$2, %rcx
	cmpq	%rcx, %rdx
	je	LBB0_12
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rdi
	movq	(%rdi,%rcx,8), %rbx
	cmpq	-32(%rbp), %rbx
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	$0, (%rdi,%rcx,8)
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movq	(%rsi), %rdi
	movq	8(%rdi,%rcx,8), %rbx
	cmpq	-32(%rbp), %rbx
	jne	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movq	$0, 8(%rdi,%rcx,8)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_mmio_rwlock,4,2                ## @mmio_rwlock
	.comm	_mmio_rb_root,4,2               ## @mmio_rb_root
	.comm	_MEM_F_IMMUTABLE,4,2            ## @MEM_F_IMMUTABLE
	.comm	_mmio_rb_tree,4,2               ## @mmio_rb_tree
	.comm	_VM_MAXCPU,4,2                  ## @VM_MAXCPU
	.comm	_mmio_hint,8,3                  ## @mmio_hint
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_unregister_mem                 ; -- Begin function unregister_mem
	.p2align	2
_unregister_mem:                        ; @unregister_mem
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x0, _mmio_rwlock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _mmio_rwlock@GOTPAGEOFF]
	bl	_pthread_rwlock_wrlock
	ldr	x1, [x20]
Lloh2:
	adrp	x0, _mmio_rb_root@GOTPAGE
Lloh3:
	ldr	x0, [x0, _mmio_rb_root@GOTPAGEOFF]
	add	x2, sp, #8
	bl	_mmio_rb_lookup
	mov	x19, x0
	cbz	w0, LBB0_4
LBB0_1:
Lloh4:
	adrp	x0, _mmio_rwlock@GOTPAGE
Lloh5:
	ldr	x0, [x0, _mmio_rwlock@GOTPAGEOFF]
	bl	_pthread_rwlock_unlock
	cmp	w0, #0
	cset	w0, eq
	bl	_assert
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_free
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
	ldr	x21, [sp, #8]
	ldr	x8, [x21, #8]
	ldr	x9, [x20, #8]
	cmp	x8, x9
	cset	w0, eq
	bl	_assert
	ldr	x8, [x21]
	ldr	x9, [x20]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	x8, [x21, #16]
	ldr	x9, [x20, #16]
	cmp	x8, x9
	cset	w0, eq
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	bl	_assert
	ldr	w8, [x21, #24]
Lloh6:
	adrp	x9, _MEM_F_IMMUTABLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MEM_F_IMMUTABLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	cset	w0, eq
	bl	_assert
Lloh9:
	adrp	x8, _mmio_rb_tree@GOTPAGE
Lloh10:
	ldr	x8, [x8, _mmio_rb_tree@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	x2, [sp, #8]
Lloh12:
	adrp	x1, _mmio_rb_root@GOTPAGE
Lloh13:
	ldr	x1, [x1, _mmio_rb_root@GOTPAGEOFF]
	bl	_RB_REMOVE
Lloh14:
	adrp	x8, _VM_MAXCPU@GOTPAGE
Lloh15:
	ldr	x8, [x8, _VM_MAXCPU@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_1
; %bb.8:
	mov	x8, #0
	lsl	x9, x9, #3
Lloh17:
	adrp	x10, _mmio_hint@GOTPAGE
Lloh18:
	ldr	x10, [x10, _mmio_hint@GOTPAGEOFF]
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_10 Depth=1
	add	x8, x8, #8
	cmp	x9, x8
	b.eq	LBB0_1
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	ldr	x12, [x11, x8]
	ldr	x13, [sp, #8]
	cmp	x12, x13
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	str	xzr, [x11, x8]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_mmio_rwlock,4,2                ; @mmio_rwlock
	.comm	_mmio_rb_root,4,2               ; @mmio_rb_root
	.comm	_MEM_F_IMMUTABLE,4,2            ; @MEM_F_IMMUTABLE
	.comm	_mmio_rb_tree,4,2               ; @mmio_rb_tree
	.comm	_VM_MAXCPU,4,2                  ; @VM_MAXCPU
	.comm	_mmio_hint,8,3                  ; @mmio_hint
.subsections_via_symbols
