	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drive_locate
_drive_locate:                          ## @drive_locate
	.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	%r12
	pushq	%rbx
	subq	$64, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	cmpl	$3, %edi
	jne	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	16(%rsi), %rbx
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	movq	_MFI_DCMD_PD_LOCATE_START@GOTPCREL(%rip), %r14
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	movq	_MFI_DCMD_PD_LOCATE_STOP@GOTPCREL(%rip), %r14
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strcasecmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	leaq	L_.str.7(%rip), %rdi
	movq	%rbx, %rsi
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmovgq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
LBB0_7:
	callq	_warnx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_15
LBB0_8:
	movq	(%r14), %r15
	movq	_mfi_unit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mfi_open
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	movl	%eax, %r14d
	movq	8(%r12), %rsi
	leaq	-84(%rbp), %rdx
	movl	%eax, %edi
	callq	_mfi_lookup_drive
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movl	%eax, %ebx
	jmp	LBB0_14
LBB0_9:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_15
LBB0_12:
	movl	-84(%rbp), %esi
	leaq	-80(%rbp), %r12
	movq	%r12, %rdi
	callq	_mbox_store_device_id
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	$0, (%rsp)
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	movq	%r15, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r12, %r8
	movl	$4, %r9d
	callq	_mfi_dcmd_command
	testq	%rax, %rax
	jns	LBB0_14
