// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/lib/bPlusTree.c
// Function: rTraverse
static void rTraverse(struct bptFile *bpt, bits64 blockStart, void *context, 
    void (*callback)(void *context, void *key, int keySize, void *val, int valSize) )
/* Recursively go across tree, calling callback at leaves. */
{
/* 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);

char keyBuf[bpt->keySize], valBuf[bpt->valSize];
if (isLeaf)
    {
    for (i=0; i<childCount; ++i)
        {
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	udcMustRead(bpt->udc, valBuf, bpt->valSize);
	callback(context, keyBuf, bpt->keySize, valBuf, bpt->valSize);
	}
    }
else
    {
    bits64 fileOffsets[childCount];
    /* Loop through to get file offsets of children. */
    for (i=0; i<childCount; ++i)
	{
	udcMustRead(bpt->udc, keyBuf, bpt->keySize);
	fileOffsets[i] = udcReadBits64(bpt->udc, isSwapped);
	}
    /* Loop through recursing on child offsets. */
    for (i=0; i<childCount; ++i)
	rTraverse(bpt, fileOffsets[i], context, callback);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x5ea30
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x21(%rbp), %rsi
movl $0x1, %edx
movq %rdx, -0x70(%rbp)
callq 0x5c730
movq -0x70(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x22(%rbp), %rsi
callq 0x5c730
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0x5e5f0
movw %ax, -0x26(%rbp)
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rsp, %rcx
movq %rcx, -0x38(%rbp)
movq %rax, %rdx
addq $0xf, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
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, -0x21(%rbp)
je 0x61636
movw $0x0, -0x24(%rbp)
movzwl -0x24(%rbp), %eax
movzwl -0x26(%rbp), %ecx
cmpl %ecx, %eax
jge 0x61631
movq -0x68(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x60(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rcx
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl 0x1c(%rdx), %edx
movq -0x8(%rbp), %r8
movl 0x20(%r8), %r8d
callq *%rax
movw -0x24(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x24(%rbp)
jmp 0x615c2
jmp 0x616ff
movzwl -0x26(%rbp), %edx
movl %edx, %eax
movq %rsp, %rcx
movq %rcx, -0x50(%rbp)
movl %edx, %ecx
leal 0xf(,%rcx,8), %ecx
andl $-0x10, %ecx
movl %ecx, %edx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x78(%rbp)
movq %rcx, %rsp
movq %rax, -0x58(%rbp)
movw $0x0, -0x24(%rbp)
movzwl -0x24(%rbp), %eax
movzwl -0x26(%rbp), %ecx
cmpl %ecx, %eax
jge 0x616bb
movq -0x68(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x5c730
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x2c(%rbp), %esi
callq 0x5e570
movq %rax, %rdx
movq -0x78(%rbp), %rax
movzwl -0x24(%rbp), %ecx
movq %rdx, (%rax,%rcx,8)
movw -0x24(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x24(%rbp)
jmp 0x61668
movw $0x0, -0x24(%rbp)
movzwl -0x24(%rbp), %eax
movzwl -0x26(%rbp), %ecx
cmpl %ecx, %eax
jge 0x616f8
movq -0x78(%rbp), %rax
movq -0x8(%rbp), %rdi
movzwl -0x24(%rbp), %ecx
movq (%rax,%rcx,8), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x614f0
movw -0x24(%rbp), %ax
addw $0x1, %ax
movw %ax, -0x24(%rbp)
jmp 0x616c1
movq -0x50(%rbp), %rax
movq %rax, %rsp
movq -0x38(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax,%rax)