	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function snapshot_merge_next_chunks
_snapshot_merge_next_chunks:            ## @snapshot_merge_next_chunks
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_RUNNING_MERGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	52(%r13), %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	movq	_SHUTDOWN_MERGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_1
LBB0_6:
	movq	%r13, %rdi
	callq	_merge_shutdown
LBB0_14:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	cmpl	$0, 48(%r13)
	je	LBB0_2
## %bb.3:
	movq	24(%r13), %rdi
	movq	8(%rdi), %rax
	leaq	-48(%rbp), %rsi
	leaq	-64(%rbp), %rdx
	callq	*(%rax)
	testl	%eax, %eax
	jle	LBB0_4
## %bb.7:
	movl	%eax, %ecx
	movl	$1, %edx
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	subq	%rcx, %rdx
	movq	-48(%rbp), %rsi
	addq	%rdx, -64(%rbp)
	addq	%rdx, %rsi
	movq	%rsi, -48(%rbp)
	movq	24(%r13), %rdi
	movq	40(%r13), %rcx
	movl	(%rdi), %r15d
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	imull	%eax, %r15d
	movl	(%rcx), %ebx
	movl	%ebx, -76(%rbp)
	callq	_chunk_to_sector
	movq	%rax, %r12
	movq	%rax, -88(%rbp)
	movl	%ebx, %edi
	callq	_get_dev_size
	subq	%r12, %rax
	movl	%r15d, %edi
	movq	%rax, %rsi
	callq	_min
	movl	%eax, %ebx
	movl	%eax, -80(%rbp)
	movq	32(%r13), %rax
	movl	(%rax), %eax
	movl	%eax, -92(%rbp)
	movq	24(%r13), %rdi
	movq	-64(%rbp), %rsi
	callq	_chunk_to_sector
	movq	%rax, -104(%rbp)
	movl	%ebx, -96(%rbp)
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_read_pending_exceptions_done_count
	movq	%rax, %rbx
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_origin_write_extent
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_9 Depth=1
	movq	__pending_exceptions_done@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%eax, %eax
	callq	_read_pending_exceptions_done_count
	xorl	%esi, %esi
	cmpq	%rbx, %rax
	setne	%sil
	movl	%r14d, %edi
	callq	_wait_event
	jmp	LBB0_9
LBB0_10:
	leaq	12(%r13), %r14
	movq	%r14, %rdi
	callq	_down_write
	movq	-48(%rbp), %rax
	movq	%rax, 16(%r13)
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, 4(%r13)
	movq	%r14, %rdi
	callq	_up_write
	testl	%ebx, %ebx
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_13
## %bb.11:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	-48(%rbp), %rsi
	addq	%rbx, %rsi
	movq	%r13, %rdi
	callq	___check_for_conflicting_io
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_12
LBB0_13:
	movl	8(%r13), %edi
	movq	_merge_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	%r13, (%rsp)
	leaq	-104(%rbp), %rsi
	leaq	-88(%rbp), %rcx
	movl	$1, %edx
	xorl	%r8d, %r8d
	callq	_dm_kcopyd_copy
	jmp	LBB0_14
LBB0_2:
	leaq	L_.str(%rip), %rdi
	callq	_DMERR
	jmp	LBB0_6
LBB0_4:
	jns	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_DMERR
	leaq	12(%r13), %rbx
	movq	%rbx, %rdi
	callq	_down_write
	movl	$1, (%r13)
	movq	%rbx, %rdi
	callq	_up_write
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.comm	_RUNNING_MERGE,4,2              ## @RUNNING_MERGE
	.comm	_SHUTDOWN_MERGE,4,2             ## @SHUTDOWN_MERGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Snapshot is invalid: can't merge"

L_.str.1:                               ## @.str.1
	.asciz	"Read error in exception store: shutting down merge"

	.comm	__pending_exceptions_done,4,2   ## @_pending_exceptions_done
	.comm	_merge_callback,4,2             ## @merge_callback
	.no_dead_strip	_snapshot_merge_next_chunks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function snapshot_merge_next_chunks
_snapshot_merge_next_chunks:            ; @snapshot_merge_next_chunks
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x0
Lloh0:
	adrp	x8, _RUNNING_MERGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RUNNING_MERGE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	add	x20, x19, #52
	mov	x1, x20
	bl	_test_bit
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
Lloh3:
	adrp	x8, _SHUTDOWN_MERGE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SHUTDOWN_MERGE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
	bl	_unlikely
	cbz	x0, LBB0_3
