	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function add_spare
_add_spare:                             ## @add_spare
	.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	$96, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$1, %edi
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_4
LBB0_2:
	movl	%edi, %ebx
	cmpl	$4, %edi
	jb	LBB0_7
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	callq	_warnx
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$96, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rsi, %r12
	movq	_mpt_unit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mpt_open
	testl	%eax, %eax
	js	LBB0_11
## %bb.8:
	movl	%eax, %r14d
	cmpl	$3, %ebx
	jne	LBB0_12
## %bb.9:
	movq	16(%r12), %rsi
	leaq	-40(%rbp), %rdx
	movl	%r14d, %edi
	callq	_find_volume_spare_pool
	testl	%eax, %eax
	je	LBB0_13
## %bb.10:
	movl	%eax, %ebx
	jmp	LBB0_28
LBB0_11:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_6
LBB0_12:
	movq	_MPI_RAID_HOT_SPARE_POOL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -40(%rbp)
LBB0_13:
	movl	%r14d, %edi
	callq	_mpt_pd_list
	testq	%rax, %rax
	je	LBB0_31
## %bb.14:
	movq	%rax, %r15
	movq	8(%r12), %rsi
	leaq	-36(%rbp), %rdx
	movq	%rax, %rdi
	callq	_mpt_lookup_drive
	testl	%eax, %eax
	je	LBB0_23
