LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ip_s_new_node
bcore_btree_node_ip_s* bcore_btree_ip_s_new_node( bcore_btree_ip_s* o )
{
    if( o->del_chain )
    {
        bcore_btree_node_ip_s* new_node = o->del_chain;
        o->del_chain = new_node->parent;
        bcore_btree_node_ip_s_init( new_node );
        return new_node;
    }
    else
    {
        if( o->chain_ins == o->chain_end )
        {
            bcore_btree_node_ip_s* new_ptr = bcore_alloc( NULL, o->block_size * sizeof( bcore_btree_node_ip_s ) + sizeof( bcore_btree_node_ip_s* ) );
            if( !o->chain_beg )
            {
                o->chain_beg = new_ptr;
            }
            else
            {
                ( ( bcore_btree_node_ip_s** )( o->chain_end ) )[ 0 ] = new_ptr;
            }
            o->chain_ins = new_ptr;
            o->chain_end = new_ptr + o->block_size;
            *( bcore_btree_node_ip_s** )( o->chain_end ) = NULL;
        }
        bcore_btree_node_ip_s* new_node = o->chain_ins;
        bcore_btree_node_ip_s_init( new_node );
        o->chain_ins++;
        return new_node;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0xa0550
movq 0x20(%rax), %rcx
movq %rcx, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0xa05b7
movq 0x18(%rbx), %rax
cmpq 0x10(%rbx), %rax
jne 0xa05a0
movq 0x28(%rbx), %rsi
shlq $0x6, %rsi
orq $0x8, %rsi
xorl %edi, %edi
callq 0x6023e
cmpq $0x0, 0x8(%rbx)
je 0xa057a
movq 0x10(%rbx), %rcx
jmp 0xa057e
leaq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, 0x18(%rbx)
movq 0x28(%rbx), %rcx
shlq $0x6, %rcx
movq %rax, %rdx
addq %rcx, %rdx
movq %rdx, 0x10(%rbx)
andq $0x0, (%rax,%rcx)
movq 0x18(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x40, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ip_s_val
bcore_btree_ip_val_t* bcore_btree_ip_s_val( const bcore_btree_ip_s* o, bcore_btree_ip_key_t key )
{
    if( !o )    return NULL;
    bcore_btree_node_ip_s* node = bcore_btree_node_ip_s_find( o->root, key );
    if( !node ) return NULL;
    if( node->kv1.key == key ) return &node->kv1.val;
    if( node->child2 && node->kv2.key == key ) return &node->kv2.val;
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0xa0bb0
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0x9fcea
testq %rax, %rax
je 0xa0bd0
cmpq %rbx, (%rax)
jne 0xa0bb3
addq $0x8, %rax
jmp 0xa0bd2
xorl %eax, %eax
retq
cmpq $0x0, 0x38(%rax)
je 0xa0bd0
movq %rax, %rcx
addq $0x18, %rcx
xorl %edx, %edx
cmpq %rbx, 0x10(%rax)
cmoveq %rcx, %rdx
movq %rdx, %rax
jmp 0xa0bd2
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ip_s_set
int bcore_btree_ip_s_set( bcore_btree_ip_s* o, bcore_btree_ip_key_t key, bcore_btree_ip_val_t val )
{
    if( !o ) return -2;
    if( !o->root )
    {
        o->root = bcore_btree_ip_s_new_node( o );
        o->root->child0 = o->root->child1 = BNUL_IP;
        o->root->child2 = NULL;
        o->root->kv1.key = key;
        o->root->kv1.val = val;
        return 1;
    }

    bcore_btree_node_ip_s* node = bcore_btree_node_ip_s_find( o->root, key );
    if( !node ) return -2;

    if( node->kv1.key == key )
    {
        if( node->kv1.val == val ) return 0;
        node->kv1.val = val;
        return -1;
    }
    else if( node->child2 && node->kv2.key == key )
    {
        if( node->kv2.val == val ) return 0;
        node->kv2.val = val;
        return -1;
    }
    else
    {
        bcore_btree_ip_kv_s kv = { key, val };
        bcore_btree_ip_s_push( o, node, &kv, BNUL_IP, BNUL_IP );
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
pushq $-0x2
popq %rbp
testq %rdi, %rdi
je 0xa0c80
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xa0c19
movq %r14, %rsi
callq 0x9fcea
testq %rax, %rax
je 0xa0c80
cmpq %r14, (%rax)
jne 0xa0c41
cmpq %rbx, 0x8(%rax)
je 0xa0c8d
movq %rbx, 0x8(%rax)
jmp 0xa0c58
movq %r15, %rdi
callq 0xa0527
movq %rax, (%r15)
leaq 0x78705(%rip), %rcx     # 0x119330
movq %rcx, 0x30(%rax)
movq %rcx, 0x28(%rax)
andq $0x0, 0x38(%rax)
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
jmp 0xa0c7d
cmpq $0x0, 0x38(%rax)
je 0xa0c5c
cmpq %r14, 0x10(%rax)
jne 0xa0c5c
cmpq %rbx, 0x18(%rax)
je 0xa0c8d
movq %rbx, 0x18(%rax)
pushq $-0x1
jmp 0xa0c7f
leaq 0x8(%rsp), %rdx
movq %r14, (%rdx)
movq %rbx, 0x8(%rdx)
leaq 0x786c1(%rip), %rcx     # 0x119330
movq %r15, %rdi
movq %rax, %rsi
movq %rcx, %r8
callq 0xa05d2
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0xa0c80
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ip_s_show
st_s* bcore_btree_ip_s_show( bcore_btree_ip_s* o )
{
    bcore_btree_node_ip_s_check_consistency( o->root );
    st_s* s = bcore_btree_node_ip_s_show( o->root, 0 );
    st_s_pushf( s, "\n" );
    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x9ff10
movq (%rbx), %rdi
xorl %esi, %esi
callq 0xa0377
movq %rax, %rbx
leaq 0x257c6(%rip), %rsi     # 0xc65cb
movq %rax, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_ps_s_find
bcore_btree_node_ps_s* bcore_btree_node_ps_s_find( bcore_btree_node_ps_s* root, bcore_btree_ps_key_t key )
{
    if( !root ) return NULL;
    bcore_btree_node_ps_s* node = NULL;
    while( root->child0 != BNUL_PS && root != node )
    {
        node = root;
        root = ( key < node->kv1.key )                                         ? node->child0 :
               ( !node->child2 && key > node->kv1.key )                        ? node->child1 :
               (  node->child2 && key > node->kv2.key )                        ? node->child2 :
               (  node->child2 && key > node->kv1.key && key < node->kv2.key ) ? node->child1 : node;
    }
    return root;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xa100f
leaq 0x783c1(%rip), %rcx     # 0x119370
movq %rax, %r9
movq %rdi, %rax
movq 0x28(%rdi), %rdi
cmpq %r9, %rax
je 0xa100f
cmpq %rcx, %rdi
je 0xa100f
movq (%rax), %r8
cmpq %rsi, %r8
ja 0xa0faf
movq 0x38(%rax), %rdx
testq %rdx, %rdx
sete %r9b
cmpq %rsi, %r8
setb %r10b
testb %r9b, %r10b
jne 0xa0ffd
movq %rax, %r9
testq %rdx, %rdx
je 0xa0fb9
movq 0x10(%rax), %r9
cmpq %rsi, %r8
jae 0xa1003
cmpq %rsi, %r9
jb 0xa1003
movq %rax, %r9
jbe 0xa0fb9
movq 0x30(%rax), %rdi
jmp 0xa0faf
cmpq %rsi, %r9
cmovaeq %rax, %rdx
movq %rdx, %rdi
jmp 0xa0faf
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_ps_s_run
void bcore_btree_node_ps_s_run( const bcore_btree_node_ps_s* root, void(*func)( vd_t arg, bcore_btree_ps_key_t key, bcore_btree_ps_val_t val ), vd_t arg )
{
    if( !root ) return;
    if( !func ) return;
    if( root->child0 )
    {
        if( root->child0 != BNUL_PS ) bcore_btree_node_ps_s_run( root->child0, func, arg );
    }
    if( root->child1 )
    {
        func( arg, root->kv1.key, root->kv1.val );
        if( root->child1 != BNUL_PS ) bcore_btree_node_ps_s_run( root->child1, func, arg );
    }
    if( root->child2 )
    {
        func( arg, root->kv2.key, root->kv2.val );
        if( root->child2 != BNUL_PS ) bcore_btree_node_ps_s_run( root->child2, func, arg );
    }
}

// Assembly:
testq %rsi, %rsi
je 0xa10a6
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x7833f(%rip), %r12     # 0x119370
testq %r15, %r15
je 0xa109b
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %r12, %rdi
sete %cl
orb %al, %cl
jne 0xa1055
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa1010
cmpq $0x0, 0x30(%r15)
je 0xa107d
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movq 0x30(%r15), %rdi
cmpq %r12, %rdi
je 0xa107d
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa1010
cmpq $0x0, 0x38(%r15)
je 0xa109b
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movq 0x38(%r15), %r15
cmpq %r12, %r15
jne 0xa1031
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_ps_s_count
uz_t bcore_btree_node_ps_s_count( const bcore_btree_node_ps_s* root, bl_t (*func)( vd_t arg, bcore_btree_ps_key_t key, bcore_btree_ps_val_t val ), vd_t arg )
{
    uz_t count = 0;
    if( !root ) return count;
    if( root->child0 )
    {
        if( root->child0 != BNUL_PS ) count += bcore_btree_node_ps_s_count( root->child0, func, arg );
    }
    if( root->child1 )
    {
        count += ( func ) ? func( arg, root->kv1.key, root->kv1.val ) : 1;
        if( root->child1 != BNUL_PS ) count += bcore_btree_node_ps_s_count( root->child1, func, arg );
    }
    if( root->child2 )
    {
        count += ( func ) ? func( arg, root->kv2.key, root->kv2.val ) : 1;
        if( root->child2 != BNUL_PS ) count += bcore_btree_node_ps_s_count( root->child2, func, arg );
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
leaq 0x782ab(%rip), %rbp     # 0x119370
testq %r15, %r15
je 0xa1169
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %rbp, %rdi
sete %cl
orb %al, %cl
je 0xa10e7
xorl %r12d, %r12d
jmp 0xa10f5
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa10a7
movq %rax, %r12
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0xa1130
pushq $0x1
popq %rax
testq %r14, %r14
je 0xa111a
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movzbl %al, %eax
movq 0x30(%r15), %rdi
addq %rax, %r12
cmpq %rbp, %rdi
je 0xa1130
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa10a7
addq %rax, %r12
movq 0x38(%r15), %rax
testq %rax, %rax
je 0xa116c
pushq $0x1
popq %rcx
testq %r14, %r14
je 0xa1156
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movzbl %al, %ecx
movq 0x38(%r15), %rax
addq %rcx, %r12
cmpq %rbp, %rax
je 0xa116c
addq %r12, %r13
movq %rax, %r15
jmp 0xa10c5
xorl %r12d, %r12d
addq %r13, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_ps_s_sum
uz_t bcore_btree_node_ps_s_sum( const bcore_btree_node_ps_s* root, bl_t (*func)( vd_t arg, bcore_btree_ps_key_t key, bcore_btree_ps_val_t val ), vd_t arg )
{
    uz_t sum = 0;
    if( !root ) return sum;
    if( root->child0 )
    {
        if( root->child0 != BNUL_PS ) sum += bcore_btree_node_ps_s_sum( root->child0, func, arg );
    }
    if( root->child1 )
    {
        sum += root->kv1.val * ( ( func ) ? func( arg, root->kv1.key, root->kv1.val ) : 1 );
        if( root->child1 != BNUL_PS ) sum += bcore_btree_node_ps_s_sum( root->child1, func, arg );
    }
    if( root->child2 )
    {
        sum += root->kv2.val * ( ( func ) ? func( arg, root->kv2.key, root->kv2.val ) : 1 );
        if( root->child2 != BNUL_PS ) sum += bcore_btree_node_ps_s_sum( root->child2, func, arg );
    }
    return sum;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %ebp, %ebp
testq %r15, %r15
je 0xa125e
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x781bf(%rip), %rcx     # 0x119370
cmpq %rcx, %rdi
sete %cl
orb %al, %cl
je 0xa11c0
xorl %r12d, %r12d
jmp 0xa11ce
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa1181
movq %rax, %r12
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0xa1217
movq 0x8(%r15), %r13
pushq $0x1
popq %rax
testq %r14, %r14
je 0xa11f6
movq (%r15), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq *%r14
movzbl %al, %eax
movq 0x30(%r15), %rdi
imulq %r13, %rax
addq %rax, %r12
leaq 0x7816c(%rip), %rax     # 0x119370
cmpq %rax, %rdi
je 0xa1217
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa1181
addq %rax, %r12
movq 0x38(%r15), %rax
testq %rax, %rax
je 0xa1261
movq 0x18(%r15), %r13
pushq $0x1
popq %rcx
testq %r14, %r14
je 0xa1240
movq 0x10(%r15), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq *%r14
movzbl %al, %ecx
movq 0x38(%r15), %rax
imulq %r13, %rcx
addq %rcx, %r12
leaq 0x78122(%rip), %rcx     # 0x119370
cmpq %rcx, %rax
je 0xa1261
addq %r12, %rbp
movq %rax, %r15
jmp 0xa1197
xorl %r12d, %r12d
addq %rbp, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_ps_s_keys
uz_t bcore_btree_node_ps_s_keys( bcore_btree_node_ps_s* root )
{
    if( !root || root == BNUL_PS ) return 0;
    uz_t keys = root->child2 ? 2 : 1;
    keys += bcore_btree_node_ps_s_keys( root->child0 );
    keys += bcore_btree_node_ps_s_keys( root->child1 );
    if( root->child2 ) keys += bcore_btree_node_ps_s_keys( root->child2 );
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq $0x0, (%rsp)
leaq 0x780dd(%rip), %r13     # 0x119370
xorl %r12d, %r12d
testq %r14, %r14
je 0xa12dc
cmpq %r13, %r14
je 0xa12dc
movq 0x28(%r14), %rdi
movq 0x38(%r14), %rbp
xorl %ebx, %ebx
testq %rbp, %rbp
sete %bl
callq 0xa1276
movq %rax, %r15
subq %rbx, %r15
movq 0x30(%r14), %rdi
callq 0xa1276
addq %r15, %rax
addq $0x2, %rax
testq %rbp, %rbp
je 0xa12d8
addq %rax, %r12
movq %rbp, %r14
jmp 0xa1296
movq %rax, (%rsp)
movq (%rsp), %rax
addq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_ps_s_show
st_s* bcore_btree_node_ps_s_show( bcore_btree_node_ps_s* o, uz_t depth )
{
    st_s* string = st_s_create();
    if( !o )
    {
        st_s_pushf( string, "()\n" );
        return string;
    }
    if( o->child1 )
    {
        if( o->child0 && o->child0 != BNUL_PS ) st_s_push_st_d( string, bcore_btree_node_ps_s_show( o->child0, depth + 1 ) );
        for( uz_t i = 0; i < depth; i++ ) st_s_pushf( string, "    " );
        st_s_pushf( string, "(%lu,%lu)\n", ( int64_t )(intptr_t)o->kv1.key, ( int64_t )(intptr_t)o->kv1.val );
        if( o->child1 && o->child1 != BNUL_PS ) st_s_pushf( string, "    " );
    }
    if( o->child2 )
    {
        for( uz_t i = 0; i < depth; i++ ) st_s_pushf( string, "    " );
        st_s_pushf( string, "(%lu,%lu)\n", ( int64_t )(intptr_t)o->kv2.key, ( int64_t )(intptr_t)o->kv2.val );
        if( o->child2 && o->child2 != BNUL_PS ) st_s_push_st_d( string, bcore_btree_node_ps_s_show( o->child2, depth + 1 ) );
    }
    return string;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
callq 0x8eb65
movq %rax, %rbx
testq %r15, %r15
je 0xa192d
cmpq $0x0, 0x30(%r15)
je 0xa18bb
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x77b2f(%rip), %r13     # 0x119370
cmpq %r13, %rdi
sete %cl
orb %al, %cl
jne 0xa185f
leaq 0x1(%r14), %rsi
callq 0xa1801
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8f2e5
leaq 0x1ff14(%rip), %r12     # 0xc177a
movq %r14, %rbp
subq $0x1, %rbp
jb 0xa187e
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x8f42b
jmp 0xa1869
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x2b1ab(%rip), %rsi     # 0xcca37
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x30(%r15), %rax
testq %rax, %rax
sete %cl
cmpq %r13, %rax
sete %al
orb %cl, %al
jne 0xa18bb
leaq 0x1fec9(%rip), %rsi     # 0xc177a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
cmpq $0x0, 0x38(%r15)
je 0xa193e
leaq 0x1feb1(%rip), %r12     # 0xc177a
movq %r14, %r13
subq $0x1, %r13
jb 0xa18e1
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x8f42b
jmp 0xa18cc
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
leaq 0x2b147(%rip), %rsi     # 0xcca37
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x38(%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x77a65(%rip), %rcx     # 0x119370
cmpq %rcx, %rdi
sete %cl
orb %al, %cl
jne 0xa193e
incq %r14
movq %r14, %rsi
callq 0xa1801
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8f2e5
jmp 0xa193e
leaq 0x2b000(%rip), %rsi     # 0xcc934
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_create
bcore_btree_ps_s* bcore_btree_ps_s_create( vd_t (*alloc)( vd_t, uz_t size ) )
{
    bcore_btree_ps_s* o = NULL;
    if( alloc )
    {
        o = alloc( NULL, sizeof( bcore_btree_ps_s ) );
        o->alloc = alloc;
    }
    else
    {
        o = bcore_alloc( NULL, sizeof( bcore_btree_ps_s ) );
        o->alloc = bcore_alloc;
    }
    o->root      = NULL;
    o->chain_beg = NULL;
    o->chain_end = NULL;
    o->chain_ins = NULL;
    o->del_chain = NULL;
    o->block_size = 1024;
    return o;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xa1962
movq %rdi, %rbx
pushq $0x38
popq %rsi
xorl %edi, %edi
callq *%rbx
jmp 0xa1973
pushq $0x38
popq %rsi
xorl %edi, %edi
callq 0x6023e
leaq -0x41735(%rip), %rbx    # 0x6023e
movq %rbx, 0x28(%rax)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq $0x400, 0x30(%rax)      # imm = 0x400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_discard
void bcore_btree_ps_s_discard( bcore_btree_ps_s* o )
{
    o->root = NULL;

    bcore_btree_node_ps_s* chain_beg = o->chain_beg;
    while( chain_beg )
    {
        bcore_btree_node_ps_s* new_beg = *( bcore_btree_node_ps_s** )( chain_beg + o->block_size );
        o->alloc( chain_beg, 0 );
        chain_beg = new_beg;
    }

    o->alloc( o, 0 );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xa19ba
movq 0x30(%rbx), %rax
shlq $0x6, %rax
movq (%rdi,%rax), %r14
xorl %esi, %esi
callq *0x28(%rbx)
movq %r14, %rdi
jmp 0xa199f
movq 0x28(%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_new_node
bcore_btree_node_ps_s* bcore_btree_ps_s_new_node( bcore_btree_ps_s* o )
{
    if( o->del_chain )
    {
        bcore_btree_node_ps_s* new_node = o->del_chain;
        o->del_chain = new_node->parent;
        bcore_btree_node_ps_s_init( new_node );
        return new_node;
    }
    else
    {
        if( o->chain_ins == o->chain_end )
        {
            bcore_btree_node_ps_s* new_ptr = o->alloc( NULL, o->block_size * sizeof( bcore_btree_node_ps_s ) + sizeof( bcore_btree_node_ps_s* ) );
            if( !o->chain_beg )
            {
                o->chain_beg = new_ptr;
            }
            else
            {
                ( ( bcore_btree_node_ps_s** )( o->chain_end ) )[ 0 ] = new_ptr;
            }
            o->chain_ins = new_ptr;
            o->chain_end = new_ptr + o->block_size;
            *( bcore_btree_node_ps_s** )( o->chain_end ) = NULL;
        }
        bcore_btree_node_ps_s* new_node = o->chain_ins;
        bcore_btree_node_ps_s_init( new_node );
        o->chain_ins++;
        return new_node;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0xa19f5
movq 0x20(%rax), %rcx
movq %rcx, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0xa1a5a
movq 0x18(%rbx), %rax
cmpq 0x10(%rbx), %rax
jne 0xa1a43
movq 0x30(%rbx), %rsi
shlq $0x6, %rsi
orq $0x8, %rsi
xorl %edi, %edi
callq *0x28(%rbx)
cmpq $0x0, 0x8(%rbx)
je 0xa1a1d
movq 0x10(%rbx), %rcx
jmp 0xa1a21
leaq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, 0x18(%rbx)
movq 0x30(%rbx), %rcx
shlq $0x6, %rcx
movq %rax, %rdx
addq %rcx, %rdx
movq %rdx, 0x10(%rbx)
andq $0x0, (%rax,%rcx)
movq 0x18(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x40, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_val
bcore_btree_ps_val_t* bcore_btree_ps_s_val( const bcore_btree_ps_s* o, bcore_btree_ps_key_t key )
{
    if( !o )    return NULL;
    bcore_btree_node_ps_s* node = bcore_btree_node_ps_s_find( o->root, key );
    if( !node ) return NULL;
    if( node->kv1.key == key ) return &node->kv1.val;
    if( node->child2 && node->kv2.key == key ) return &node->kv2.val;
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0xa206a
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0xa0fa1
testq %rax, %rax
je 0xa206d
cmpq %rbx, (%rax)
je 0xa2071
cmpq $0x0, 0x38(%rax)
je 0xa206d
movq %rax, %rcx
addq $0x18, %rcx
xorl %edx, %edx
cmpq %rbx, 0x10(%rax)
cmoveq %rcx, %rdx
movq %rdx, %rax
jmp 0xa2075
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0xa2075
addq $0x8, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_set
int bcore_btree_ps_s_set( bcore_btree_ps_s* o, bcore_btree_ps_key_t key, bcore_btree_ps_val_t val )
{
    if( !o ) return -2;
    if( !o->root )
    {
        o->root = bcore_btree_ps_s_new_node( o );
        o->root->child0 = o->root->child1 = BNUL_PS;
        o->root->child2 = NULL;
        o->root->kv1.key = key;
        o->root->kv1.val = val;
        return 1;
    }

    bcore_btree_node_ps_s* node = bcore_btree_node_ps_s_find( o->root, key );
    if( !node ) return -2;

    if( node->kv1.key == key )
    {
        if( node->kv1.val == val ) return 0;
        node->kv1.val = val;
        return -1;
    }
    else if( node->child2 && node->kv2.key == key )
    {
        if( node->kv2.val == val ) return 0;
        node->kv2.val = val;
        return -1;
    }
    else
    {
        bcore_btree_ps_kv_s kv = { key, val };
        bcore_btree_ps_s_push( o, node, &kv, BNUL_PS, BNUL_PS );
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
pushq $-0x2
popq %rbp
testq %rdi, %rdi
je 0xa2105
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xa20dc
movq %r14, %rsi
callq 0xa0fa1
testq %rax, %rax
je 0xa2105
cmpq %r14, (%rax)
je 0xa2112
cmpq $0x0, 0x38(%rax)
je 0xa20b9
cmpq %r14, 0x10(%rax)
je 0xa211e
leaq 0x8(%rsp), %rdx
movq %r14, (%rdx)
movq %rbx, 0x8(%rdx)
leaq 0x772a4(%rip), %rcx     # 0x119370
movq %r15, %rdi
movq %rax, %rsi
movq %rcx, %r8
callq 0xa1a75
jmp 0xa2102
movq %r15, %rdi
callq 0xa19cc
movq %rax, (%r15)
leaq 0x77282(%rip), %rcx     # 0x119370
movq %rcx, 0x30(%rax)
movq %rcx, 0x28(%rax)
andq $0x0, 0x38(%rax)
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpq %rbx, 0x8(%rax)
je 0xa2124
movq %rbx, 0x8(%rax)
jmp 0xa212c
cmpq %rbx, 0x18(%rax)
jne 0xa2128
xorl %ebp, %ebp
jmp 0xa2105
movq %rbx, 0x18(%rax)
pushq $-0x1
jmp 0xa2104
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_ps_s_show
st_s* bcore_btree_ps_s_show( bcore_btree_ps_s* o )
{
    bcore_btree_node_ps_s_check_consistency( o->root );
    st_s* s = bcore_btree_node_ps_s_show( o->root, 0 );
    st_s_pushf( s, "\n" );
    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xa1396
movq (%rbx), %rdi
xorl %esi, %esi
callq 0xa1801
movq %rax, %rbx
leaq 0x2430e(%rip), %rsi     # 0xc65cb
movq %rax, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_pp_s_find
bcore_btree_node_pp_s* bcore_btree_node_pp_s_find( bcore_btree_node_pp_s* root, bcore_btree_pp_key_t key )
{
    if( !root ) return NULL;
    bcore_btree_node_pp_s* node = NULL;
    while( root->child0 != BNUL_PP && root != node )
    {
        node = root;
        root = ( key < node->kv1.key )                                         ? node->child0 :
               ( !node->child2 && key > node->kv1.key )                        ? node->child1 :
               (  node->child2 && key > node->kv2.key )                        ? node->child2 :
               (  node->child2 && key > node->kv1.key && key < node->kv2.key ) ? node->child1 : node;
    }
    return root;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xa24c7
leaq 0x76f49(%rip), %rcx     # 0x1193b0
movq %rax, %r9
movq %rdi, %rax
movq 0x28(%rdi), %rdi
cmpq %r9, %rax
je 0xa24c7
cmpq %rcx, %rdi
je 0xa24c7
movq (%rax), %r8
cmpq %rsi, %r8
ja 0xa2467
movq 0x38(%rax), %rdx
testq %rdx, %rdx
sete %r9b
cmpq %rsi, %r8
setb %r10b
testb %r9b, %r10b
jne 0xa24b5
movq %rax, %r9
testq %rdx, %rdx
je 0xa2471
movq 0x10(%rax), %r9
cmpq %rsi, %r8
jae 0xa24bb
cmpq %rsi, %r9
jb 0xa24bb
movq %rax, %r9
jbe 0xa2471
movq 0x30(%rax), %rdi
jmp 0xa2467
cmpq %rsi, %r9
cmovaeq %rax, %rdx
movq %rdx, %rdi
jmp 0xa2467
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_pp_s_largest_below_equal
bcore_btree_pp_kv_s* bcore_btree_node_pp_s_largest_below_equal( bcore_btree_node_pp_s* root, bcore_btree_pp_key_t key )
{
    if( !root ) return NULL;
    if( root->child0 == BNUL_PP )
    {
        if( ( root->child2 ) && key >= root->kv2.key ) return &root->kv2;
        return ( key >= root->kv1.key ) ? &root->kv1 : NULL;
    }
    else if( ( root->child2 ) && key >= root->kv2.key )
    {
        bcore_btree_pp_kv_s* branch_kv = bcore_btree_node_pp_s_largest_below_equal( root->child2, key );
        return ( branch_kv ) ? branch_kv : &root->kv2;
    }
    else if( key >= root->kv1.key )
    {
        bcore_btree_pp_kv_s* branch_kv = bcore_btree_node_pp_s_largest_below_equal( root->child1, key );
        return ( branch_kv ) ? branch_kv : &root->kv1;
    }
    else
    {
        return bcore_btree_node_pp_s_largest_below_equal( root->child0, key );
    }
}

// Assembly:
pushq %rbx
xorl %eax, %eax
leaq 0x76ede(%rip), %rdx     # 0x1193b0
testq %rdi, %rdi
je 0xa253b
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
movq 0x38(%rbx), %rcx
cmpq %rdx, %rdi
je 0xa2509
testq %rcx, %rcx
je 0xa24f2
cmpq %rsi, 0x10(%rbx)
jbe 0xa251f
cmpq %rsi, (%rbx)
ja 0xa24d2
movq 0x30(%rbx), %rdi
callq 0xa24c8
testq %rax, %rax
cmoveq %rbx, %rax
jmp 0xa253b
testq %rcx, %rcx
je 0xa2514
cmpq %rsi, 0x10(%rbx)
jbe 0xa2534
xorl %eax, %eax
cmpq %rsi, (%rbx)
cmovbeq %rbx, %rax
jmp 0xa253b
addq $0x10, %rbx
movq %rcx, %rdi
callq 0xa24c8
testq %rax, %rax
cmovneq %rax, %rbx
jmp 0xa2538
addq $0x10, %rbx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_pp_s_run
void bcore_btree_node_pp_s_run( const bcore_btree_node_pp_s* root, void(*func)( vd_t arg, bcore_btree_pp_kv_s kv ), vd_t arg )
{
    if( !root ) return;
    if( !func ) return;
    if( root->child0 )
    {
        if( root->child0 != BNUL_PP ) bcore_btree_node_pp_s_run( root->child0, func, arg );
    }
    if( root->child1 )
    {
        func( arg, root->kv1 );
        if( root->child1 != BNUL_PP ) bcore_btree_node_pp_s_run( root->child1, func, arg );
    }
    if( root->child2 )
    {
        func( arg, root->kv2 );
        if( root->child2 != BNUL_PP ) bcore_btree_node_pp_s_run( root->child2, func, arg );
    }
}

// Assembly:
testq %rsi, %rsi
je 0xa25d3
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x76e52(%rip), %r12     # 0x1193b0
testq %r15, %r15
je 0xa25c8
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %r12, %rdi
sete %cl
orb %al, %cl
jne 0xa2582
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa253d
cmpq $0x0, 0x30(%r15)
je 0xa25aa
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movq 0x30(%r15), %rdi
cmpq %r12, %rdi
je 0xa25aa
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa253d
cmpq $0x0, 0x38(%r15)
je 0xa25c8
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movq 0x38(%r15), %r15
cmpq %r12, %r15
jne 0xa255e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_pp_s_count
uz_t bcore_btree_node_pp_s_count( const bcore_btree_node_pp_s* root, bl_t (*func)( vd_t arg, bcore_btree_pp_kv_s kv ), vd_t arg )
{
    uz_t count = 0;
    if( !root ) return count;
    if( root->child0 )
    {
        if( root->child0 != BNUL_PP ) count += bcore_btree_node_pp_s_count( root->child0, func, arg );
    }
    if( root->child1 )
    {
        count += ( func ) ? func( arg, root->kv1 ) : 1;
        if( root->child1 != BNUL_PP ) count += bcore_btree_node_pp_s_count( root->child1, func, arg );
    }
    if( root->child2 )
    {
        count += ( func ) ? func( arg, root->kv2 ) : 1;
        if( root->child2 != BNUL_PP ) count += bcore_btree_node_pp_s_count( root->child2, func, arg );
    }
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r13d, %r13d
leaq 0x76dbe(%rip), %rbp     # 0x1193b0
testq %r15, %r15
je 0xa2696
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %rbp, %rdi
sete %cl
orb %al, %cl
je 0xa2614
xorl %r12d, %r12d
jmp 0xa2622
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa25d4
movq %rax, %r12
movq 0x30(%r15), %rdi
testq %rdi, %rdi
je 0xa265d
pushq $0x1
popq %rax
testq %r14, %r14
je 0xa2647
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movzbl %al, %eax
movq 0x30(%r15), %rdi
addq %rax, %r12
cmpq %rbp, %rdi
je 0xa265d
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa25d4
addq %rax, %r12
movq 0x38(%r15), %rax
testq %rax, %rax
je 0xa2699
pushq $0x1
popq %rcx
testq %r14, %r14
je 0xa2683
movq 0x10(%r15), %rsi
movq 0x18(%r15), %rdx
movq %rbx, %rdi
callq *%r14
movzbl %al, %ecx
movq 0x38(%r15), %rax
addq %rcx, %r12
cmpq %rbp, %rax
je 0xa2699
addq %r12, %r13
movq %rax, %r15
jmp 0xa25f2
xorl %r12d, %r12d
addq %r13, %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_pp_s_keys
uz_t bcore_btree_node_pp_s_keys( bcore_btree_node_pp_s* root )
{
    if( !root || root == BNUL_PP ) return 0;
    uz_t keys = root->child2 ? 2 : 1;
    keys += bcore_btree_node_pp_s_keys( root->child0 );
    keys += bcore_btree_node_pp_s_keys( root->child1 );
    if( root->child2 ) keys += bcore_btree_node_pp_s_keys( root->child2 );
    return keys;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq $0x0, (%rsp)
leaq 0x76ce5(%rip), %r13     # 0x1193b0
xorl %r12d, %r12d
testq %r14, %r14
je 0xa2714
cmpq %r13, %r14
je 0xa2714
movq 0x28(%r14), %rdi
movq 0x38(%r14), %rbp
xorl %ebx, %ebx
testq %rbp, %rbp
sete %bl
callq 0xa26ae
movq %rax, %r15
subq %rbx, %r15
movq 0x30(%r14), %rdi
callq 0xa26ae
addq %r15, %rax
addq $0x2, %rax
testq %rbp, %rbp
je 0xa2710
addq %rax, %r12
movq %rbp, %r14
jmp 0xa26ce
movq %rax, (%rsp)
movq (%rsp), %rax
addq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_pp_s_show
st_s* bcore_btree_node_pp_s_show( bcore_btree_node_pp_s* o, uz_t depth )
{
    st_s* string = st_s_create();
    if( !o )
    {
        st_s_pushf( string, "()\n" );
        return string;
    }
    if( o->child1 )
    {
        if( o->child0 && o->child0 != BNUL_PP ) st_s_push_st_d( string, bcore_btree_node_pp_s_show( o->child0, depth + 1 ) );
        for( uz_t i = 0; i < depth; i++ ) st_s_pushf( string, "    " );
        st_s_pushf( string, "(%lu,%lu)\n", ( int64_t )(intptr_t)o->kv1.key, ( int64_t )(intptr_t)o->kv1.val );
        if( o->child1 && o->child1 != BNUL_PP ) st_s_pushf( string, "    " );
    }
    if( o->child2 )
    {
        for( uz_t i = 0; i < depth; i++ ) st_s_pushf( string, "    " );
        st_s_pushf( string, "(%lu,%lu)\n", ( int64_t )(intptr_t)o->kv2.key, ( int64_t )(intptr_t)o->kv2.val );
        if( o->child2 && o->child2 != BNUL_PP ) st_s_push_st_d( string, bcore_btree_node_pp_s_show( o->child2, depth + 1 ) );
    }
    return string;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
xorl %eax, %eax
callq 0x8eb65
movq %rax, %rbx
testq %r15, %r15
je 0xa2d65
cmpq $0x0, 0x30(%r15)
je 0xa2cf3
movq 0x28(%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x76737(%rip), %r13     # 0x1193b0
cmpq %r13, %rdi
sete %cl
orb %al, %cl
jne 0xa2c97
leaq 0x1(%r14), %rsi
callq 0xa2c39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8f2e5
leaq 0x1eadc(%rip), %r12     # 0xc177a
movq %r14, %rbp
subq $0x1, %rbp
jb 0xa2cb6
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x8f42b
jmp 0xa2ca1
movq (%r15), %rdx
movq 0x8(%r15), %rcx
leaq 0x29d73(%rip), %rsi     # 0xcca37
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x30(%r15), %rax
testq %rax, %rax
sete %cl
cmpq %r13, %rax
sete %al
orb %cl, %al
jne 0xa2cf3
leaq 0x1ea91(%rip), %rsi     # 0xc177a
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
cmpq $0x0, 0x38(%r15)
je 0xa2d76
leaq 0x1ea79(%rip), %r12     # 0xc177a
movq %r14, %r13
subq $0x1, %r13
jb 0xa2d19
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x8f42b
jmp 0xa2d04
movq 0x10(%r15), %rdx
movq 0x18(%r15), %rcx
leaq 0x29d0f(%rip), %rsi     # 0xcca37
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
movq 0x38(%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x7666d(%rip), %rcx     # 0x1193b0
cmpq %rcx, %rdi
sete %cl
orb %al, %cl
jne 0xa2d76
incq %r14
movq %r14, %rsi
callq 0xa2c39
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8f2e5
jmp 0xa2d76
leaq 0x29bc8(%rip), %rsi     # 0xcc934
movq %rbx, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_create
bcore_btree_pp_s* bcore_btree_pp_s_create( vd_t (*alloc)( vd_t, uz_t size ) )
{
    bcore_btree_pp_s* o = NULL;
    if( alloc )
    {
        o = alloc( NULL, sizeof( bcore_btree_pp_s ) );
        o->alloc = alloc;
    }
    else
    {
        o = bcore_alloc( NULL, sizeof( bcore_btree_pp_s ) );
        o->alloc = bcore_alloc;
    }
    o->root      = NULL;
    o->chain_beg = NULL;
    o->chain_end = NULL;
    o->chain_ins = NULL;
    o->del_chain = NULL;
    o->block_size = 1024;
    return o;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0xa2d9a
movq %rdi, %rbx
pushq $0x38
popq %rsi
xorl %edi, %edi
callq *%rbx
jmp 0xa2dab
pushq $0x38
popq %rsi
xorl %edi, %edi
callq 0x6023e
leaq -0x42b6d(%rip), %rbx    # 0x6023e
movq %rbx, 0x28(%rax)
xorps %xmm0, %xmm0
andq $0x0, 0x20(%rax)
movups %xmm0, (%rax)
movups %xmm0, 0x10(%rax)
movq $0x400, 0x30(%rax)      # imm = 0x400
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_discard
void bcore_btree_pp_s_discard( bcore_btree_pp_s* o )
{
    o->root = NULL;

    bcore_btree_node_pp_s* chain_beg = o->chain_beg;
    while( chain_beg )
    {
        bcore_btree_node_pp_s* new_beg = *( bcore_btree_node_pp_s** )( chain_beg + o->block_size );
        o->alloc( chain_beg, 0 );
        chain_beg = new_beg;
    }

    o->alloc( o, 0 );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
andq $0x0, (%rdi)
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0xa2df2
movq 0x30(%rbx), %rax
shlq $0x6, %rax
movq (%rdi,%rax), %r14
xorl %esi, %esi
callq *0x28(%rbx)
movq %r14, %rdi
jmp 0xa2dd7
movq 0x28(%rbx), %rax
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_new_node
bcore_btree_node_pp_s* bcore_btree_pp_s_new_node( bcore_btree_pp_s* o )
{
    if( o->del_chain )
    {
        bcore_btree_node_pp_s* new_node = o->del_chain;
        o->del_chain = new_node->parent;
        bcore_btree_node_pp_s_init( new_node );
        return new_node;
    }
    else
    {
        if( o->chain_ins == o->chain_end )
        {
            bcore_btree_node_pp_s* new_ptr = o->alloc( NULL, o->block_size * sizeof( bcore_btree_node_pp_s ) + sizeof( bcore_btree_node_pp_s* ) );
            if( !o->chain_beg )
            {
                o->chain_beg = new_ptr;
            }
            else
            {
                ( ( bcore_btree_node_pp_s** )( o->chain_end ) )[ 0 ] = new_ptr;
            }
            o->chain_ins = new_ptr;
            o->chain_end = new_ptr + o->block_size;
            *( bcore_btree_node_pp_s** )( o->chain_end ) = NULL;
        }
        bcore_btree_node_pp_s* new_node = o->chain_ins;
        bcore_btree_node_pp_s_init( new_node );
        o->chain_ins++;
        return new_node;
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0xa2e2d
movq 0x20(%rax), %rcx
movq %rcx, 0x20(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
jmp 0xa2e92
movq 0x18(%rbx), %rax
cmpq 0x10(%rbx), %rax
jne 0xa2e7b
movq 0x30(%rbx), %rsi
shlq $0x6, %rsi
orq $0x8, %rsi
xorl %edi, %edi
callq *0x28(%rbx)
cmpq $0x0, 0x8(%rbx)
je 0xa2e55
movq 0x10(%rbx), %rcx
jmp 0xa2e59
leaq 0x8(%rbx), %rcx
movq %rax, (%rcx)
movq %rax, 0x18(%rbx)
movq 0x30(%rbx), %rcx
shlq $0x6, %rcx
movq %rax, %rdx
addq %rcx, %rdx
movq %rdx, 0x10(%rbx)
andq $0x0, (%rax,%rcx)
movq 0x18(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rax)
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
addq $0x40, 0x18(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_exists
bl_t bcore_btree_pp_s_exists( const bcore_btree_pp_s* o, bcore_btree_pp_key_t key )
{
    if( !o ) return false;
    bcore_btree_node_pp_s* node = bcore_btree_node_pp_s_find( o->root, key );
    if( !node ) return false;
    if( node->kv1.key == key ) return true;
    if( node->child2 && node->kv2.key == key ) return true;
    return false;
}

// Assembly:
testq %rdi, %rdi
je 0xa349b
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0xa2459
testq %rax, %rax
je 0xa3497
movq %rax, %rcx
movb $0x1, %al
cmpq %rbx, (%rcx)
je 0xa3499
cmpq $0x0, 0x38(%rcx)
je 0xa3497
cmpq %rbx, 0x10(%rcx)
je 0xa3499
xorl %eax, %eax
popq %rbx
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_val
bcore_btree_pp_val_t* bcore_btree_pp_s_val( const bcore_btree_pp_s* o, bcore_btree_pp_key_t key )
{
    if( !o )    return NULL;
    bcore_btree_node_pp_s* node = bcore_btree_node_pp_s_find( o->root, key );
    if( !node ) return NULL;
    if( node->kv1.key == key ) return &node->kv1.val;
    if( node->child2 && node->kv2.key == key ) return &node->kv2.val;
    return NULL;
}

// Assembly:
testq %rdi, %rdi
je 0xa34de
pushq %rbx
movq %rsi, %rbx
movq (%rdi), %rdi
callq 0xa2459
testq %rax, %rax
je 0xa34e1
cmpq %rbx, (%rax)
je 0xa34e5
cmpq $0x0, 0x38(%rax)
je 0xa34e1
movq %rax, %rcx
addq $0x18, %rcx
xorl %edx, %edx
cmpq %rbx, 0x10(%rax)
cmoveq %rcx, %rdx
movq %rdx, %rax
jmp 0xa34e9
xorl %eax, %eax
retq
xorl %eax, %eax
jmp 0xa34e9
addq $0x8, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_set
int bcore_btree_pp_s_set( bcore_btree_pp_s* o, bcore_btree_pp_key_t key, bcore_btree_pp_val_t val )
{
    if( !o ) return -2;
    if( !o->root )
    {
        o->root = bcore_btree_pp_s_new_node( o );
        o->root->child0 = o->root->child1 = BNUL_PP;
        o->root->child2 = NULL;
        o->root->kv1.key = key;
        o->root->kv1.val = val;
        return 1;
    }

    bcore_btree_node_pp_s* node = bcore_btree_node_pp_s_find( o->root, key );
    if( !node ) return -2;

    if( node->kv1.key == key )
    {
        if( node->kv1.val == val ) return 0;
        node->kv1.val = val;
        return -1;
    }
    else if( node->child2 && node->kv2.key == key )
    {
        if( node->kv2.val == val ) return 0;
        node->kv2.val = val;
        return -1;
    }
    else
    {
        bcore_btree_pp_kv_s kv = { key, val };
        bcore_btree_pp_s_push( o, node, &kv, BNUL_PP, BNUL_PP );
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
pushq $-0x2
popq %rbp
testq %rdi, %rdi
je 0xa3579
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq (%rdi), %rdi
testq %rdi, %rdi
je 0xa3550
movq %r14, %rsi
callq 0xa2459
testq %rax, %rax
je 0xa3579
cmpq %r14, (%rax)
je 0xa3586
cmpq $0x0, 0x38(%rax)
je 0xa352d
cmpq %r14, 0x10(%rax)
je 0xa3592
leaq 0x8(%rsp), %rdx
movq %r14, (%rdx)
movq %rbx, 0x8(%rdx)
leaq 0x75e70(%rip), %rcx     # 0x1193b0
movq %r15, %rdi
movq %rax, %rsi
movq %rcx, %r8
callq 0xa2ead
jmp 0xa3576
movq %r15, %rdi
callq 0xa2e04
movq %rax, (%r15)
leaq 0x75e4e(%rip), %rcx     # 0x1193b0
movq %rcx, 0x30(%rax)
movq %rcx, 0x28(%rax)
andq $0x0, 0x38(%rax)
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
cmpq %rbx, 0x8(%rax)
je 0xa35a0
movq %rbx, 0x8(%rax)
jmp 0xa359c
cmpq %rbx, 0x18(%rax)
je 0xa35a0
movq %rbx, 0x18(%rax)
pushq $-0x1
jmp 0xa3578
xorl %ebp, %ebp
jmp 0xa3579
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_pp_s_show
st_s* bcore_btree_pp_s_show( bcore_btree_pp_s* o )
{
    bcore_btree_node_pp_s_check_consistency( o->root );
    st_s* s = bcore_btree_node_pp_s_show( o->root, 0 );
    st_s_pushf( s, "\n" );
    return s;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0xa27ce
movq (%rbx), %rdi
xorl %esi, %esi
callq 0xa2c39
movq %rax, %rbx
leaq 0x22ea2(%rip), %rsi     # 0xc65cb
movq %rax, %rdi
xorl %eax, %eax
callq 0x8f42b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_vd_s_find
bcore_btree_node_vd_s* bcore_btree_node_vd_s_find( bcore_btree_node_vd_s* root, bcore_btree_vd_key_t key )
{
    if( !root ) return NULL;
    bcore_btree_node_vd_s* node = NULL;
    while( root->child0 != BNUL_VP && root != node )
    {
        node = root;
        root = ( key < node->kv1.key )                                         ? node->child0 :
               ( !node->child2 && key > node->kv1.key )                        ? node->child1 :
               (  node->child2 && key > node->kv2.key )                        ? node->child2 :
               (  node->child2 && key > node->kv1.key && key < node->kv2.key ) ? node->child1 : node;
    }
    return root;
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0xa392d
leaq 0x75b23(%rip), %rcx     # 0x1193f0
movq %rax, %r9
movq %rdi, %rax
movq 0x18(%rdi), %rdi
cmpq %r9, %rax
je 0xa392d
cmpq %rcx, %rdi
je 0xa392d
movq (%rax), %r8
cmpq %rsi, %r8
ja 0xa38cd
movq 0x28(%rax), %rdx
testq %rdx, %rdx
sete %r9b
cmpq %rsi, %r8
setb %r10b
testb %r9b, %r10b
jne 0xa391b
movq %rax, %r9
testq %rdx, %rdx
je 0xa38d7
movq 0x8(%rax), %r9
cmpq %rsi, %r8
jae 0xa3921
cmpq %rsi, %r9
jb 0xa3921
movq %rax, %r9
jbe 0xa38d7
movq 0x20(%rax), %rdi
jmp 0xa38cd
cmpq %rsi, %r9
cmovaeq %rax, %rdx
movq %rdx, %rdi
jmp 0xa38cd
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_vd_s_largest_below_equal
bcore_btree_vd_key_t bcore_btree_node_vd_s_largest_below_equal( bcore_btree_node_vd_s* root, bcore_btree_vd_key_t key )
{
    if( !root ) return 0;
    if( root->child0 == BNUL_VP )
    {
        if( ( root->child2 ) && key >= root->kv2.key ) return root->kv2.key;
        return ( key >= root->kv1.key ) ? root->kv1.key : 0;
    }
    else if( ( root->child2 ) && key >= root->kv2.key )
    {
        bcore_btree_vd_key_t branch_key = bcore_btree_node_vd_s_largest_below_equal( root->child2, key );
        return ( branch_key >= root->kv2.key ) ? branch_key : root->kv2.key;
    }
    else if( key >= root->kv1.key )
    {
        bcore_btree_vd_key_t branch_key = bcore_btree_node_vd_s_largest_below_equal( root->child1, key );
        return ( branch_key >= root->kv1.key ) ? branch_key : root->kv1.key;
    }
    else
    {
        return bcore_btree_node_vd_s_largest_below_equal( root->child0, key );
    }
}

// Assembly:
pushq %rbx
xorl %eax, %eax
leaq 0x75ab8(%rip), %r8      # 0x1193f0
testq %rdi, %rdi
je 0xa3994
movq %rdi, %rdx
movq 0x18(%rdi), %rdi
movq 0x28(%rdx), %rcx
cmpq %r8, %rdi
je 0xa3969
testq %rcx, %rcx
je 0xa395b
movq 0x8(%rdx), %rbx
cmpq %rsi, %rbx
jbe 0xa3985
movq (%rdx), %rbx
cmpq %rsi, %rbx
ja 0xa3938
movq 0x20(%rdx), %rdi
jmp 0xa3988
testq %rcx, %rcx
je 0xa3977
movq 0x8(%rdx), %rax
cmpq %rsi, %rax
jbe 0xa3994
movq (%rdx), %rcx
xorl %eax, %eax
cmpq %rsi, %rcx
cmovbeq %rcx, %rax
jmp 0xa3994
movq %rcx, %rdi
callq 0xa392e
cmpq %rbx, %rax
cmovbq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_btree.c
// Function: bcore_btree_node_vd_s_run
void bcore_btree_node_vd_s_run( const bcore_btree_node_vd_s* root, void(*func)( vd_t arg, bcore_btree_vd_key_t key ), vd_t arg )
{
    if( !root ) return;
    if( !func ) return;
    if( root->child0 )
    {
        if( root->child0 != BNUL_VP ) bcore_btree_node_vd_s_run( root->child0, func, arg );
    }
    if( root->child1 )
    {
        func( arg, root->kv1.key );
        if( root->child1 != BNUL_VP ) bcore_btree_node_vd_s_run( root->child1, func, arg );
    }
    if( root->child2 )
    {
        func( arg, root->kv2.key );
        if( root->child2 != BNUL_VP ) bcore_btree_node_vd_s_run( root->child2, func, arg );
    }
}

// Assembly:
testq %rsi, %rsi
je 0xa3a24
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x75a39(%rip), %r12     # 0x1193f0
testq %r15, %r15
je 0xa3a19
movq 0x18(%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %r12, %rdi
sete %cl
orb %al, %cl
jne 0xa39db
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa3996
cmpq $0x0, 0x20(%r15)
je 0xa39ff
movq (%r15), %rsi
movq %rbx, %rdi
callq *%r14
movq 0x20(%r15), %rdi
cmpq %r12, %rdi
je 0xa39ff
movq %r14, %rsi
movq %rbx, %rdx
callq 0xa3996
cmpq $0x0, 0x28(%r15)
je 0xa3a19
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq *%r14
movq 0x28(%r15), %r15
cmpq %r12, %r15
jne 0xa39b7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq