	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sync_file_merge
_sync_file_merge:                       ## @sync_file_merge
	.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	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	xorl	%eax, %eax
	callq	_sync_file_alloc
	testq	%rax, %rax
	je	LBB0_20
## %bb.1:
	movq	%rax, %r15
	leaq	-52(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_get_fences
	movq	%rax, %r13
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_get_fences
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	-52(%rbp), %eax
	movq	_INT_MAX@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	-48(%rbp), %ebx
	subl	%ebx, %ecx
	cmpl	%ecx, %eax
	jg	LBB0_20
## %bb.2:
	addl	%eax, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movl	$8, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.3:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	movl	$0, -44(%rbp)
	movl	-52(%rbp), %ecx
	xorl	%r13d, %r13d
	movl	-48(%rbp), %eax
	testl	%ecx, %ecx
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	jle	LBB0_4
## %bb.21:
	movl	$0, %r14d
	testl	%eax, %eax
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jle	LBB0_5
## %bb.22:
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movslq	%r14d, %rax
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%rax,8), %r15
	movslq	%r13d, %rax
	movq	(%r12,%rax,8), %r12
	movq	(%r12), %rax
	cmpq	%rax, (%r15)
	jge	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdx
	callq	_add_fence
	incl	%r14d
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_23 Depth=1
	jle	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-44(%rbp), %rsi
	movq	%r12, %rdx
	callq	_add_fence
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_23 Depth=1
	movl	8(%r15), %edx
	movl	12(%r15), %edi
	movl	12(%r12), %esi
	callq	___dma_fence_is_later
	testq	%rax, %rax
	cmoveq	%r12, %r15
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	leaq	-44(%rbp), %rsi
	movq	%r15, %rdx
	callq	_add_fence
	incl	%r14d
LBB0_28:                                ##   in Loop: Header=BB0_23 Depth=1
	incl	%r13d
LBB0_29:                                ##   in Loop: Header=BB0_23 Depth=1
	movl	-52(%rbp), %ecx
	movl	-48(%rbp), %eax
	cmpl	%ecx, %r14d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	jge	LBB0_5
## %bb.30:                              ##   in Loop: Header=BB0_23 Depth=1
	cmpl	%eax, %r13d
	jl	LBB0_23
	jmp	LBB0_5
LBB0_4:
	xorl	%r14d, %r14d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_5:
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
	cmpl	%ecx, %r14d
	jge	LBB0_9
## %bb.6:
	movslq	%r14d, %rbx
	leaq	-44(%rbp), %r15
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_add_fence
	incq	%rbx
	movslq	-52(%rbp), %rax
	cmpq	%rax, %rbx
	jl	LBB0_7
## %bb.8:
	movl	-48(%rbp), %eax
	movq	-72(%rbp), %r12                 ## 8-byte Reload
LBB0_9:
	cmpl	%eax, %r13d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jge	LBB0_12
## %bb.10:
	movslq	%r13d, %rbx
	leaq	-44(%rbp), %r15
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_add_fence
	incq	%rbx
	movslq	-48(%rbp), %rax
	cmpq	%rax, %rbx
	jl	LBB0_11
LBB0_12:
	movl	-44(%rbp), %edx
	testl	%edx, %edx
	jne	LBB0_14
## %bb.13:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	callq	_dma_fence_get
	movslq	-44(%rbp), %rcx
	leal	1(%rcx), %edx
	movl	%edx, -44(%rbp)
	movq	%rax, (%r14,%rcx,8)
LBB0_14:
	cmpl	%edx, -84(%rbp)                 ## 4-byte Folded Reload
	movq	-104(%rbp), %r15                ## 8-byte Reload
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
	jle	LBB0_17
## %bb.15:
	shll	$3, %edx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r14, %rdi
	movl	%edx, %esi
	movl	%eax, %edx
	callq	_krealloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.16:
	movq	%rax, %r14
	movl	-44(%rbp), %edx
LBB0_17:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_sync_file_set_fence
	testq	%rax, %rax
	js	LBB0_18
## %bb.31:
	movl	4(%r15), %edi
	movq	%rbx, %rsi
	movl	$4, %edx
	callq	_strlcpy
	jmp	LBB0_32
LBB0_18:
	movq	%r14, %rdi
	callq	_kfree
LBB0_19:
	movl	(%r15), %edi
	callq	_fput
