// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: rFind
static boolean rFind(struct bptFile *bpt, bits64 blockStart, void *key, void *val)
/* Find value corresponding to key.  If found copy value to memory pointed to by val and return 
 * true. Otherwise return false. */
{
/* Seek to start of block. */
udcSeek(bpt->udc, blockStart);

/* Read block header. */
UBYTE isLeaf;
UBYTE reserved;
bits16 i, childCount;
udcMustReadOne(bpt->udc, isLeaf);
udcMustReadOne(bpt->udc, reserved);
boolean isSwapped = bpt->isSwapped;
childCount = udcReadBits16(bpt->udc, isSwapped);

UBYTE keyBuf[bpt->keySize];   /* Place to put a key, buffered on stack. */

if (isLeaf)
    {
    for (i=0; i<childCount; ++i)
        {
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	udcMustRead(bpt->udc, val, bpt->valSize);
	if (memcmp(key, keyBuf, bpt->keySize) == 0)
	    return TRUE;
	}
    return FALSE;
    }
else
    {
    /* Read and discard first key. */
    udcMustRead(bpt->udc, keyBuf, bpt->keySize);

    /* Scan info for first file offset. */
    bits64 fileOffset = udcReadBits64(bpt->udc, isSwapped);

    /* Loop through remainder. */
    for (i=1; i<childCount; ++i)
	{
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	if (memcmp(key, keyBuf, bpt->keySize) < 0)
	    break;
	fileOffset = udcReadBits64(bpt->udc, isSwapped);
	}
    return rFind(bpt, fileOffset, key, val);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x5ea30
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
movq %rdx, -0x68(%rbp)
callq 0x5c730
movq -0x68(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x2a(%rbp), %rsi
callq 0x5c730
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x5e5f0
movw %ax, -0x2e(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x40(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x60(%rbp)
movq %rcx, %rsp
movq %rax, -0x48(%rbp)
cmpb $0x0, -0x29(%rbp)
je 0x62411
movw $0x0, -0x2c(%rbp)
movzwl -0x2c(%rbp), %eax
movzwl -0x2e(%rbp), %ecx
cmpl %ecx, %eax
jge 0x623fe
movq -0x60(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x60(%rbp), %rsi
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x62d0
cmpl $0x0, %eax
jne 0x623ee
movl $0x1, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x624c9
jmp 0x623f0
movw -0x2c(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x2c(%rbp)
jmp 0x62380
movl $0x0, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
jmp 0x624c9
movq -0x60(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x5e570
movq %rax, -0x58(%rbp)
movw $0x1, -0x2c(%rbp)
movzwl -0x2c(%rbp), %eax
movzwl -0x2e(%rbp), %ecx
cmpl %ecx, %eax
jge 0x624aa
movq -0x60(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x60(%rbp), %rsi
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x62d0
cmpl $0x0, %eax
jge 0x62488
jmp 0x624aa
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x34(%rbp), %esi
callq 0x5e570
movq %rax, -0x58(%rbp)
movw -0x2c(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x2c(%rbp)
jmp 0x62445
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
callq 0x622d0
movl %eax, -0x4(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x40(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax,%rax)