	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enclosure_remove_device        ## -- Begin function enclosure_remove_device
	.p2align	4, 0x90
_enclosure_remove_device:               ## @enclosure_remove_device
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.1:
	movq	%rsi, %r14
	testq	%rsi, %rsi
	je	LBB0_8
## %bb.2:
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_6
## %bb.3:
	movq	8(%rdi), %rbx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	%r14, 8(%rbx)
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	$16, %rbx
	decq	%rax
	jne	LBB0_4
LBB0_6:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_9:
	movq	%rbx, %rdi
	callq	_enclosure_remove_links
	movq	%rbx, %rdi
	callq	_device_del
	movq	%r14, %rdi
	callq	_put_device
	movq	$0, 8(%rbx)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_device_add                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENODEV,4,2                     ## @ENODEV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_enclosure_remove_device        ; -- Begin function enclosure_remove_device
	.p2align	2
_enclosure_remove_device:               ; @enclosure_remove_device
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	cbz	x0, LBB0_7
; %bb.1:
	mov	x19, x1
	cbz	x1, LBB0_7
; %bb.2:
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.3:
	ldr	x20, [x0, #8]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x20, #8]
	cmp	x9, x19
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x20, x20, #16
	subs	x8, x8, #1
	b.ne	LBB0_4
LBB0_6:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x20
	bl	_enclosure_remove_links
	mov	x0, x20
	bl	_device_del
	mov	x0, x19
	bl	_put_device
	str	xzr, [x20, #8]
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_device_add
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENODEV,4,2                     ; @ENODEV
.subsections_via_symbols
