// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/kvlds/btree_find.c
// Function: btree_find_range
int
btree_find_range(struct btree * T, struct node * N,
    const struct kvldskey * k, int h,
    int (* callback)(void *, struct node *, struct kvldskey *),
    void * cookie)
{
	struct findleaf_cookie * C;

	/* Bake a cookie. */
	if ((C = mpool_findleaf_malloc()) == NULL)
		goto err0;
	C->callback = NULL;
	C->callback_range = callback;
	C->cookie = cookie;
	C->T = T;
	C->N = N;
	C->k = k;
	C->h = h;

	if ((C->e = kvldskey_create(NULL, 0)) == NULL)
		goto err1;

	/* Lock the node. */
	btree_node_lock(C->T, C->N);

	/* Call into findleaf. */
	if (findleaf(C)) {
		/* Upon error, findleaf has already freed C->e and C. */
		goto err0;
	}

	/* Success! */
	return (0);

err1:
	mpool_findleaf_free(C);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r12
movq %rdx, %r14
incq 0x14f8d(%rip)           # 0x1d2b8
movq %rsi, %r13
movq %rdi, %rbp
movq 0x14f68(%rip), %rax     # 0x1d2a0
testq %rax, %rax
je 0x8356
movq 0x14f6c(%rip), %rsi     # 0x1d2b0
leaq -0x1(%rax), %rdx
movq %rdx, 0x14f51(%rip)     # 0x1d2a0
movq -0x8(%rsi,%rax,8), %rbx
jmp 0x8391
movl %ecx, 0x4(%rsp)
incq 0x14f5f(%rip)           # 0x1d2c0
cmpl $0x0, 0x14f60(%rip)     # 0x1d2c8
jne 0x8380
movq 0x14f67(%rip), %rdi     # 0x1d2d8
callq 0x13090
movl $0x1, 0x14f48(%rip)     # 0x1d2c8
movl $0x40, %edi
callq 0x22a0
movq %rax, %rbx
movl 0x4(%rsp), %ecx
testq %rbx, %rbx
je 0x84dc
movq $0x0, (%rbx)
movq %r12, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movq %rbp, 0x18(%rbx)
movq %r13, 0x20(%rbx)
movq %r14, 0x28(%rbx)
movl %ecx, 0x30(%rbx)
xorl %edi, %edi
xorl %esi, %esi
callq 0x10214
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x840e
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x83f7
movq 0x18(%rbx), %rax
movq 0x30(%rax), %rdi
movq 0x20(%rdi), %rax
movq (%rsi,%rax), %rax
movq (%rax), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, (%rax)
testq %rcx, %rcx
jne 0x83f7
callq 0x1070f
movq %rbx, %rdi
callq 0x80ff
testl %eax, %eax
jne 0x84dc
xorl %eax, %eax
jmp 0x84e1
movq 0x14e8b(%rip), %r12     # 0x1d2a0
movq 0x14e8c(%rip), %r13     # 0x1d2a8
cmpq %r13, %r12
jae 0x843d
movq 0x14e88(%rip), %rax     # 0x1d2b0
leaq 0x1(%r12), %rcx
movq %rcx, 0x14e6c(%rip)     # 0x1d2a0
movq %rbx, (%rax,%r12,8)
jmp 0x84dc
movq 0x14e74(%rip), %rax     # 0x1d2b8
shrq $0x8, %rax
cmpq %rax, 0x14e71(%rip)     # 0x1d2c0
jbe 0x84ca
testq %r13, %r13
je 0x84f0
movq %r13, %rdi
shlq $0x4, %rdi
callq 0x22a0
testq %rax, %rax
je 0x84ca
movq %rax, %r14
movq 0x14e3b(%rip), %r15     # 0x1d2b0
leaq (,%r13,8), %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2280
cmpq 0x14e41(%rip), %r15     # 0x1d2d0
je 0x84a7
movq %r15, %rdi
callq 0x2040
movq 0x14e08(%rip), %r13     # 0x1d2a8
movq 0x14df9(%rip), %r12     # 0x1d2a0
movq %r14, 0x14e02(%rip)     # 0x1d2b0
addq %r13, %r13
movq %r13, 0x14df0(%rip)     # 0x1d2a8
leaq 0x1(%r12), %rax
movq %rax, 0x14ddc(%rip)     # 0x1d2a0
movq %rbx, (%r14,%r12,8)
jmp 0x84d2
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x14ddc(%rip)    # 0x1d2b8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbfde(%rip), %rdi      # 0x144d5
leaq 0xbfe8(%rip), %rsi      # 0x144e6
leaq 0xc003(%rip), %rcx      # 0x14508
movl $0x5a, %edx
callq 0x21c0