	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_btree_keys_alloc           ## -- Begin function bch_btree_keys_alloc
	.p2align	4, 0x90
_bch_btree_keys_alloc:                  ## @bch_btree_keys_alloc
	.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
	movl	%edx, %r14d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movq	16(%r12), %rdi
	callq	_BUG_ON
	movl	%ebx, (%r15)
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	___get_free_pages
	movq	%rax, 16(%r12)
	testq	%rax, %rax
	je	LBB0_9
## %bb.1:
	movq	%r15, %rdi
	callq	_bset_tree_bytes
	movq	%rax, %rbx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%r15, %rdi
	callq	_bset_tree_bytes
	movq	%rax, %rdi
	cmpq	%r13, %rbx
	jge	LBB0_3
## %bb.2:
	movl	%r14d, %esi
	callq	_kmalloc
	jmp	LBB0_4
LBB0_3:
	callq	_get_order
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	___get_free_pages
LBB0_4:
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	movq	%r15, %rdi
	callq	_bset_prev_bytes
	movq	%rax, %r13
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movq	%r15, %rdi
	callq	_bset_prev_bytes
	movq	%rax, %rdi
	cmpq	%rbx, %r13
	jge	LBB0_7
## %bb.6:
	movl	%r14d, %esi
	callq	_kmalloc
	jmp	LBB0_8
LBB0_7:
	callq	_get_order
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	___get_free_pages
LBB0_8:
	movq	%rax, (%r12)
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_10
LBB0_9:
	movq	%r15, %rdi
	callq	_bch_btree_keys_free
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	subl	(%rax), %ecx
LBB0_10:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_btree_keys_alloc           ; -- Begin function bch_btree_keys_alloc
	.p2align	2
_bch_btree_keys_alloc:                  ; @bch_btree_keys_alloc
	.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, x2
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	ldr	x0, [x22, #16]
	bl	_BUG_ON
	str	w21, [x19]
	mov	x0, x20
	mov	x1, x21
	bl	___get_free_pages
	str	x0, [x22, #16]
	cbz	x0, LBB0_8
; %bb.1:
	mov	x0, x19
	bl	_bset_tree_bytes
	mov	x21, x0
Lloh0:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
	ldr	x24, [x23]
	mov	x0, x19
	bl	_bset_tree_bytes
	cmp	x21, x24
	b.ge	LBB0_3
; %bb.2:
	mov	x1, x20
	bl	_kmalloc
	str	x0, [x22, #8]
	cbnz	x0, LBB0_4
	b	LBB0_8
LBB0_3:
	bl	_get_order
	mov	x1, x0
	mov	x0, x20
	bl	___get_free_pages
	str	x0, [x22, #8]
	cbz	x0, LBB0_8
LBB0_4:
	mov	x0, x19
	bl	_bset_prev_bytes
	mov	x21, x0
	ldr	x23, [x23]
	mov	x0, x19
	bl	_bset_prev_bytes
	cmp	x21, x23
	b.ge	LBB0_7
; %bb.5:
	mov	x1, x20
	bl	_kmalloc
	str	x0, [x22]
	cbz	x0, LBB0_8
LBB0_6:
	mov	w0, #0
	b	LBB0_9
LBB0_7:
	bl	_get_order
	mov	x1, x0
	mov	x0, x20
	bl	___get_free_pages
	str	x0, [x22]
	cbnz	x0, LBB0_6
LBB0_8:
	mov	x0, x19
	bl	_bch_btree_keys_free
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