## %bb.13:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_MFI_DCMD_PD_LOCATE_START@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r15
	leaq	L_.str.4(%rip), %rax
	leaq	L_.str.6(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	-84(%rbp), %edx
	leaq	L_.str.9(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
LBB0_14:
	movl	%r14d, %edi
	callq	_close
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%ebx, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"locate: %s"

L_.str.1:                               ## @.str.1
	.asciz	"extra arguments"

L_.str.2:                               ## @.str.2
	.asciz	"drive and state required"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"on"

L_.str.4:                               ## @.str.4
	.asciz	"start"

	.comm	_MFI_DCMD_PD_LOCATE_START,8,3   ## @MFI_DCMD_PD_LOCATE_START
L_.str.5:                               ## @.str.5
	.asciz	"off"

L_.str.6:                               ## @.str.6
	.asciz	"stop"

	.comm	_MFI_DCMD_PD_LOCATE_STOP,8,3    ## @MFI_DCMD_PD_LOCATE_STOP
L_.str.7:                               ## @.str.7
	.asciz	"locate: invalid state %s"

	.comm	_mfi_unit,4,2                   ## @mfi_unit
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_errno,4,2                      ## @errno
L_.str.8:                               ## @.str.8
	.asciz	"mfi_open"

L_.str.9:                               ## @.str.9
	.asciz	"Failed to %s locate on drive %u"

	.no_dead_strip	_drive_locate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drive_locate
_drive_locate:                          ; @drive_locate
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	cmp	w0, #3
	b.ne	LBB0_6
; %bb.1:
	mov	x19, x1
	ldr	x20, [x1, #16]
Lloh3:
	adrp	x1, l_.str.3@PAGE
Lloh4:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
Lloh5:
	adrp	x22, _MFI_DCMD_PD_LOCATE_START@GOTPAGE
Lloh6:
	ldr	x22, [x22, _MFI_DCMD_PD_LOCATE_START@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.2:
Lloh7:
	adrp	x1, l_.str.4@PAGE
Lloh8:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
	cbz	x0, LBB0_10
; %bb.3:
Lloh9:
	adrp	x1, l_.str.5@PAGE
Lloh10:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
	cbz	x0, LBB0_9
; %bb.4:
Lloh11:
	adrp	x1, l_.str.6@PAGE
Lloh12:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	bl	_strcasecmp
	cbz	x0, LBB0_9
; %bb.5:
Lloh13:
	adrp	x0, l_.str.7@PAGE
Lloh14:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x1, x20
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, l_.str.2@PAGE
Lloh16:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh17:
	adrp	x9, l_.str.1@PAGE
Lloh18:
	add	x9, x9, l_.str.1@PAGEOFF
	csel	x1, x9, x8, gt
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
LBB0_7:
	bl	_warnx
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w19, [x8]
	b	LBB0_18
LBB0_8:
	mov	x8, x22
	b	LBB0_11
LBB0_9:
Lloh24:
	adrp	x8, _MFI_DCMD_PD_LOCATE_STOP@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MFI_DCMD_PD_LOCATE_STOP@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh26:
	adrp	x8, _MFI_DCMD_PD_LOCATE_START@GOTPAGE
Lloh27:
	ldr	x8, [x8, _MFI_DCMD_PD_LOCATE_START@GOTPAGEOFF]
LBB0_11:
	ldr	x21, [x8]
Lloh28:
	adrp	x8, _mfi_unit@GOTPAGE
Lloh29:
	ldr	x8, [x8, _mfi_unit@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
Lloh31:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	bl	_mfi_open
	tbnz	w0, #31, LBB0_15
; %bb.12:
	mov	x20, x0
	ldr	x1, [x19, #8]
	add	x2, sp, #20
	bl	_mfi_lookup_drive
	cbz	w0, LBB0_16
; %bb.13:
	mov	x19, x0
LBB0_14:
	mov	x0, x20
	bl	_close
	b	LBB0_18
LBB0_15:
Lloh34:
	adrp	x8, _errno@GOTPAGE
Lloh35:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh36:
	ldr	w19, [x8]
Lloh37:
	adrp	x0, l_.str.8@PAGE
Lloh38:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_warn
	b	LBB0_18
LBB0_16:
	ldr	w1, [sp, #20]
	add	x0, sp, #24
	bl	_mbox_store_device_id
	stp	xzr, xzr, [sp, #40]
	add	x4, sp, #24
	mov	x0, x20
	mov	x1, x21
	mov	x2, #0
	mov	w3, #0
	mov	w5, #4
	mov	x6, #0
	bl	_mfi_dcmd_command
	tbnz	x0, #63, LBB0_20
; %bb.17:
	mov	x0, x20
	bl	_close
	mov	w19, #0
LBB0_18:
	ldur	x8, [x29, #-40]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.19:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_20:
Lloh42:
	adrp	x8, _errno@GOTPAGE
Lloh43:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh44:
	ldr	w19, [x8]
Lloh45:
	adrp	x8, l_.str.6@PAGE
Lloh46:
	add	x8, x8, l_.str.6@PAGEOFF
	ldr	x9, [x22]
Lloh47:
	adrp	x10, l_.str.4@PAGE
Lloh48:
	add	x10, x10, l_.str.4@PAGEOFF
	cmp	x21, x9
	csel	x8, x10, x8, eq
	ldr	w9, [sp, #20]
	stp	x8, x9, [sp]
Lloh49:
	adrp	x0, l_.str.9@PAGE
Lloh50:
	add	x0, x0, l_.str.9@PAGEOFF
	bl	_warn
	b	LBB0_14
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh49, Lloh50
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"locate: %s"

l_.str.1:                               ; @.str.1
	.asciz	"extra arguments"

l_.str.2:                               ; @.str.2
	.asciz	"drive and state required"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"on"

l_.str.4:                               ; @.str.4
	.asciz	"start"

	.comm	_MFI_DCMD_PD_LOCATE_START,8,3   ; @MFI_DCMD_PD_LOCATE_START
l_.str.5:                               ; @.str.5
	.asciz	"off"

l_.str.6:                               ; @.str.6
	.asciz	"stop"

	.comm	_MFI_DCMD_PD_LOCATE_STOP,8,3    ; @MFI_DCMD_PD_LOCATE_STOP
l_.str.7:                               ; @.str.7
	.asciz	"locate: invalid state %s"

	.comm	_mfi_unit,4,2                   ; @mfi_unit
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_errno,4,2                      ; @errno
l_.str.8:                               ; @.str.8
	.asciz	"mfi_open"

l_.str.9:                               ; @.str.9
	.asciz	"Failed to %s locate on drive %u"

	.no_dead_strip	_drive_locate
.subsections_via_symbols
