	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drive_set_state
_drive_set_state:                       ## @drive_set_state
	.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
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	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_1
## %bb.2:
	movl	%eax, %r12d
	leaq	-68(%rbp), %rdx
	movl	%eax, %edi
	movq	%rbx, %rsi
	callq	_mfi_lookup_drive
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
LBB0_10:
	movl	%r12d, %edi
	callq	_close
	jmp	LBB0_11
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	movl	%r14d, %eax
	addq	$64, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movl	-68(%rbp), %esi
	leaq	-80(%rbp), %rdx
	movl	%r12d, %edi
	xorl	%ecx, %ecx
	callq	_mfi_pd_get_info
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	cmpl	%r15d, -80(%rbp)
	jne	LBB0_8
## %bb.7:
	movl	-68(%rbp), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_warnx
	movl	%r12d, %edi
	callq	_close
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_11
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	-68(%rbp), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_10
LBB0_8:
	leaq	-76(%rbp), %rsi
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_mbox_store_pdref
	movzbl	%r15b, %eax
	movl	%eax, -48(%rbp)
	movl	%r15d, %eax
	sarl	$8, %eax
	movl	%eax, -44(%rbp)
	movq	_MFI_DCMD_PD_STATE_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	$0, (%rsp)
	xorl	%r14d, %r14d
	movl	%r12d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%rbx, %r8
	movl	$6, %r9d
	callq	_mfi_dcmd_command
	testq	%rax, %rax
	jns	LBB0_10
## %bb.9:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	-68(%rbp), %ebx
	movl	%r15d, %edi
	callq	_mfi_pdstate
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_10
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_mfi_unit,4,2                   ## @mfi_unit
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mfi_open"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to fetch info for drive %u"

L_.str.2:                               ## @.str.2
	.asciz	"Drive %u is already in the desired state"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_MFI_DCMD_PD_STATE_SET,4,2      ## @MFI_DCMD_PD_STATE_SET
L_.str.3:                               ## @.str.3
	.asciz	"Failed to set drive %u to %s"

	.no_dead_strip	_drive_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drive_set_state
_drive_set_state:                       ; @drive_set_state
	.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
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _mfi_unit@GOTPAGE
Lloh4:
	ldr	x8, [x8, _mfi_unit@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_mfi_open
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x19, x0
	add	x2, sp, #20
	mov	x1, x21
	bl	_mfi_lookup_drive
	cbz	w0, LBB0_7
; %bb.2:
	mov	x21, x0
LBB0_3:
	mov	x0, x19
	bl	_close
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	ldr	w21, [x8]
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
LBB0_5:
	ldur	x8, [x29, #-40]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.6:
	mov	x0, x21
	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_7:
	ldr	w1, [sp, #20]
	add	x2, sp, #24
	mov	x0, x19
	mov	x3, #0
	bl	_mfi_pd_get_info
	tbnz	x0, #63, LBB0_10
; %bb.8:
	ldr	w8, [sp, #24]
	cmp	w8, w20
	b.ne	LBB0_11
; %bb.9:
	ldr	w1, [sp, #20]
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warnx
	mov	x0, x19
	bl	_close
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh21:
	ldr	w21, [x8]
	b	LBB0_5
LBB0_10:
Lloh22:
	adrp	x8, _errno@GOTPAGE
Lloh23:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh24:
	ldr	w21, [x8]
	ldr	w8, [sp, #20]
	str	x8, [sp]
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_3
LBB0_11:
	add	x8, sp, #24
	orr	x1, x8, #0x4
	add	x0, sp, #32
	bl	_mbox_store_pdref
	and	w8, w20, #0xff
	asr	w9, w20, #8
	stp	w8, w9, [sp, #48]
Lloh27:
	adrp	x8, _MFI_DCMD_PD_STATE_SET@GOTPAGE
Lloh28:
	ldr	x8, [x8, _MFI_DCMD_PD_STATE_SET@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	add	x4, sp, #32
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	mov	w5, #6
	mov	x6, #0
	bl	_mfi_dcmd_command
	tbnz	x0, #63, LBB0_13
; %bb.12:
	mov	x0, x19
	bl	_close
	mov	w21, #0
	b	LBB0_5
LBB0_13:
Lloh30:
	adrp	x8, _errno@GOTPAGE
Lloh31:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh32:
	ldr	w21, [x8]
	ldr	w22, [sp, #20]
	mov	x0, x20
	bl	_mfi_pdstate
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x22, x0, [sp]
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warn
	b	LBB0_3
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_mfi_unit,4,2                   ; @mfi_unit
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mfi_open"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to fetch info for drive %u"

l_.str.2:                               ; @.str.2
	.asciz	"Drive %u is already in the desired state"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_MFI_DCMD_PD_STATE_SET,4,2      ; @MFI_DCMD_PD_STATE_SET
l_.str.3:                               ; @.str.3
	.asciz	"Failed to set drive %u to %s"

	.no_dead_strip	_drive_set_state
.subsections_via_symbols
