	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %rbx
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	_mpt_unit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mpt_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %r14d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %edi
	callq	_mpt_pd_list
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %rbx
	leaq	-48(%rbp), %rdx
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	_mpt_lookup_drive
	testq	%rax, %rax
	js	LBB0_5
## %bb.7:
	movq	%rbx, %rdi
	callq	_mpt_free_pd_list
	movq	-48(%rbp), %rsi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_mpt_pd_info
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r13
	movq	-48(%rbp), %r8
	cmpq	%r15, (%rax)
	jne	LBB0_11
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	movq	%r8, %rsi
	callq	_warnx
	movq	%r13, %rdi
	callq	_free
	movl	%r14d, %edi
	callq	_close
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_15
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_15
LBB0_3:
	movl	%r14d, %edi
	callq	_close
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	jmp	LBB0_15
LBB0_5:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	leaq	L_.str.1(%rip), %rdi
	movq	%r13, %rsi
	jmp	LBB0_6
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	-48(%rbp), %rsi
	leaq	L_.str.2(%rip), %rdi
LBB0_6:
	xorl	%eax, %eax
	callq	_warn
LBB0_14:
	movl	%r14d, %edi
	callq	_close
LBB0_15:
	movl	%r15d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 40(%rsp)
	movups	%xmm0, 16(%rsp)
	movl	$0, 56(%rsp)
	movl	$0, 32(%rsp)
	movl	$0, 8(%rsp)
	movq	$0, (%rsp)
	xorl	%r15d, %r15d
	movl	%r14d, %edi
	movq	%r12, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_mpt_raid_action
	testl	%eax, %eax
	je	LBB0_13
## %bb.12:
	movl	%eax, %ebx
	movq	-48(%rbp), %rdx
	leaq	L_.str.4(%rip), %rsi
	movl	%eax, %edi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	callq	_warnc
	movq	%r13, %rdi
	callq	_free
	movl	%r14d, %edi
	callq	_close
	movl	%ebx, %r15d
	jmp	LBB0_15
LBB0_13:
	movq	%r13, %rdi
	callq	_free
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_mpt_unit,4,2                   ## @mpt_unit
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mpt_open"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to find drive %s"

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

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

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.4:                               ## @.str.4
	.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, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x3
	mov	x23, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _mpt_unit@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mpt_unit@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_mpt_open
	tbnz	w0, #31, LBB0_6
; %bb.1:
	mov	x19, x0
	bl	_mpt_pd_list
	cbz	x0, LBB0_7
; %bb.2:
	mov	x24, x0
	add	x2, sp, #56
	mov	x1, x22
	bl	_mpt_lookup_drive
	tbnz	x0, #63, LBB0_8
; %bb.3:
	mov	x0, x24
	bl	_mpt_free_pd_list
	ldr	x1, [sp, #56]
	mov	x0, x19
	mov	x2, #0
	bl	_mpt_pd_info
	cbz	x0, LBB0_9
; %bb.4:
	mov	x22, x0
	ldr	x8, [x0]
	ldr	x4, [sp, #56]
	cmp	x8, x23
	b.ne	LBB0_10
; %bb.5:
Lloh3:
	adrp	x0, l_.str.3@PAGE
Lloh4:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x4
	bl	_warnx
	mov	x0, x22
	bl	_free
	mov	x0, x19
	bl	_close
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w21, [x8]
	b	LBB0_14
LBB0_6:
Lloh8:
	adrp	x8, _errno@GOTPAGE
Lloh9:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh10:
	ldr	w21, [x8]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
	b	LBB0_14
LBB0_7:
	mov	x0, x19
	bl	_close
Lloh13:
	adrp	x8, _errno@GOTPAGE
Lloh14:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh15:
	ldr	w21, [x8]
	b	LBB0_14
LBB0_8:
Lloh16:
	adrp	x8, _errno@GOTPAGE
Lloh17:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh18:
	ldr	w21, [x8]
	str	x22, [sp]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_13
LBB0_9:
Lloh21:
	adrp	x8, _errno@GOTPAGE
Lloh22:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh23:
	ldr	w21, [x8]
	ldr	x8, [sp, #56]
	str	x8, [sp]
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warn
	b	LBB0_13
LBB0_10:
	str	wzr, [sp, #40]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #24]
	str	wzr, [sp, #16]
	str	q0, [sp]
	mov	x0, x19
	mov	x1, x21
	mov	w2, #0
	mov	w3, #0
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_mpt_raid_action
	mov	x21, x0
	cbz	w0, LBB0_12
; %bb.11:
	ldr	x2, [sp, #56]
Lloh26:
	adrp	x1, l_.str.4@PAGE
Lloh27:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x3, x20
	bl	_warnc
LBB0_12:
	mov	x0, x22
	bl	_free
LBB0_13:
	mov	x0, x19
	bl	_close
LBB0_14:
	mov	x0, x21
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_mpt_unit,4,2                   ; @mpt_unit
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mpt_open"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to find drive %s"

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

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

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

	.no_dead_strip	_drive_set_state
.subsections_via_symbols
