	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function delete_volume
_delete_volume:                         ## @delete_volume
	.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	$72, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$2, %edi
	jne	LBB0_5
## %bb.1:
	movq	%rsi, %r15
	movq	_mpt_unit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_mpt_open
	testl	%eax, %eax
	js	LBB0_6
## %bb.2:
	movl	%eax, %r14d
	movq	8(%r15), %rsi
	leaq	-32(%rbp), %rdx
	leaq	-28(%rbp), %rcx
	movl	%eax, %edi
	callq	_mpt_lookup_volume
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	%eax, %ebx
	movq	8(%r15), %rdx
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_warnc
LBB0_4:
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_12
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_warnx
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ebx
	jmp	LBB0_12
LBB0_6:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rdi
	callq	_warn
	jmp	LBB0_12
LBB0_7:
	movl	-32(%rbp), %edi
	movl	-28(%rbp), %esi
	callq	_mpt_lock_volume
	testq	%rax, %rax
	js	LBB0_10
## %bb.8:
	movq	_MPI_RAID_ACTION_DELETE_VOLUME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-32(%rbp), %edx
	movl	-28(%rbp), %ecx
	movq	_MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS@GOTPCREL(%rip), %rax
	movq	_MPI_RAID_ACTION_ADATA_ZERO_LBA0@GOTPCREL(%rip), %rdi
	movl	(%rdi), %r9d
	orl	(%rax), %r9d
	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	%r8d, %r8d
	callq	_mpt_raid_action
	testl	%eax, %eax
	je	LBB0_13
## %bb.9:
	movl	%eax, %r15d
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_warnc
	movl	%r14d, %edi
	callq	_close
	movl	%r15d, %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	%r14d, %edi
	callq	_close
	movq	_errno@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_13:
	movl	$-1, %edi
	movl	$-1, %esi
	callq	_mpt_rescan_bus
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"delete: volume required"

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

L_.str.2:                               ## @.str.2
	.asciz	"Invalid volume %s"

	.comm	_MPI_RAID_ACTION_DELETE_VOLUME,4,2 ## @MPI_RAID_ACTION_DELETE_VOLUME
	.comm	_MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS,4,2 ## @MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS
	.comm	_MPI_RAID_ACTION_ADATA_ZERO_LBA0,4,2 ## @MPI_RAID_ACTION_ADATA_ZERO_LBA0
L_.str.3:                               ## @.str.3
	.asciz	"Failed to delete volume"

	.no_dead_strip	_delete_volume
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function delete_volume
_delete_volume:                         ; @delete_volume
	.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
	cmp	w0, #2
	b.ne	LBB0_6
; %bb.1:
	mov	x21, x1
Lloh0:
	adrp	x8, _mpt_unit@GOTPAGE
Lloh1:
	ldr	x8, [x8, _mpt_unit@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_mpt_open
	tbnz	w0, #31, LBB0_7
; %bb.2:
	mov	x19, x0
	ldr	x1, [x21, #8]
	sub	x2, x29, #36
	sub	x3, x29, #40
	bl	_mpt_lookup_volume
	cbz	w0, LBB0_9
; %bb.3:
	mov	x20, x0
	ldr	x8, [x21, #8]
	str	x8, [sp]
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_warnc
LBB0_5:
	mov	x0, x19
	bl	_close
	b	LBB0_8
LBB0_6:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	b	LBB0_8
LBB0_7:
Lloh10:
	adrp	x8, _errno@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh12:
	ldr	w20, [x8]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
LBB0_8:
	mov	x0, x20
	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_9:
	ldp	w1, w0, [x29, #-40]
	bl	_mpt_lock_volume
	tbnz	x0, #63, LBB0_12
; %bb.10:
Lloh15:
	adrp	x8, _MPI_RAID_ACTION_DELETE_VOLUME@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MPI_RAID_ACTION_DELETE_VOLUME@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldp	w3, w2, [x29, #-40]
Lloh18:
	adrp	x8, _MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _MPI_RAID_ACTION_ADATA_ZERO_LBA0@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MPI_RAID_ACTION_ADATA_ZERO_LBA0@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w5, w9, w8
	str	wzr, [sp, #40]
	movi.2d	v0, #0000000000000000
	stur	q0, [sp, #24]
	str	wzr, [sp, #16]
	str	q0, [sp]
	mov	x0, x19
	mov	w4, #0
	mov	x6, #0
	mov	w7, #0
	bl	_mpt_raid_action
	mov	x20, x0
	cbz	w0, LBB0_13
; %bb.11:
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_12:
	mov	x0, x19
	bl	_close
Lloh26:
	adrp	x8, _errno@GOTPAGE
Lloh27:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh28:
	ldr	w20, [x8]
	b	LBB0_8
LBB0_13:
	mov	w0, #-1
	mov	w1, #-1
	bl	_mpt_rescan_bus
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"delete: volume required"

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

l_.str.2:                               ; @.str.2
	.asciz	"Invalid volume %s"

	.comm	_MPI_RAID_ACTION_DELETE_VOLUME,4,2 ; @MPI_RAID_ACTION_DELETE_VOLUME
	.comm	_MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS,4,2 ; @MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS
	.comm	_MPI_RAID_ACTION_ADATA_ZERO_LBA0,4,2 ; @MPI_RAID_ACTION_ADATA_ZERO_LBA0
l_.str.3:                               ; @.str.3
	.asciz	"Failed to delete volume"

	.no_dead_strip	_delete_volume
.subsections_via_symbols
