	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __btree_sort
___btree_sort:                          ## @__btree_sort
	.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	%r9, -64(%rbp)                  ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	___GFP_NOWARN@GOTPCREL(%rip), %rax
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	orl	(%rax), %edi
	movl	%ebx, %esi
	callq	___get_free_pages
	movq	%rax, %r13
	testq	%rax, %rax
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	%r13, %r12
	jmp	LBB0_3
LBB0_2:
	xorl	%edi, %edi
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	cmpl	%ebx, (%r12)
	setb	%dil
	callq	_BUG_ON
	leaq	8(%r12), %rdi
	movq	%r12, %rbx
	movq	_GFP_NOIO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_mempool_alloc
	movq	%rax, %rdi
	callq	_page_address
	movq	%rax, %r12
	movl	(%rbx), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
LBB0_3:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_local_clock
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r14, %rdi
	movq	%r12, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	%ebx, %ecx
	xorl	%r8d, %r8d
	callq	_btree_mergesort
	movl	%r15d, (%r14)
	testl	%r15d, %r15d
	movl	%r15d, -52(%rbp)                ## 4-byte Spill
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	jne	LBB0_6
## %bb.4:
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	4(%r14), %eax
	jne	LBB0_6
## %bb.5:
	movq	8(%r14), %rax
	movq	(%rax), %rsi
	movl	16(%rsi), %eax
	movl	%eax, 20(%r12)
	movl	12(%rsi), %eax
	movl	%eax, 16(%r12)
	movl	8(%rsi), %eax
	movl	%eax, 12(%r12)
	movq	%r12, %rdi
	callq	_swap
	jmp	LBB0_7
LBB0_6:
	movl	8(%r12), %eax
	movq	8(%r14), %rcx
	movl	%r15d, %edx
	movq	(%rcx,%rdx,8), %rcx
	movl	%eax, 4(%rcx)
	movl	(%rcx), %r14d
	movq	(%r12), %r15
	movq	%r12, %rdi
	callq	_bset_bkey_last
	subl	(%r12), %eax
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_memcpy
LBB0_7:
	movq	%r12, %rdi
	testq	%r13, %r13
	je	LBB0_8
## %bb.9:
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_free_pages
	jmp	LBB0_10
LBB0_8:
	callq	_virt_to_page
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	8(%rcx), %rsi
	movl	%eax, %edi
	callq	_mempool_free
LBB0_10:
	movl	-52(%rbp), %ebx                 ## 4-byte Reload
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_bch_bset_build_written_tree
	testl	%ebx, %ebx
	je	LBB0_12
## %bb.11:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	addq	$4, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_bch_time_stats_update          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	___GFP_NOWARN,4,2               ## @__GFP_NOWARN
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.comm	_GFP_NOIO,4,2                   ## @GFP_NOIO
	.no_dead_strip	___btree_sort
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __btree_sort
___btree_sort:                          ; @__btree_sort
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x5
	mov	x26, x4
	mov	x23, x3
	mov	x20, x2
	mov	x27, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___GFP_NOWARN@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___GFP_NOWARN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _GFP_NOWAIT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GFP_NOWAIT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w0, w9, w8
	mov	x1, x3
	bl	___get_free_pages
	mov	x22, x0
	cbz	x0, LBB0_2
; %bb.1:
	mov	x25, x22
	b	LBB0_3
LBB0_2:
	ldr	w8, [x19]
	cmp	w8, w23
	cset	w0, lo
	bl	_BUG_ON
	add	x0, x19, #8
Lloh6:
	adrp	x8, _GFP_NOIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_NOIO@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_mempool_alloc
	bl	_page_address
	mov	x25, x0
	ldr	w23, [x19]
LBB0_3:
	bl	_local_clock
	mov	x24, x0
	mov	x0, x21
	mov	x1, x25
	mov	x2, x27
	mov	x3, x26
	mov	w4, #0
	bl	_btree_mergesort
	str	w20, [x21]
	cbnz	w20, LBB0_7
; %bb.4:
	ldr	w8, [x21, #4]
	cmp	w23, w8
	b.ne	LBB0_7
; %bb.5:
	ldr	x8, [x21, #8]
	ldr	x1, [x8]
	ldr	w8, [x1, #16]
	str	w8, [x25, #20]
	ldr	d0, [x1, #8]
	stur	d0, [x25, #12]
	mov	x0, x25
	bl	_swap
	mov	x0, x25
	cbnz	x22, LBB0_8
LBB0_6:
	bl	_virt_to_page
	add	x1, x19, #8
	bl	_mempool_free
	b	LBB0_9
LBB0_7:
	ldr	w8, [x25, #8]
	ldr	x9, [x21, #8]
	ldr	x9, [x9, w20, uxtw #3]
	str	w8, [x9, #4]
	ldr	w26, [x9]
	ldr	x27, [x25]
	mov	x0, x25
	bl	_bset_bkey_last
	ldr	w8, [x25]
	sub	w2, w0, w8
	mov	x0, x26
	mov	x1, x27
	bl	_memcpy
	mov	x0, x25
	cbz	x22, LBB0_6
LBB0_8:
	mov	x1, x23
	bl	_free_pages
LBB0_9:
	mov	x0, x21
	bl	_bch_bset_build_written_tree
	cbz	w20, LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_11:
	add	x0, x19, #4
	mov	x1, x24
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_bch_time_stats_update
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	___GFP_NOWARN,4,2               ; @__GFP_NOWARN
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.comm	_GFP_NOIO,4,2                   ; @GFP_NOIO
	.no_dead_strip	___btree_sort
.subsections_via_symbols
