	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmz_map
_dmz_map:                               ## @dmz_map
	.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	$40, %rsp
	.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), %r14
	movq	(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %rdi
	movl	$32, %esi
	callq	_dm_per_bio_data
	movq	%rax, %r12
	movl	(%rbx), %r15d
	movq	%rbx, %rdi
	callq	_bio_sectors
	movl	%eax, %r13d
	movq	(%r14), %rdi
	callq	_dmz_bdev_is_dying
	movq	_DM_MAPIO_KILL@GOTPCREL(%rip), %rcx
	testq	%rax, %rax
	je	LBB0_1
LBB0_13:
	movl	(%rcx), %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_bio_op
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	callq	_dmz_bio_chunk
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, %r12
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	(%r14), %r15
	movq	%rbx, %rdi
	callq	_dmz_bio_block
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_dmz_chunk_block
	movq	%rax, %r15
	movq	%rbx, %rdi
	callq	_dmz_bio_blocks
	movq	%rax, %r10
	leaq	L_.str(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	%r12, %r14
	movq	%r12, %rcx
	movl	%r13d, %r8d
	movq	-72(%rbp), %r9                  ## 8-byte Reload
	xorl	%eax, %eax
	pushq	%r10
	pushq	%r15
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	callq	_dmz_dev_debug
	addq	$16, %rsp
	movl	4(%r15), %esi
	movq	%rbx, %rdi
	callq	_bio_set_dev
	testl	%r13d, %r13d
	movl	%r13d, %r12d
	jne	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	callq	_bio_op
	movq	_REQ_OP_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_3
LBB0_4:
	movq	_DMZ_BLOCK_SECTORS_MASK@GOTPCREL(%rip), %rax
	movl	%r12d, %ecx
	orl	%r14d, %ecx
	testl	%ecx, (%rax)
	movq	_DM_MAPIO_KILL@GOTPCREL(%rip), %rcx
	jne	LBB0_13
## %bb.5:
	movq	%r15, %r13
	movq	%r14, %r15
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, 24(%rdi)
	movq	$0, 16(%rdi)
	movq	%rbx, 8(%rdi)
	movl	$1, %esi
	callq	_refcount_set
	movl	%r12d, %edx
	testl	%r12d, %r12d
	jne	LBB0_8
## %bb.6:
	movq	%rbx, %rdi
	callq	_bio_op
	movl	%r12d, %edx
	movq	_REQ_OP_WRITE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.7:
	leaq	16(%r14), %r15
	movq	%r15, %rdi
	callq	_spin_lock
	leaq	20(%r14), %rdi
	movq	%rbx, %rsi
	callq	_bio_list_add
	movq	%r15, %rdi
	callq	_spin_unlock
	movl	12(%r14), %edi
	addq	$8, %r14
	movq	%r14, %rsi
	xorl	%edx, %edx
	callq	_mod_delayed_work
	movq	_DM_MAPIO_SUBMITTED@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_8:
	movl	(%r13), %esi
	leal	-1(%rsi), %eax
	andl	%r15d, %eax
	addl	%eax, %edx
	cmpl	%esi, %edx
	jbe	LBB0_10
## %bb.9:
	subl	%eax, %esi
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_dm_accept_partial_bio
LBB0_10:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_dmz_queue_chunk_work
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movl	%eax, %r15d
	movq	(%r14), %r12
	movq	%rbx, %rdi
	callq	_bio_op
	movq	%rax, %r13
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	callq	_dmz_bio_chunk
	movslq	%eax, %rcx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	%r13, %rdx
	movl	%r15d, %r8d
	xorl	%eax, %eax
	callq	_dmz_dev_debug
	movq	_DM_MAPIO_REQUEUE@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_3:
	movq	_DM_MAPIO_REMAPPED@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_11:
	movq	_DM_MAPIO_SUBMITTED@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_DM_MAPIO_KILL,4,2              ## @DM_MAPIO_KILL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BIO op %d sector %llu + %u => chunk %llu, block %llu, %u blocks"

	.comm	_REQ_OP_WRITE,8,3               ## @REQ_OP_WRITE
	.comm	_DM_MAPIO_REMAPPED,4,2          ## @DM_MAPIO_REMAPPED
	.comm	_DMZ_BLOCK_SECTORS_MASK,4,2     ## @DMZ_BLOCK_SECTORS_MASK
	.comm	_DM_MAPIO_SUBMITTED,4,2         ## @DM_MAPIO_SUBMITTED
L_.str.1:                               ## @.str.1
	.asciz	"BIO op %d, can't process chunk %llu, err %i\n"

	.comm	_DM_MAPIO_REQUEUE,4,2           ## @DM_MAPIO_REQUEUE
	.no_dead_strip	_dmz_map
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmz_map
_dmz_map:                               ; @dmz_map
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x1
	ldr	x19, [x0]
	ldr	x21, [x19]
	mov	x0, x1
	mov	w1, #32
	bl	_dm_per_bio_data
	mov	x24, x0
	ldr	w22, [x20]
	mov	x0, x20
	bl	_bio_sectors
	mov	x23, x0
	ldr	x0, [x19]
	bl	_dmz_bdev_is_dying
	cbz	x0, LBB0_3
LBB0_1:
Lloh0:
	adrp	x8, _DM_MAPIO_KILL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DM_MAPIO_KILL@GOTPAGEOFF]
LBB0_2:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_3:
	mov	x0, x20
	bl	_bio_op
	mov	x25, x0
	ldr	x0, [x19]
	mov	x1, x20
	bl	_dmz_bio_chunk
	mov	x26, x0
	ldr	x27, [x19]
	mov	x0, x20
	bl	_dmz_bio_block
	mov	x1, x0
	mov	x0, x27
	bl	_dmz_chunk_block
	mov	x27, x0
	mov	x0, x20
	bl	_dmz_bio_blocks
	stp	x27, x0, [sp, #8]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	str	x26, [sp]
	mov	x0, x21
	mov	x2, x25
	mov	x3, x22
	mov	x4, x23
	bl	_dmz_dev_debug
	ldr	w1, [x21, #4]
	mov	x0, x20
	bl	_bio_set_dev
	cbnz	w23, LBB0_5
; %bb.4:
	mov	x0, x20
	bl	_bio_op
Lloh4:
	adrp	x8, _REQ_OP_WRITE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _REQ_OP_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_14
LBB0_5:
Lloh7:
	adrp	x8, _DMZ_BLOCK_SECTORS_MASK@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DMZ_BLOCK_SECTORS_MASK@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	orr	w9, w23, w22
	tst	w8, w9
	b.ne	LBB0_1
; %bb.6:
	stp	xzr, x19, [x24, #16]
	str	x20, [x24, #8]
	mov	x0, x24
	mov	w1, #1
	bl	_refcount_set
	cbnz	w23, LBB0_9
; %bb.7:
	mov	x0, x20
	bl	_bio_op
Lloh10:
	adrp	x8, _REQ_OP_WRITE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _REQ_OP_WRITE@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_9
; %bb.8:
	add	x21, x19, #16
	mov	x0, x21
	bl	_spin_lock
	add	x0, x19, #20
	mov	x1, x20
	bl	_bio_list_add
	mov	x0, x21
	bl	_spin_unlock
	ldr	w0, [x19, #12]
	add	x1, x19, #8
	mov	w2, #0
	bl	_mod_delayed_work
	b	LBB0_13
LBB0_9:
	ldr	w8, [x21]
	sub	w9, w8, #1
	and	w9, w9, w22
	add	w10, w9, w23
	cmp	w10, w8
	b.ls	LBB0_11
; %bb.10:
	sub	w1, w8, w9
	mov	x0, x20
	bl	_dm_accept_partial_bio
LBB0_11:
	mov	x0, x19
	mov	x1, x20
	bl	_dmz_queue_chunk_work
	cbz	w0, LBB0_13
; %bb.12:
	mov	x21, x0
	ldr	x22, [x19]
	mov	x0, x20
	bl	_bio_op
	mov	x23, x0
	ldr	x0, [x19]
	mov	x1, x20
	bl	_dmz_bio_chunk
	sxtw	x3, w0
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	mov	x4, x21
	bl	_dmz_dev_debug
Lloh15:
	adrp	x8, _DM_MAPIO_REQUEUE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DM_MAPIO_REQUEUE@GOTPAGEOFF]
	b	LBB0_2
LBB0_13:
Lloh17:
	adrp	x8, _DM_MAPIO_SUBMITTED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DM_MAPIO_SUBMITTED@GOTPAGEOFF]
	b	LBB0_2
LBB0_14:
Lloh19:
	adrp	x8, _DM_MAPIO_REMAPPED@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DM_MAPIO_REMAPPED@GOTPAGEOFF]
	b	LBB0_2
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_DM_MAPIO_KILL,4,2              ; @DM_MAPIO_KILL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BIO op %d sector %llu + %u => chunk %llu, block %llu, %u blocks"

	.comm	_REQ_OP_WRITE,8,3               ; @REQ_OP_WRITE
	.comm	_DM_MAPIO_REMAPPED,4,2          ; @DM_MAPIO_REMAPPED
	.comm	_DMZ_BLOCK_SECTORS_MASK,4,2     ; @DMZ_BLOCK_SECTORS_MASK
	.comm	_DM_MAPIO_SUBMITTED,4,2         ; @DM_MAPIO_SUBMITTED
l_.str.1:                               ; @.str.1
	.asciz	"BIO op %d, can't process chunk %llu, err %i\n"

	.comm	_DM_MAPIO_REQUEUE,4,2           ; @DM_MAPIO_REQUEUE
	.no_dead_strip	_dmz_map
.subsections_via_symbols
