	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmz_reset_zone
_dmz_reset_zone:                        ## @dmz_reset_zone
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rsi, %rdi
	callq	_dmz_is_offline
	xorl	%r14d, %r14d
	testq	%rax, %rax
	jne	LBB0_8
## %bb.1:
	movq	%rbx, %rdi
	callq	_dmz_is_readonly
	testq	%rax, %rax
	jne	LBB0_8
## %bb.2:
	movq	%rbx, %rdi
	callq	_dmz_is_rnd
	testq	%rax, %rax
	jne	LBB0_8
## %bb.3:
	movq	%rbx, %rdi
	callq	_dmz_is_empty
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_dmz_seq_write_err
	testq	%rax, %rax
	je	LBB0_7
LBB0_5:
	movq	(%r15), %r12
	movl	4(%r12), %r13d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_dmz_start_sect
	movl	(%r12), %edx
	movq	_GFP_NOIO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%r13d, %edi
	movl	%eax, %esi
	callq	_blkdev_reset_zones
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r13d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_dmz_id
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	movl	%r13d, %ecx
	callq	_dmz_dev_err
	movl	%r13d, %r14d
	jmp	LBB0_8
LBB0_7:
	movq	_DMZ_SEQ_WRITE_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%rbx), %rsi
	callq	_clear_bit
	movq	$0, (%rbx)
LBB0_8:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_NOIO,4,2                   ## @GFP_NOIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Reset zone %u failed %d"

	.comm	_DMZ_SEQ_WRITE_ERR,4,2          ## @DMZ_SEQ_WRITE_ERR
	.no_dead_strip	_dmz_reset_zone
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmz_reset_zone
_dmz_reset_zone:                        ; @dmz_reset_zone
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
	mov	x20, x0
	mov	x0, x1
	bl	_dmz_is_offline
	cbnz	x0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_dmz_is_readonly
	cbnz	x0, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_dmz_is_rnd
	cbz	x0, LBB0_5
LBB0_3:
	mov	w21, #0
LBB0_4:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	mov	x0, x19
	bl	_dmz_is_empty
	cbz	w0, LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_dmz_seq_write_err
	cbz	x0, LBB0_9
LBB0_7:
	ldr	x22, [x20]
	ldr	w21, [x22, #4]
	mov	x0, x20
	mov	x1, x19
	bl	_dmz_start_sect
	mov	x1, x0
	ldr	w2, [x22]
Lloh0:
	adrp	x8, _GFP_NOIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_NOIO@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	x0, x21
	bl	_blkdev_reset_zones
	cbz	w0, LBB0_9
; %bb.8:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x19
	bl	_dmz_id
	mov	x2, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	mov	x3, x21
	bl	_dmz_dev_err
	b	LBB0_4
LBB0_9:
Lloh5:
	adrp	x8, _DMZ_SEQ_WRITE_ERR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DMZ_SEQ_WRITE_ERR@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x19, #8
	bl	_clear_bit
	mov	w21, #0
	str	xzr, [x19]
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_NOIO,4,2                   ; @GFP_NOIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Reset zone %u failed %d"

	.comm	_DMZ_SEQ_WRITE_ERR,4,2          ; @DMZ_SEQ_WRITE_ERR
	.no_dead_strip	_dmz_reset_zone
.subsections_via_symbols
