	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function detach_drive
_detach_drive:                          ## @detach_drive
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movl	%edi, -20(%rbp)
	callq	_ctrlrpath
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_open
	testl	%eax, %eax
	js	LBB0_4
## %bb.1:
	movl	%eax, %r14d
	movq	_MLX_DETACH_DRIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movl	%r14d, %edi
	callq	_ioctl
	testq	%rax, %rax
	jns	LBB0_3
## %bb.2:
	movl	-20(%rbp), %edi
	callq	_drivename
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_warn
LBB0_3:
	movl	%r14d, %edi
	callq	_close
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	movl	%ebx, %edi
	callq	_ctrlrpath
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_warn                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't open %s"

	.comm	_MLX_DETACH_DRIVE,4,2           ## @MLX_DETACH_DRIVE
L_.str.1:                               ## @.str.1
	.asciz	"can't detach %s"

	.no_dead_strip	_detach_drive
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function detach_drive
_detach_drive:                          ; @detach_drive
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	str	w0, [sp, #12]
	bl	_ctrlrpath
	mov	w1, #0
	bl	_open
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _MLX_DETACH_DRIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MLX_DETACH_DRIVE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_ioctl
	tbz	x0, #63, LBB0_3
; %bb.2:
	ldr	w0, [sp, #12]
	bl	_drivename
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
LBB0_3:
	mov	x0, x19
	bl	_close
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
	mov	x0, x20
	bl	_ctrlrpath
	mov	x1, x0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_warn
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't open %s"

	.comm	_MLX_DETACH_DRIVE,4,2           ; @MLX_DETACH_DRIVE
l_.str.1:                               ; @.str.1
	.asciz	"can't detach %s"

	.no_dead_strip	_detach_drive
.subsections_via_symbols
