	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmz_get_chunk_buffer           ## -- Begin function dmz_get_chunk_buffer
	.p2align	4, 0x90
_dmz_get_chunk_buffer:                  ## @dmz_get_chunk_buffer
	.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, %r14
	movq	%rdi, %r15
	callq	_dmz_lock_map
	movq	8(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_1
LBB0_7:
	movq	%r15, %rdi
	callq	_dmz_unlock_map
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_DMZ_ALLOC_RND@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_dmz_alloc_zone
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	4(%r15), %edi
	callq	_dmz_bdev_is_dying
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r15, %rdi
	callq	_dmz_wait_for_free_zones
	movq	8(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_2
	jmp	LBB0_7
LBB0_6:
	movq	%rax, %rbx
	movl	16(%r14), %r12d
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_dmz_id
	movl	%eax, %r13d
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_dmz_id
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%r13d, %edx
	movl	%eax, %ecx
	callq	_dmz_set_chunk_mapping
	movq	_DMZ_BUF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	addq	$20, %rsi
	callq	_set_bit
	movl	16(%r14), %eax
	movl	%eax, 16(%rbx)
	movq	%r14, 8(%rbx)
	movq	%rbx, 8(%r14)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_list_add_tail
	jmp	LBB0_7
LBB0_4:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	subl	(%rax), %edi
	callq	_ERR_PTR
	movq	%rax, %rbx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_DMZ_ALLOC_RND,4,2              ## @DMZ_ALLOC_RND
	.comm	_EIO,4,2                        ## @EIO
	.comm	_DMZ_BUF,4,2                    ## @DMZ_BUF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmz_get_chunk_buffer           ; -- Begin function dmz_get_chunk_buffer
	.p2align	2
_dmz_get_chunk_buffer:                  ; @dmz_get_chunk_buffer
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_dmz_lock_map
	ldr	x21, [x20, #8]
	cbz	x21, LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_dmz_unlock_map
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_2:
Lloh0:
	adrp	x22, _DMZ_ALLOC_RND@GOTPAGE
Lloh1:
	ldr	x22, [x22, _DMZ_ALLOC_RND@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x22]
	mov	x0, x19
	bl	_dmz_alloc_zone
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #4]
	bl	_dmz_bdev_is_dying
	cbnz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_dmz_wait_for_free_zones
	ldr	x21, [x20, #8]
	cbz	x21, LBB0_3
	b	LBB0_1
LBB0_6:
	mov	x21, x0
	ldr	w22, [x20, #16]
	mov	x0, x19
	mov	x1, x20
	bl	_dmz_id
	mov	x23, x0
	mov	x0, x19
	mov	x1, x21
	bl	_dmz_id
	mov	x3, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x23
	bl	_dmz_set_chunk_mapping
Lloh2:
	adrp	x8, _DMZ_BUF@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DMZ_BUF@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x1, x21, #20
	bl	_set_bit
	ldr	w8, [x20, #16]
	str	w8, [x21, #16]
	str	x20, [x21, #8]
	str	x21, [x20, #8]
	mov	x0, x21
	mov	x1, x19
	bl	_list_add_tail
	b	LBB0_1
LBB0_7:
Lloh5:
	adrp	x8, _EIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_ERR_PTR
	mov	x21, x0
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_DMZ_ALLOC_RND,4,2              ; @DMZ_ALLOC_RND
	.comm	_EIO,4,2                        ; @EIO
	.comm	_DMZ_BUF,4,2                    ; @DMZ_BUF
.subsections_via_symbols
