	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_btree_sort_partial         ## -- Begin function bch_btree_sort_partial
	.p2align	4, 0x90
_bch_btree_sort_partial:                ## @bch_btree_sort_partial
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	(%rdi), %r15
	callq	_bch_count_data
	movl	%eax, %r14d
	movl	%r13d, %ecx
	shlq	$3, %rcx
	addq	16(%rbx), %rcx
	xorl	%r12d, %r12d
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	___bch_btree_iter_init
	testl	%r13d, %r13d
	je	LBB0_5
## %bb.1:
	movl	8(%rbx), %ecx
	movq	16(%rbx), %rax
	xorl	%esi, %esi
	cmpl	%r13d, %ecx
	jb	LBB0_4
## %bb.2:
	movl	%r13d, %edx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edx, %edi
	movq	(%rax,%rdi,8), %rdi
	addq	(%rdi), %rsi
	incl	%edx
	cmpl	%ecx, %edx
	jbe	LBB0_3
LBB0_4:
	movq	(%rax), %rdi
	callq	___set_bytes
	movl	%eax, %edi
	callq	_get_order
	movq	%rax, %r15
LBB0_5:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	callq	___btree_sort
	testl	%r14d, %r14d
	js	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_bch_count_data
	xorl	%r12d, %r12d
	cmpl	%r14d, %eax
	setne	%r12b
LBB0_7:
	movl	%r12d, %edi
	callq	_EBUG_ON
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_btree_sort_partial         ; -- Begin function bch_btree_sort_partial
	.p2align	2
_bch_btree_sort_partial:                ; @bch_btree_sort_partial
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x23, [x0]
	bl	_bch_count_data
	mov	x20, x0
	ldr	x8, [x19, #16]
	add	x3, x8, w22, uxtw #3
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, #0
	bl	___bch_btree_iter_init
	cbz	w22, LBB0_8
; %bb.1:
	ldr	w9, [x19, #8]
	ldr	x8, [x19, #16]
	cmp	w9, w22
	b.hs	LBB0_3
; %bb.2:
	mov	x1, #0
	b	LBB0_7
LBB0_3:
	add	w10, w9, #1
	add	w12, w22, #1
	cmp	w10, w12
	csinc	w11, w10, w22, hi
	sub	w11, w11, w22
	cmp	w11, #4
	b.lo	LBB0_5
; %bb.4:
	cmp	w10, w12
	csinc	w10, w10, w22, hi
	sub	w10, w10, #1
	cmp	w10, w22
	b.hs	LBB0_12
LBB0_5:
	mov	x1, #0
	mov	x10, x22
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x8, w10, uxtw #3]
	ldr	x11, [x11]
	add	x1, x11, x1
	add	w10, w10, #1
	cmp	w10, w9
	b.ls	LBB0_6
LBB0_7:
	ldr	x0, [x8]
	bl	___set_bytes
	bl	_get_order
	mov	x23, x0
LBB0_8:
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, x22
	mov	x3, x23
	mov	w4, #0
	mov	x5, x21
	bl	___btree_sort
	tbnz	w20, #31, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_bch_count_data
	cmp	w0, w20
	cset	w0, ne
	b	LBB0_11
LBB0_10:
	mov	w0, #0
LBB0_11:
	bl	_EBUG_ON
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_12:
	mov	x15, #0
	mov	x16, #0
	mov	x14, #0
	mov	x13, #0
	and	w12, w11, #0xfffffffc
	add	w10, w12, w22
	mov	x17, x22
	mov	x0, x12
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	add	w1, w17, #1
	add	w2, w17, #2
	add	w3, w17, #3
	ldr	x4, [x8, w17, uxtw #3]
	ldr	x1, [x8, w1, uxtw #3]
	ldr	x2, [x8, w2, uxtw #3]
	ldr	x3, [x8, w3, uxtw #3]
	ldr	x4, [x4]
	ldr	x1, [x1]
	ldr	x2, [x2]
	add	x15, x4, x15
	add	x16, x1, x16
	ldr	x1, [x3]
	add	x14, x2, x14
	add	x13, x1, x13
	add	w17, w17, #4
	subs	w0, w0, #4
	b.ne	LBB0_13
; %bb.14:
	add	x15, x16, x15
	add	x14, x14, x15
	add	x1, x13, x14
	cmp	w11, w12
	b.ne	LBB0_6
	b	LBB0_7
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