## %bb.15:
	leaq	-60(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	movl	%r14d, %edi
	callq	_mpt_fetch_disks
	testl	%eax, %eax
	je	LBB0_19
## %bb.16:
	movl	%eax, %ebx
	leaq	L_.str.3(%rip), %rdi
LBB0_17:
	xorl	%eax, %eax
	callq	_warn
LBB0_18:
	movq	%r15, %rdi
	callq	_mpt_free_pd_list
	jmp	LBB0_28
LBB0_19:
	movq	8(%r12), %rdi
	movq	-56(%rbp), %rsi
	movl	-60(%rbp), %edx
	leaq	-44(%rbp), %rcx
	callq	_mpt_lookup_standalone_disk
	testq	%rax, %rax
	js	LBB0_29
## %bb.20:
	movslq	-44(%rbp), %rdi
	shlq	$2, %rdi
	addq	-56(%rbp), %rdi
	callq	_mpt_lock_physdisk
	testq	%rax, %rax
	js	LBB0_30
## %bb.21:
	movslq	-44(%rbp), %rsi
	shlq	$2, %rsi
	addq	-56(%rbp), %rsi
	leaq	-36(%rbp), %rdx
	movl	%r14d, %edi
	callq	_mpt_create_physdisk
	testq	%rax, %rax
	js	LBB0_32
## %bb.22:
	movq	-56(%rbp), %rdi
	callq	_free
LBB0_23:
	movq	%r15, %rdi
	callq	_mpt_free_pd_list
	movl	-36(%rbp), %esi
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_mpt_pd_info
	testq	%rax, %rax
	je	LBB0_26
## %bb.24:
	movq	%rax, %r15
	movl	-40(%rbp), %r9d
	movl	%r9d, (%rax)
	movq	_MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-36(%rbp), %r8d
	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	%ebx, %ebx
	movl	%r14d, %edi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_mpt_raid_action
	testl	%eax, %eax
	je	LBB0_27
## %bb.25:
	movl	%eax, %r12d
	leaq	L_.str.7(%rip), %rsi
	movl	%eax, %edi
	callq	_warnc
	movl	%r14d, %edi
	callq	_close
	movl	%r12d, %ebx
	jmp	LBB0_6
LBB0_26:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.6(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_28
LBB0_27:
	movq	%r15, %rdi
	callq	_free
LBB0_28:
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_6
LBB0_29:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	8(%r12), %rsi
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_18
LBB0_30:
	movq	%r15, %rdi
	callq	_mpt_free_pd_list
	movl	%r14d, %edi
	callq	_close
LBB0_31:
	movq	_errno@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_32:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"add spare: drive required"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"add spare: extra arguments"

	.comm	_mpt_unit,4,2                   ## @mpt_unit
	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"mpt_open"

	.comm	_MPI_RAID_HOT_SPARE_POOL_0,4,2  ## @MPI_RAID_HOT_SPARE_POOL_0
L_.str.3:                               ## @.str.3
	.asciz	"Failed to fetch standalone disk list"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to lookup drive %s"

L_.str.5:                               ## @.str.5
	.asciz	"Failed to create physical disk page"

L_.str.6:                               ## @.str.6
	.asciz	"Failed to fetch drive info"

	.comm	_MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS,4,2 ## @MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS
L_.str.7:                               ## @.str.7
	.asciz	"Failed to assign spare"

	.no_dead_strip	_add_spare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function add_spare
_add_spare:                             ; @add_spare
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	cmp	w0, #1
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	mov	x20, x0
	cmp	w0, #4
	b.lo	LBB0_7
; %bb.3:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_4:
	bl	_warnx
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w20, [x8]
LBB0_6:
	mov	x0, x20
	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
	add	sp, sp, #128
	ret
LBB0_7:
	mov	x22, x1
Lloh6:
	adrp	x8, _mpt_unit@GOTPAGE
Lloh7:
	ldr	x8, [x8, _mpt_unit@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_mpt_open
	tbnz	w0, #31, LBB0_11
; %bb.8:
	mov	x19, x0
	cmp	w20, #3
	b.ne	LBB0_12
; %bb.9:
	ldr	x1, [x22, #16]
	add	x2, sp, #56
	mov	x0, x19
	bl	_find_volume_spare_pool
	cbz	w0, LBB0_13
; %bb.10:
	mov	x20, x0
	b	LBB0_27
LBB0_11:
Lloh9:
	adrp	x8, _errno@GOTPAGE
Lloh10:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warn
	b	LBB0_6
LBB0_12:
Lloh14:
	adrp	x8, _MPI_RAID_HOT_SPARE_POOL_0@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MPI_RAID_HOT_SPARE_POOL_0@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [sp, #56]
LBB0_13:
	mov	x0, x19
	bl	_mpt_pd_list
	cbz	x0, LBB0_30
; %bb.14:
	mov	x21, x0
	ldr	x1, [x22, #8]
	sub	x2, x29, #44
	bl	_mpt_lookup_drive
	cbz	w0, LBB0_22
; %bb.15:
	sub	x1, x29, #52
	sub	x2, x29, #40
	mov	x0, x19
	bl	_mpt_fetch_disks
	cbz	w0, LBB0_18
; %bb.16:
	mov	x20, x0
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_17:
	bl	_warn
	mov	x0, x21
	bl	_mpt_free_pd_list
	b	LBB0_27
LBB0_18:
	ldr	x0, [x22, #8]
	ldur	x1, [x29, #-40]
	ldur	w2, [x29, #-52]
	sub	x3, x29, #48
	bl	_mpt_lookup_standalone_disk
	tbnz	x0, #63, LBB0_28
; %bb.19:
	ldur	x8, [x29, #-40]
	ldursw	x9, [x29, #-48]
	add	x0, x8, x9, lsl #2
	bl	_mpt_lock_physdisk
	tbnz	x0, #63, LBB0_29
; %bb.20:
	ldur	x8, [x29, #-40]
	ldursw	x9, [x29, #-48]
	add	x1, x8, x9, lsl #2
	sub	x2, x29, #44
	mov	x0, x19
	bl	_mpt_create_physdisk
	tbnz	x0, #63, LBB0_31
; %bb.21:
	ldur	x0, [x29, #-40]
	bl	_free
LBB0_22:
	mov	x0, x21
	bl	_mpt_free_pd_list
	ldur	w1, [x29, #-44]
	mov	x0, x19
	mov	x2, #0
	bl	_mpt_pd_info
	cbz	x0, LBB0_25
; %bb.23:
	mov	x21, x0
	ldr	w5, [sp, #56]
	str	w5, [x0]
Lloh19:
	adrp	x8, _MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldur	w4, [x29, #-44]
	str	wzr, [sp, #40]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #24]
	str	wzr, [sp, #16]
	str	q0, [sp]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	mov	x6, #0
	mov	w7, #0
	bl	_mpt_raid_action
	mov	x20, x0
	cbz	w0, LBB0_26
; %bb.24:
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	bl	_warnc
	b	LBB0_27
LBB0_25:
Lloh24:
	adrp	x8, _errno@GOTPAGE
Lloh25:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh26:
	ldr	w20, [x8]
Lloh27:
	adrp	x0, l_.str.6@PAGE
Lloh28:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_warn
	b	LBB0_27
LBB0_26:
	mov	x0, x21
	bl	_free
LBB0_27:
	mov	x0, x19
	bl	_close
	b	LBB0_6
LBB0_28:
Lloh29:
	adrp	x8, _errno@GOTPAGE
Lloh30:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh31:
	ldr	w20, [x8]
	ldr	x8, [x22, #8]
	str	x8, [sp]
Lloh32:
	adrp	x0, l_.str.4@PAGE
Lloh33:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_29:
	mov	x0, x21
	bl	_mpt_free_pd_list
	mov	x0, x19
	bl	_close
LBB0_30:
Lloh34:
	adrp	x8, _errno@GOTPAGE
Lloh35:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	b	LBB0_5
LBB0_31:
Lloh36:
	adrp	x8, _errno@GOTPAGE
Lloh37:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh38:
	ldr	w20, [x8]
Lloh39:
	adrp	x0, l_.str.5@PAGE
Lloh40:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"add spare: drive required"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"add spare: extra arguments"

	.comm	_mpt_unit,4,2                   ; @mpt_unit
	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"mpt_open"

	.comm	_MPI_RAID_HOT_SPARE_POOL_0,4,2  ; @MPI_RAID_HOT_SPARE_POOL_0
l_.str.3:                               ; @.str.3
	.asciz	"Failed to fetch standalone disk list"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to lookup drive %s"

l_.str.5:                               ; @.str.5
	.asciz	"Failed to create physical disk page"

l_.str.6:                               ; @.str.6
	.asciz	"Failed to fetch drive info"

	.comm	_MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS,4,2 ; @MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS
l_.str.7:                               ; @.str.7
	.asciz	"Failed to assign spare"

	.no_dead_strip	_add_spare
.subsections_via_symbols
