	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dev_remove
_dev_remove:                            ## @dev_remove
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	__hash_lock@GOTPCREL(%rip), %rdi
	callq	_down_write
	movq	%r15, %rdi
	callq	___find_device_hash_cell
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	8(%rax), %r14
	movq	_DM_DEFERRED_REMOVE@GOTPCREL(%rip), %r13
	movl	(%r13), %eax
	xorl	%esi, %esi
	andl	(%r15), %eax
	setne	%sil
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_dm_lock_for_deletion
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	%eax, %ebx
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_6
## %bb.4:
	movl	(%r13), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.5:
	movq	__hash_lock@GOTPCREL(%rip), %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_dm_put
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DMDEBUG_LIMIT
	movq	__hash_lock@GOTPCREL(%rip), %rdi
	callq	_up_write
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_6:
	movl	(%r12), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DMDEBUG_LIMIT
	movq	__hash_lock@GOTPCREL(%rip), %rdi
	callq	_up_write
	movq	%r14, %rdi
	callq	_dm_put
	jmp	LBB0_13
LBB0_7:
	movq	%r12, %rdi
	callq	___hash_remove
	movq	%rax, %rbx
	movq	__hash_lock@GOTPCREL(%rip), %rdi
	callq	_up_write
	testq	%rbx, %rbx
	je	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	_dm_sync_table
	movq	%rbx, %rdi
	callq	_dm_table_destroy
LBB0_9:
	movl	(%r13), %eax
	notl	%eax
	andl	%eax, (%r15)
	movq	_KOBJ_REMOVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	4(%r15), %edx
	movq	%r14, %rdi
	callq	_dm_kobject_uevent
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	_DM_UEVENT_GENERATED_FLAG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
LBB0_11:
	movq	%r14, %rdi
	callq	_dm_put
	movq	%r14, %rdi
	callq	_dm_destroy
LBB0_12:
	xorl	%ebx, %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	__hash_lock,4,2                 ## @_hash_lock
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"device doesn't appear to be in the dev hash table."

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_DM_DEFERRED_REMOVE,4,2         ## @DM_DEFERRED_REMOVE
	.comm	_EBUSY,4,2                      ## @EBUSY
L_.str.1:                               ## @.str.1
	.asciz	"unable to remove open device %s"

	.comm	_KOBJ_REMOVE,4,2                ## @KOBJ_REMOVE
	.comm	_DM_UEVENT_GENERATED_FLAG,4,2   ## @DM_UEVENT_GENERATED_FLAG
	.no_dead_strip	_dev_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dev_remove
_dev_remove:                            ; @dev_remove
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x1
Lloh0:
	adrp	x0, __hash_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, __hash_lock@GOTPAGEOFF]
	bl	_down_write
	mov	x0, x20
	bl	___find_device_hash_cell
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x0
	ldr	x19, [x0, #8]
	ldr	w8, [x20]
Lloh2:
	adrp	x23, _DM_DEFERRED_REMOVE@GOTPAGE
Lloh3:
	ldr	x23, [x23, _DM_DEFERRED_REMOVE@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	cset	w1, ne
	mov	x0, x19
	mov	w2, #0
	bl	_dm_lock_for_deletion
	cbz	w0, LBB0_7
; %bb.2:
	mov	x21, x0
Lloh4:
	adrp	x8, _EBUSY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_6
; %bb.3:
	ldr	w8, [x20]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
Lloh7:
	adrp	x0, __hash_lock@GOTPAGE
Lloh8:
	ldr	x0, [x0, __hash_lock@GOTPAGEOFF]
	bl	_up_write
	mov	x0, x19
	bl	_dm_put
	b	LBB0_12
LBB0_5:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DMDEBUG_LIMIT
Lloh11:
	adrp	x0, __hash_lock@GOTPAGE
Lloh12:
	ldr	x0, [x0, __hash_lock@GOTPAGEOFF]
	bl	_up_write
Lloh13:
	adrp	x8, _ENXIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_6:
	ldr	w8, [x22]
	str	x8, [sp]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DMDEBUG_LIMIT
Lloh18:
	adrp	x0, __hash_lock@GOTPAGE
Lloh19:
	ldr	x0, [x0, __hash_lock@GOTPAGEOFF]
	bl	_up_write
	mov	x0, x19
	bl	_dm_put
	b	LBB0_13
LBB0_7:
	mov	x0, x22
	bl	___hash_remove
	mov	x21, x0
Lloh20:
	adrp	x0, __hash_lock@GOTPAGE
Lloh21:
	ldr	x0, [x0, __hash_lock@GOTPAGEOFF]
	bl	_up_write
	cbz	x21, LBB0_9
; %bb.8:
	mov	x0, x19
	bl	_dm_sync_table
	mov	x0, x21
	bl	_dm_table_destroy
LBB0_9:
	ldr	w8, [x23]
	ldp	w9, w2, [x20]
	bic	w8, w9, w8
	str	w8, [x20]
Lloh22:
	adrp	x8, _KOBJ_REMOVE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _KOBJ_REMOVE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dm_kobject_uevent
	cbnz	w0, LBB0_11
; %bb.10:
Lloh25:
	adrp	x8, _DM_UEVENT_GENERATED_FLAG@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DM_UEVENT_GENERATED_FLAG@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_11:
	mov	x0, x19
	bl	_dm_put
	mov	x0, x19
	bl	_dm_destroy
LBB0_12:
	mov	w21, #0
LBB0_13:
	mov	x0, x21
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	__hash_lock,4,2                 ; @_hash_lock
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"device doesn't appear to be in the dev hash table."

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_DM_DEFERRED_REMOVE,4,2         ; @DM_DEFERRED_REMOVE
	.comm	_EBUSY,4,2                      ; @EBUSY
l_.str.1:                               ; @.str.1
	.asciz	"unable to remove open device %s"

	.comm	_KOBJ_REMOVE,4,2                ; @KOBJ_REMOVE
	.comm	_DM_UEVENT_GENERATED_FLAG,4,2   ; @DM_UEVENT_GENERATED_FLAG
	.no_dead_strip	_dev_remove
.subsections_via_symbols
