	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function start_rebuild
_start_rebuild:                         ## @start_rebuild
	.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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	cmpl	$2, %edi
	jne	LBB0_1
## %bb.3:
	movq	%rsi, %rbx
	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_4
## %bb.5:
	movl	%eax, %r14d
	movq	8(%rbx), %rsi
	leaq	-56(%rbp), %rdx
	movl	%eax, %edi
	callq	_mfi_lookup_drive
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	jmp	LBB0_10
LBB0_1:
	leaq	L_.str.1(%rip), %rax
	leaq	L_.str.2(%rip), %rsi
	cmovgq	%rax, %rsi
	leaq	L_.str(%rip), %rdi
	callq	_warnx
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_11
LBB0_7:
	movq	-56(%rbp), %rsi
	leaq	-72(%rbp), %rdx
	movl	%r14d, %edi
	xorl	%ecx, %ecx
	callq	_mfi_pd_get_info
	testq	%rax, %rax
	js	LBB0_8
## %bb.13:
	movq	-72(%rbp), %rax
	movq	_MFI_PD_STATE_REBUILD@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.15:
	leaq	-64(%rbp), %rsi
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	callq	_mbox_store_pdref
	movq	_MFI_DCMD_PD_REBUILD_START@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	$0, (%rsp)
	xorl	%ebx, %ebx
	movl	%r14d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	movl	$4, %r9d
	callq	_mfi_dcmd_command
	testq	%rax, %rax
	jns	LBB0_10
## %bb.16:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-56(%rbp), %rsi
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_9
LBB0_8:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	-56(%rbp), %rsi
	leaq	L_.str.4(%rip), %rdi
LBB0_9:
	xorl	%eax, %eax
	callq	_warn
LBB0_10:
	movl	%r14d, %edi
	callq	_close
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.17:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	-56(%rbp), %rsi
	leaq	L_.str.5(%rip), %rdi
	callq	_warnx
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_2
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"start rebuild: %s"

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

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

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

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

	.comm	_MFI_PD_STATE_REBUILD,8,3       ## @MFI_PD_STATE_REBUILD
L_.str.5:                               ## @.str.5
	.asciz	"Drive %d is not in the REBUILD state"

	.comm	_MFI_DCMD_PD_REBUILD_START,4,2  ## @MFI_DCMD_PD_REBUILD_START
L_.str.6:                               ## @.str.6
	.asciz	"Failed to start rebuild on drive %u"

	.no_dead_strip	_start_rebuild
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function start_rebuild
_start_rebuild:                         ; @start_rebuild
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	cmp	w0, #2
	b.ne	LBB0_5
; %bb.1:
	mov	x20, x1
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_7
; %bb.2:
	mov	x19, x0
	ldr	x1, [x20, #8]
	add	x2, sp, #16
	bl	_mfi_lookup_drive
	cbz	w0, LBB0_10
; %bb.3:
	mov	x20, x0
LBB0_4:
	mov	x0, x19
	bl	_close
	b	LBB0_8
LBB0_5:
Lloh9:
	adrp	x8, l_.str.2@PAGE
Lloh10:
	add	x8, x8, l_.str.2@PAGEOFF
Lloh11:
	adrp	x9, l_.str.1@PAGE
Lloh12:
	add	x9, x9, l_.str.1@PAGEOFF
	csel	x1, x9, x8, gt
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
LBB0_6:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
	b	LBB0_8
LBB0_7:
Lloh18:
	adrp	x8, _errno@GOTPAGE
Lloh19:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh20:
	ldr	w20, [x8]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_warn
LBB0_8:
	ldur	x8, [x29, #-24]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.9:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	ldr	x1, [sp, #16]
	add	x2, sp, #24
	mov	x0, x19
	mov	x3, #0
	bl	_mfi_pd_get_info
	tbnz	x0, #63, LBB0_14
; %bb.11:
	ldr	x8, [sp, #24]
Lloh26:
	adrp	x9, _MFI_PD_STATE_REBUILD@GOTPAGE
Lloh27:
	ldr	x9, [x9, _MFI_PD_STATE_REBUILD@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.12:
	add	x8, sp, #24
	add	x1, x8, #8
	add	x0, sp, #40
	bl	_mbox_store_pdref
Lloh29:
	adrp	x8, _MFI_DCMD_PD_REBUILD_START@GOTPAGE
Lloh30:
	ldr	x8, [x8, _MFI_DCMD_PD_REBUILD_START@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x4, sp, #40
	mov	x0, x19
	mov	x2, #0
	mov	w3, #0
	mov	w5, #4
	mov	x6, #0
	bl	_mfi_dcmd_command
	tbnz	x0, #63, LBB0_16
; %bb.13:
	mov	x0, x19
	bl	_close
	mov	w20, #0
	b	LBB0_8
LBB0_14:
Lloh32:
	adrp	x8, _errno@GOTPAGE
Lloh33:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh34:
	ldr	w20, [x8]
	ldr	x8, [sp, #16]
	str	x8, [sp]
Lloh35:
	adrp	x0, l_.str.4@PAGE
Lloh36:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_warn
	b	LBB0_4
LBB0_15:
	ldr	x1, [sp, #16]
Lloh37:
	adrp	x0, l_.str.5@PAGE
Lloh38:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_warnx
	mov	x0, x19
	bl	_close
	b	LBB0_6
LBB0_16:
Lloh39:
	adrp	x8, _errno@GOTPAGE
Lloh40:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh41:
	ldr	w20, [x8]
	ldr	x8, [sp, #16]
	str	x8, [sp]
Lloh42:
	adrp	x0, l_.str.6@PAGE
Lloh43:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_warn
	b	LBB0_4
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"start rebuild: %s"

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

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

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

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

	.comm	_MFI_PD_STATE_REBUILD,8,3       ; @MFI_PD_STATE_REBUILD
l_.str.5:                               ; @.str.5
	.asciz	"Drive %d is not in the REBUILD state"

	.comm	_MFI_DCMD_PD_REBUILD_START,4,2  ; @MFI_DCMD_PD_REBUILD_START
l_.str.6:                               ; @.str.6
	.asciz	"Failed to start rebuild on drive %u"

	.no_dead_strip	_start_rebuild
.subsections_via_symbols
