// File: /workspace/github_c_makefile_star2_O1/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 0x14f0e(%rip)           # 0x1d2b8
movq %rsi, %r13
movq %rdi, %rbp
movq 0x14ee9(%rip), %rax     # 0x1d2a0
testq %rax, %rax
je 0x83d5
movq 0x14eed(%rip), %rsi     # 0x1d2b0
leaq -0x1(%rax), %rdx
movq %rdx, 0x14ed2(%rip)     # 0x1d2a0
movq -0x8(%rsi,%rax,8), %rbx
jmp 0x8410
movl %ecx, 0x4(%rsp)
incq 0x14ee0(%rip)           # 0x1d2c0
cmpl $0x0, 0x14ee1(%rip)     # 0x1d2c8
jne 0x83ff
movq 0x14ee8(%rip), %rdi     # 0x1d2d8
callq 0x130a0
movl $0x1, 0x14ec9(%rip)     # 0x1d2c8
movl $0x40, %edi
callq 0x22a0
movq %rax, %rbx
movl 0x4(%rsp), %ecx
testq %rbx, %rbx
je 0x854e
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 0x1028c
movq %rax, 0x38(%rbx)
testq %rax, %rax
je 0x848d
movq 0x20(%rbx), %rsi
testq %rsi, %rsi
je 0x8476
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 0x8476
callq 0x107a3
movq %rbx, %rdi
callq 0x8154
testl %eax, %eax
jne 0x854e
xorl %eax, %eax
jmp 0x8553
movq 0x14e0c(%rip), %rax     # 0x1d2a0
movq 0x14e0d(%rip), %r14     # 0x1d2a8
cmpq %r14, %rax
jae 0x84bb
movq 0x14e09(%rip), %rcx     # 0x1d2b0
leaq 0x1(%rax), %rdx
movq %rdx, 0x14dee(%rip)     # 0x1d2a0
movq %rbx, (%rcx,%rax,8)
jmp 0x854e
movq 0x14df6(%rip), %rax     # 0x1d2b8
shrq $0x8, %rax
cmpq %rax, 0x14df3(%rip)     # 0x1d2c0
jbe 0x853c
testq %r14, %r14
je 0x8562
movq %r14, %rdi
shlq $0x4, %rdi
callq 0x22a0
testq %rax, %rax
je 0x853c
movq %rax, %r15
movq 0x14dbd(%rip), %r12     # 0x1d2b0
shlq $0x3, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2280
cmpq 0x14dc4(%rip), %r12     # 0x1d2d0
je 0x8516
movq %r12, %rdi
callq 0x2040
movq %r15, 0x14d93(%rip)     # 0x1d2b0
shlq 0x14d84(%rip)           # 0x1d2a8
movq 0x14d75(%rip), %rax     # 0x1d2a0
leaq 0x1(%rax), %rcx
movq %rcx, 0x14d6a(%rip)     # 0x1d2a0
movq %rbx, (%r15,%rax,8)
jmp 0x8544
movq %rbx, %rdi
callq 0x2040
xorps %xmm0, %xmm0
movups %xmm0, 0x14d6a(%rip)    # 0x1d2b8
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xbfcc(%rip), %rdi      # 0x14535
leaq 0xbfd6(%rip), %rsi      # 0x14546
leaq 0xbff1(%rip), %rcx      # 0x14568
movl $0x5a, %edx
callq 0x21c0