LBB0_1:
	mov	x0, x19
	bl	_merge_shutdown
LBB0_2:
	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
	add	sp, sp, #128
	ret
LBB0_3:
	ldr	w8, [x19, #48]
	cbz	w8, LBB0_12
; %bb.4:
	ldr	x0, [x19, #24]
	ldr	x8, [x0, #8]
	ldr	x8, [x8]
	add	x1, sp, #40
	add	x2, sp, #32
	blr	x8
	mov	x20, x0
	cmp	w0, #0
	b.le	LBB0_13
; %bb.5:
	ldr	x8, [sp, #40]
	mov	w25, w20
	mov	w9, #1
	sub	x9, x9, x25
	add	x1, x9, x8
	ldr	x8, [sp, #32]
	add	x8, x9, x8
	stp	x8, x1, [sp, #32]
	ldr	x0, [x19, #24]
	ldr	w8, [x0]
	mul	w21, w8, w20
	ldr	x8, [x19, #40]
	ldr	w23, [x8]
	str	w23, [sp, #12]
	bl	_chunk_to_sector
	mov	x22, x0
	str	x0, [sp]
	mov	x0, x23
	bl	_get_dev_size
	sub	x1, x0, x22
	mov	x0, x21
	bl	_min
	mov	x23, x0
	str	w0, [sp, #8]
	ldp	x0, x8, [x19, #24]
	ldr	w8, [x8]
	str	w8, [sp, #28]
	ldr	x1, [sp, #32]
	bl	_chunk_to_sector
	str	x0, [sp, #16]
	str	w23, [sp, #24]
	bl	_read_pending_exceptions_done_count
	mov	x23, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_origin_write_extent
	cbz	x0, LBB0_8
; %bb.6:
Lloh6:
	adrp	x26, __pending_exceptions_done@GOTPAGE
Lloh7:
	ldr	x26, [x26, __pending_exceptions_done@GOTPAGEOFF]
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w24, [x26]
	bl	_read_pending_exceptions_done_count
	cmp	x0, x23
	cset	w1, ne
	mov	x0, x24
	bl	_wait_event
	bl	_read_pending_exceptions_done_count
	mov	x23, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_origin_write_extent
	cbnz	x0, LBB0_7
LBB0_8:
	add	x21, x19, #12
	mov	x0, x21
	bl	_down_write
	ldr	x8, [sp, #40]
	str	x8, [x19, #16]
	str	w20, [x19, #4]
	mov	x0, x21
	bl	_up_write
	cmp	w20, #1
	b.lt	LBB0_11
; %bb.9:
	mov	x20, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #40]
	add	x1, x20, x8
	mov	x0, x19
	bl	___check_for_conflicting_io
	add	x20, x20, #1
	cmp	x25, x20
	b.ne	LBB0_10
LBB0_11:
	ldr	w0, [x19, #8]
Lloh8:
	adrp	x8, _merge_callback@GOTPAGE
Lloh9:
	ldr	x8, [x8, _merge_callback@GOTPAGEOFF]
Lloh10:
	ldr	w5, [x8]
	add	x1, sp, #16
	mov	x3, sp
	mov	w2, #1
	mov	w4, #0
	mov	x6, x19
	bl	_dm_kcopyd_copy
	b	LBB0_2
LBB0_12:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DMERR
	b	LBB0_1
LBB0_13:
	tbz	w20, #31, LBB0_1
; %bb.14:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DMERR
	add	x20, x19, #12
	mov	x0, x20
	bl	_down_write
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x20
	bl	_up_write
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_RUNNING_MERGE,4,2              ; @RUNNING_MERGE
	.comm	_SHUTDOWN_MERGE,4,2             ; @SHUTDOWN_MERGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Snapshot is invalid: can't merge"

l_.str.1:                               ; @.str.1
	.asciz	"Read error in exception store: shutting down merge"

	.comm	__pending_exceptions_done,4,2   ; @_pending_exceptions_done
	.comm	_merge_callback,4,2             ; @merge_callback
	.no_dead_strip	_snapshot_merge_next_chunks
.subsections_via_symbols