LBB0_20:
	xorl	%r15d, %r15d
LBB0_32:
	movq	%r15, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_sync_file_merge
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sync_file_merge
_sync_file_merge:                       ; @sync_file_merge
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.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	x21, x2
	mov	x22, x1
	mov	x20, x0
	bl	_sync_file_alloc
	mov	x19, x0
	cbz	x0, LBB0_30
; %bb.1:
	add	x1, sp, #8
	mov	x0, x22
	bl	_get_fences
	mov	x22, x0
	add	x1, sp, #4
	mov	x0, x21
	bl	_get_fences
Lloh0:
	adrp	x9, _INT_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _INT_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w10, [x9]
	ldp	w9, w8, [sp, #4]
	sub	w10, w10, w9
	cmp	w8, w10
	b.gt	LBB0_29
; %bb.2:
	mov	x24, x0
	add	w23, w9, w8
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x23
	mov	w1, #8
	bl	_kcalloc
	cbz	x0, LBB0_28
; %bb.3:
	mov	x21, x0
	mov	w27, #0
	str	wzr, [sp, #12]
	ldp	w8, w9, [sp, #4]
	mov	w28, #0
	cmp	w9, #1
	b.lt	LBB0_13
; %bb.4:
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.5:
	mov	w28, #0
	mov	w27, #0
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x1, sp, #12
	mov	x0, x21
	mov	x2, x25
	bl	_add_fence
	add	w28, w28, #1
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldp	w8, w9, [sp, #4]
	cmp	w28, w9
	ccmp	w27, w8, #0, lt
	b.ge	LBB0_13
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x22, w28, sxtw #3]
	ldr	x26, [x24, w27, sxtw #3]
	ldr	x8, [x25]
	ldr	x9, [x26]
	cmp	x8, x9
	b.lt	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	b.le	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	add	x1, sp, #12
	mov	x0, x21
	mov	x2, x26
	bl	_add_fence
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [x26, #12]
	ldp	w2, w0, [x25, #8]
	bl	___dma_fence_is_later
	cmp	x0, #0
	csel	x2, x26, x25, eq
	add	x1, sp, #12
	mov	x0, x21
	bl	_add_fence
	add	w28, w28, #1
LBB0_12:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w27, w27, #1
	b	LBB0_7
LBB0_13:
	cmp	w28, w9
	b.ge	LBB0_17
; %bb.14:
	sxtw	x25, w28
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x22, x25, lsl #3]
	add	x1, sp, #12
	mov	x0, x21
	bl	_add_fence
	add	x25, x25, #1
	ldrsw	x8, [sp, #8]
	cmp	x25, x8
	b.lt	LBB0_15
; %bb.16:
	ldr	w8, [sp, #4]
LBB0_17:
	cmp	w27, w8
	b.ge	LBB0_20
; %bb.18:
	sxtw	x25, w27
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x24, x25, lsl #3]
	add	x1, sp, #12
	mov	x0, x21
	bl	_add_fence
	add	x25, x25, #1
	ldrsw	x8, [sp, #4]
	cmp	x25, x8
	b.lt	LBB0_19
LBB0_20:
	ldr	w2, [sp, #12]
	cbnz	w2, LBB0_22
; %bb.21:
	ldr	x0, [x22]
	bl	_dma_fence_get
	ldrsw	x8, [sp, #12]
	add	w2, w8, #1
	str	w2, [sp, #12]
	str	x0, [x21, x8, lsl #3]
LBB0_22:
	cmp	w23, w2
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
	b.le	LBB0_25
; %bb.23:
	lsl	w1, w2, #3
	ldr	w2, [x8]
	mov	x0, x21
	bl	_krealloc
	cbz	x0, LBB0_28
; %bb.24:
	mov	x21, x0
	ldr	w2, [sp, #12]
LBB0_25:
	mov	x0, x19
	mov	x1, x21
	bl	_sync_file_set_fence
	tbnz	x0, #63, LBB0_27
; %bb.26:
	ldr	w0, [x19, #4]
	mov	x1, x20
	mov	w2, #4
	bl	_strlcpy
	b	LBB0_30
LBB0_27:
	mov	x0, x21
	bl	_kfree
LBB0_28:
	ldr	w0, [x19]
	bl	_fput
LBB0_29:
	mov	x19, #0
LBB0_30:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_sync_file_merge
.subsections_via_symbols
