LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_release_obj
void bcore_tbman_s_release_obj( bcore_tbman_s* o, fp_down_obj down, vd_t ptr )
{
    if( !ptr ) return;
    tbman_s_lock( o );
    tbman_s_release_obj( o, down, ptr );
    tbman_s_unlock( o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x10853d
jmp 0x108560
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x108570
movq -0x8(%rbp), %rdi
callq 0x108280
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_release_obj
static void tbman_s_release_obj( bcore_tbman_s* o, fp_down_obj down, vd_t ptr )
{
    if( down )
    {
        vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, ptr );
        if( block_ptr && ( ( ptrdiff_t )( (u0_t*)ptr - (u0_t*)block_ptr ) < o->pool_size ) )
        {
            token_manager_s_release_obj( block_ptr, down, ptr );
        }
        else
        {
            external_manager_s_release_obj( &o->external_manager, down, ptr );
        }
    }
    else
    {
        tbman_s_release( o, ptr );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1085e6
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1085cf
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1085cf
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x10d480
jmp 0x1085e4
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x10d610
jmp 0x1085f3
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1084b0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_release_arg
void bcore_tbman_s_release_arg( bcore_tbman_s* o, fp_down_arg down, vc_t arg, vd_t ptr )
{
    if( !ptr ) return;
    tbman_s_lock( o );
    tbman_s_release_arg( o, down, arg, ptr );
    tbman_s_unlock( o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x108621
jmp 0x108648
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x108650
movq -0x8(%rbp), %rdi
callq 0x108280
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_release_arg
static void tbman_s_release_arg( bcore_tbman_s* o, fp_down_arg down, vc_t arg, vd_t ptr )
{
    if( down )
    {
        vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, ptr );
        if( block_ptr && ( ( ptrdiff_t )( (u0_t*)ptr - (u0_t*)block_ptr ) < o->pool_size ) )
        {
            token_manager_s_release_arg( block_ptr, down, arg, ptr );
        }
        else
        {
            external_manager_s_release_arg( &o->external_manager, down, arg, ptr );
        }
    }
    else
    {
        tbman_s_release( o, ptr );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1086d2
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1086b7
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1086b7
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x10ddc0
jmp 0x1086d0
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x10df60
jmp 0x1086df
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1084b0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_release_obj_arr
void bcore_tbman_s_release_obj_arr( bcore_tbman_s* o, fp_down_obj down, vd_t ptr, uz_t size, uz_t step )
{
    if( !ptr ) return;
    tbman_s_lock( o );
    tbman_s_release_obj_arr( o, down, ptr, size, step );
    tbman_s_unlock( o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x108715
jmp 0x108740
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x108750
movq -0x8(%rbp), %rdi
callq 0x108280
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_release_obj_arr
static void tbman_s_release_obj_arr( bcore_tbman_s* o, fp_down_obj down, vd_t ptr, uz_t size, uz_t step )
{
    if( down )
    {
        vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, ptr );
        if( block_ptr && ( ( ptrdiff_t )( (u0_t*)ptr - (u0_t*)block_ptr ) < o->pool_size ) )
        {
            token_manager_s_release_obj_arr( block_ptr, down, ptr, size, step );
        }
        else
        {
            external_manager_s_release_obj_arr( &o->external_manager, down, ptr, size, step );
        }
    }
    else
    {
        tbman_s_release( o, ptr );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1087de
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x1087bf
movq -0x18(%rbp), %rax
movq -0x30(%rbp), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1087bf
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x10e130
jmp 0x1087dc
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
callq 0x10e2f0
jmp 0x1087eb
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1084b0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_release_arg_arr
void bcore_tbman_s_release_arg_arr( bcore_tbman_s* o, fp_down_arg down, vc_t arg, vd_t ptr, uz_t size, uz_t step )
{
    if( !ptr ) return;
    tbman_s_lock( o );
    tbman_s_release_arg_arr( o, down, arg, ptr, size, step );
    tbman_s_unlock( o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x108829
jmp 0x108858
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x108860
movq -0x8(%rbp), %rdi
callq 0x108280
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_release_arg_arr
static void tbman_s_release_arg_arr( bcore_tbman_s* o, fp_down_arg down, vc_t arg, vd_t ptr, uz_t size, uz_t step )
{
    if( down )
    {
        vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, ptr );
        if( block_ptr && ( ( ptrdiff_t )( (u0_t*)ptr - (u0_t*)block_ptr ) < o->pool_size ) )
        {
            token_manager_s_release_arg_arr( block_ptr, down, arg, ptr, size, step );
        }
        else
        {
            external_manager_s_release_arg_arr( &o->external_manager, down, arg, ptr, size, step );
        }
    }
    else
    {
        tbman_s_release( o, ptr );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1088fa
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x20(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x1088d7
movq -0x20(%rbp), %rax
movq -0x38(%rbp), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1088d7
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x10e5d0
jmp 0x1088f8
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x10e7a0
jmp 0x108907
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1084b0
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_references
uz_t bcore_tbman_s_references( bcore_tbman_s* o, vc_t ptr )
{
    if( !ptr ) return 0;
    tbman_s_lock( o );
    uz_t n = tbman_s_references( o, ptr );
    tbman_s_unlock( o );
    return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x108931
movq $0x0, -0x8(%rbp)
jmp 0x10895c
movq -0x10(%rbp), %rdi
callq 0x108180
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x108970
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x108280
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_references
static uz_t tbman_s_references( bcore_tbman_s* o, vc_t ptr )
{
    vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, ( vd_t )ptr );
    if( block_ptr && ( ( ptrdiff_t )( (u0_t*)ptr - (u0_t*)block_ptr ) < o->pool_size ) )
    {
        return token_manager_s_references( block_ptr, ptr );
    }
    else
    {
        return external_manager_s_references( &o->external_manager, ptr );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1089c4
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1089c4
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x10e9e0
movq %rax, -0x8(%rbp)
jmp 0x1089d9
movq -0x10(%rbp), %rdi
addq $0x40, %rdi
movq -0x18(%rbp), %rsi
callq 0x10ea40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_b_alloc
vd_t bcore_tbman_s_b_alloc( bcore_tbman_s* o, vd_t current_ptr, uz_t requested_bytes, uz_t* granted_bytes )
{
    tbman_s_lock( o );
    vd_t ret = NULL;
    if( requested_bytes == 0 )
    {
        if( current_ptr )
        {
            tbman_s_mem_free( o, current_ptr, NULL );
        }
        if( granted_bytes ) *granted_bytes = 0;
    }
    else
    {
        if( current_ptr )
        {
            ret = tbman_s_mem_realloc( o, current_ptr, NULL, requested_bytes, granted_bytes );
        }
        else
        {
            ret = tbman_s_mem_alloc( o, requested_bytes, granted_bytes );
        }
    }
    tbman_s_unlock( o );
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq $0x0, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x108a4c
cmpq $0x0, -0x10(%rbp)
je 0x108a38
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x108aa0
cmpq $0x0, -0x20(%rbp)
je 0x108a4a
movq -0x20(%rbp), %rax
movq $0x0, (%rax)
jmp 0x108a89
cmpq $0x0, -0x10(%rbp)
je 0x108a72
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %r8
xorl %eax, %eax
movl %eax, %edx
callq 0x108b60
movq %rax, -0x28(%rbp)
jmp 0x108a87
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x108e60
movq %rax, -0x28(%rbp)
jmp 0x108a89
movq -0x8(%rbp), %rdi
callq 0x108280
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_mem_free
static void tbman_s_mem_free( bcore_tbman_s* o, vd_t current_ptr, const uz_t* current_bytes )
{
    if( current_bytes && *current_bytes <= o->max_block_size && o->aligned )
    {
        token_manager_s* token_manager = ( token_manager_s* )( ( intptr_t )current_ptr & ~( intptr_t )( o->pool_size - 1 ) );
        token_manager_s_free( token_manager, current_ptr );
    }
    else
    {
        vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, current_ptr );
        if( block_ptr && ( ( ptrdiff_t )( (u0_t*)current_ptr - (u0_t*)block_ptr ) < o->pool_size ) )
        {
            token_manager_s_free( block_ptr, current_ptr );
        }
        else
        {
            external_manager_s_free( &o->external_manager, current_ptr );
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x108b00
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
ja 0x108b00
movq -0x8(%rbp), %rax
testb $0x1, 0x28(%rax)
je 0x108b00
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq $0x1, %rcx
xorq $-0x1, %rcx
andq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10cdf0
jmp 0x108b53
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x108b40
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x108b40
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x10cdf0
jmp 0x108b51
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
callq 0x10eac0
jmp 0x108b53
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_mem_alloc
static vd_t tbman_s_mem_alloc( bcore_tbman_s* o, uz_t requested_bytes, uz_t* granted_bytes )
{
    block_manager_s* block_manager = NULL;
    for( uz_t i = 0; i < o->size; i++ )
    {
        if( requested_bytes <= o->block_size_array[ i ] )
        {
            block_manager = o->data[ i ];
            break;
        }
    }

    vd_t reserved_ptr = NULL;
    if( block_manager )
    {
        reserved_ptr = block_manager_s_alloc( block_manager );
        if( granted_bytes ) *granted_bytes = block_manager->block_size;
    }
    else
    {
        reserved_ptr = external_manager_s_malloc( &o->external_manager, requested_bytes, granted_bytes );
    }

    return reserved_ptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x108ecd
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movq 0x30(%rcx), %rcx
movq -0x28(%rbp), %rdx
cmpq (%rcx,%rdx,8), %rax
ja 0x108ebd
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
jmp 0x108ecd
jmp 0x108ebf
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x108e84
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x108f01
movq -0x20(%rbp), %rdi
callq 0x10d7e0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x108eff
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x108f1a
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x10eb90
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_bn_alloc
vd_t bcore_tbman_s_bn_alloc( bcore_tbman_s* o, vd_t current_ptr, uz_t current_bytes, uz_t requested_bytes, uz_t* granted_bytes )
{
    tbman_s_lock( o );
    vd_t ret = NULL;
    if( requested_bytes == 0 )
    {
        if( current_bytes ) // 0 means current_ptr may not be used for free or realloc
        {
            tbman_s_mem_free( o, current_ptr, &current_bytes );
        }
        if( granted_bytes ) *granted_bytes = 0;
    }
    else
    {
        if( current_bytes ) // 0 means current_ptr may not be used for free or realloc
        {
            ret = tbman_s_mem_realloc( o, current_ptr, &current_bytes, requested_bytes, granted_bytes );
        }
        else
        {
            ret = tbman_s_mem_alloc( o, requested_bytes, granted_bytes );
        }
    }
    tbman_s_unlock( o );
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq $0x0, -0x30(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x108f90
cmpq $0x0, -0x18(%rbp)
je 0x108f7c
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x108aa0
cmpq $0x0, -0x28(%rbp)
je 0x108f8e
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
jmp 0x108fcd
cmpq $0x0, -0x18(%rbp)
je 0x108fb6
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
leaq -0x18(%rbp), %rdx
callq 0x108b60
movq %rax, -0x30(%rbp)
jmp 0x108fcb
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x108e60
movq %rax, -0x30(%rbp)
jmp 0x108fcd
movq -0x8(%rbp), %rdi
callq 0x108280
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_get_instance
void bcore_tbman_s_get_instance( bcore_tbman_s* o, vc_t ptr, vd_t* root, uz_t* granted_space )
{
    tbman_s_lock( o );
    vd_t block_ptr = bcore_btree_vd_s_largest_below_equal( o->internal_btree, ( vd_t )ptr );
    if( block_ptr && ( ( ptrdiff_t )( (u0_t*)ptr - (u0_t*)block_ptr ) < o->pool_size ) )
    {
        token_manager_s* token_manager = block_ptr;
        if( root ) *root = token_manager_s_root( token_manager, ptr );
        if( granted_space ) *granted_space = token_manager->block_size;
    }
    else
    {
        external_manager_s_get_instance( &o->external_manager, ptr, root, granted_space );
    }
    tbman_s_unlock( o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x1288a0
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1091a0
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
subq %rcx, %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x1091a0
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x109188
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1091d0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x10919e
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1091b9
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x109230
movq -0x8(%rbp), %rdi
callq 0x108280
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: external_manager_s_get_instance
static void external_manager_s_get_instance( external_manager_s* o, vc_t ptr, vd_t* root, uz_t* granted_space )
{
    bcore_btree_pp_kv_s* kv = bcore_btree_pp_s_largest_below_equal( o->ex_btree, ( vd_t )ptr );
    if( !kv ) ERR( "Object has no root address in dynamic memory address in dynamic memory." );
    ext_s* ext = kv->val;
    if( ( ( ptrdiff_t )( ( u0_t* )ptr - ( u0_t* )kv->key ) ) >= ext->size ) ERR( "Object has no root address in dynamic memory." );

    if( root ) *root = kv->key;
    if( granted_space ) *granted_space = ext->size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x126590
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x109285
leaq 0x4e987(%rip), %rdi     # 0x157bf2
leaq 0x4e12b(%rip), %rsi     # 0x15739d
movl $0x4ae, %edx            # imm = 0x4AE
leaq 0x4e994(%rip), %rcx     # 0x157c12
movb $0x0, %al
callq 0x9cf40
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq -0x28(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq -0x30(%rbp), %rcx
cmpq (%rcx), %rax
jb 0x1092c9
leaq 0x4e943(%rip), %rdi     # 0x157bf2
leaq 0x4e0e7(%rip), %rsi     # 0x15739d
movl $0x4b0, %edx            # imm = 0x4B0
leaq 0x4e620(%rip), %rcx     # 0x1578e2
movb $0x0, %al
callq 0x9cf40
cmpq $0x0, -0x18(%rbp)
je 0x1092de
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpq $0x0, -0x20(%rbp)
je 0x1092f3
movq -0x30(%rbp), %rax
movq (%rax), %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_total_granted_space
uz_t bcore_tbman_s_total_granted_space( bcore_tbman_s* o )
{
    tbman_s_lock( o );
    uz_t space = tbman_s_total_alloc( o );
    tbman_s_unlock( o );
    return space;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
callq 0x1096e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108280
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_total_instances
uz_t bcore_tbman_s_total_instances( bcore_tbman_s* o )
{
    tbman_s_lock( o );
    uz_t size = tbman_s_total_instances( o );
    tbman_s_unlock( o );
    return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
callq 0x109760
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108280
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_total_references
uz_t bcore_tbman_s_total_references( bcore_tbman_s* o )
{
    tbman_s_lock( o );
    uz_t size = tbman_s_total_references( o );
    tbman_s_unlock( o );
    return size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
callq 0x1097e0
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108280
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: bcore_tbman_s_for_each_instance
void bcore_tbman_s_for_each_instance( bcore_tbman_s* o, void (*cb)( vd_t arg, vd_t ptr, uz_t space ), vd_t arg )
{
    if( !cb ) return;
    sz_t size = bcore_tbman_s_total_instances( o );
    if( !size ) return;

    bcore_tbman_mnode_arr arr;
    arr.data  = malloc( sizeof( bcore_tbman_mnode ) * size );
    arr.space = size;
    arr.size  = 0;

    tbman_s_lock( o );
    tbman_s_for_each_instance( o, for_each_instance_collect_callback, &arr );
    tbman_s_unlock( o );

    assert( arr.size == arr.space );

    for( sz_t i = 0; i < size; i++ ) cb( arg, arr.data[ i ].p, arr.data[ i ].s );

    free( arr.data );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x109840
jmp 0x1098f8
movq -0x8(%rbp), %rdi
callq 0x109720
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x109859
jmp 0x1098f8
movq -0x20(%rbp), %rdi
shlq $0x4, %rdi
callq 0x4150
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x8(%rbp), %rdi
callq 0x108180
movq -0x8(%rbp), %rdi
leaq 0xe2(%rip), %rsi        # 0x109970
leaq -0x38(%rbp), %rdx
callq 0x109900
movq -0x8(%rbp), %rdi
callq 0x108280
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0x1098ef
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rsi
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
movq 0x8(%rcx), %rdx
callq *%rax
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x1098a8
movq -0x38(%rbp), %rdi
callq 0x4200
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: block_manager_s_total_alloc
static uz_t block_manager_s_total_alloc( const block_manager_s* o )
{
    uz_t sum = 0;
    for( uz_t i = 0; i < o->size; i++ )
    {
        sum += token_manager_s_total_alloc( o->data[ i ] );
    }
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x10a4a5
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10ee30
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10a46c
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: block_manager_s_total_space
static uz_t block_manager_s_total_space( const block_manager_s* o )
{
    uz_t sum = 0;
    for( uz_t i = 0; i < o->size; i++ )
    {
        sum += token_manager_s_total_space( o->data[ i ] );
    }
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x10a505
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10ee50
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10a4cc
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_internal_total_alloc
static uz_t tbman_s_internal_total_alloc( const bcore_tbman_s* o )
{
    uz_t sum = 0;
    for( uz_t i = 0; i < o->size; i++ )
    {
        sum += block_manager_s_total_alloc( o->data[ i ] );
    }
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x10a5a4
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10a450
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10a56c
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_total_space
static uz_t tbman_s_total_space( const bcore_tbman_s* o )
{
    uz_t sum = 0;
    for( uz_t i = 0; i < o->size; i++ )
    {
        sum += block_manager_s_total_space( o->data[ i ] );
    }
    sum += block_manager_s_total_space( &o->external_manager.bm_ext );
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x10a604
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10a4b0
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10a5cc
movq -0x8(%rbp), %rdi
addq $0x40, %rdi
callq 0x10a4b0
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_internal_total_instances
static uz_t tbman_s_internal_total_instances( const bcore_tbman_s* o )
{
    uz_t sum = 0;
    for( uz_t i = 0; i < o->size; i++ )
    {
        sum += block_manager_s_total_instances( o->data[ i ] );
    }
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x10a6c4
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10eec0
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10a68c
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_internal_total_references
static uz_t tbman_s_internal_total_references( const bcore_tbman_s* o )
{
    uz_t sum = 0;
    for( uz_t i = 0; i < o->size; i++ )
    {
        sum += block_manager_s_total_references( o->data[ i ] );
    }
    return sum;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x10a764
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10ef70
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x10a72c
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: instance_diagnostics
static void instance_diagnostics( vd_t arg, vd_t ptr, uz_t space )
{
    printf( "ptr = %p, space = %5zu", ptr, space );
    if( bcore_name_try_name( ( ( tp_t* )ptr )[ 0 ] ) )
    {
        printf( ", aware of = '%s'", nameof( ( ( tp_t* )ptr )[ 0 ] ) );
        if( bcore_name_try_name( ( ( tp_t* )ptr )[ 1 ] ) )
        {
            printf( ", spect of = '%s'", nameof( ( ( tp_t* )ptr )[ 1 ] ) );
        }
    }
    printf( "\n" );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x4d42f(%rip), %rdi     # 0x157dd2
movb $0x0, %al
callq 0x4060
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xc10f0
cmpq $0x0, %rax
je 0x10aa0c
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x10f180
movq %rax, %rsi
leaq 0x4d417(%rip), %rdi     # 0x157de9
movb $0x0, %al
callq 0x4060
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0xc10f0
cmpq $0x0, %rax
je 0x10aa0a
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x10f180
movq %rax, %rsi
leaq 0x4d3f8(%rip), %rdi     # 0x157dfb
movb $0x0, %al
callq 0x4060
jmp 0x10aa0c
leaq 0x4800e(%rip), %rdi     # 0x152a21
movb $0x0, %al
callq 0x4060
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_thread_func
vd_t tbman_s_thread_func( vd_t arg )
{
    st_s* log = st_s_create();
    uz_t table_size = 10000;
    uz_t cycles     = 5;
    uz_t max_alloc  = 65536;
    uz_t seed       = 1237;
    st_s_push_st_d( log, tbman_alloc_challenge( bcore_tbman_bn_alloc, table_size, cycles, max_alloc, seed, true, false ) );
//    st_s_push_st_d( log, tbman_alloc_challenge( bcore_tbman_external_bn_alloc, table_size, cycles, max_alloc, seed, true, false ) );
    return log;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movb $0x0, %al
callq 0xff2e0
movq %rax, -0x10(%rbp)
movq $0x2710, -0x18(%rbp)    # imm = 0x2710
movq $0x5, -0x20(%rbp)
movq $0x10000, -0x28(%rbp)   # imm = 0x10000
movq $0x4d5, -0x30(%rbp)     # imm = 0x4D5
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rax
movl %eax, %r8d
leaq -0x1779(%rip), %rdi     # 0x1094d0
movl $0x1, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x10ac80
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0xfff40
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_quicktest
static void tbman_s_quicktest( void )
{
    uz_t table_size = 200;
    uz_t cycles     = 1;
    uz_t max_alloc  = 4096;
    uz_t seed       = 5479;
    st_s_discard( tbman_alloc_challenge( bcore_tbman_bn_alloc, table_size, cycles, max_alloc, seed, true, false ) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq $0xc8, -0x8(%rbp)
movq $0x1, -0x10(%rbp)
movq $0x1000, -0x18(%rbp)    # imm = 0x1000
movq $0x1567, -0x20(%rbp)    # imm = 0x1567
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movl %eax, %r8d
leaq -0x28e2(%rip), %rdi     # 0x1094d0
movl $0x1, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x10ac80
movq %rax, %rdi
callq 0xff600
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_instance_test
static void tbman_s_instance_test( void )
{
    for( uz_t size = 1; size < 10000000; size *= 2 )
    {
        uz_t space = 0;
        vd_t ptr = bcore_tbman_bn_alloc( NULL, 0, size, &space );
        uz_t instance_space = 0;
        vd_t instance_root = NULL;
        bcore_tbman_get_instance( ( u0_t* )ptr + ( size >> 1 ), &instance_root, &instance_space );
        ASSERT( instance_root == ptr );
        ASSERT( instance_space == space );
        bcore_tbman_free( ptr );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq $0x1, -0x8(%rbp)
cmpq $0x989680, -0x8(%rbp)   # imm = 0x989680
jae 0x10c068
movq $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x10(%rbp), %rcx
movq %rsi, %rdi
callq 0x1094d0
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rax
shrq %rax
addq %rax, %rdi
leaq -0x28(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x109620
movq -0x28(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x10c01c
leaq 0x279a5(%rip), %rdi     # 0x13399f
leaq 0x4c02d(%rip), %rsi     # 0x15802e
leaq 0x4c03b(%rip), %rdx     # 0x158043
leaq 0x4b38e(%rip), %rcx     # 0x15739d
movl $0xc56, %r8d            # imm = 0xC56
movb $0x0, %al
callq 0x9cea0
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x10c04f
leaq 0x27972(%rip), %rdi     # 0x13399f
leaq 0x4c025(%rip), %rsi     # 0x158059
leaq 0x4c008(%rip), %rdx     # 0x158043
leaq 0x4b35b(%rip), %rcx     # 0x15739d
movl $0xc57, %r8d            # imm = 0xC57
movb $0x0, %al
callq 0x9cea0
movq -0x18(%rbp), %rdi
callq 0x10f620
movq -0x8(%rbp), %rax
shlq %rax
movq %rax, -0x8(%rbp)
jmp 0x10bf90
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: tbman_s_memtest
static st_s* tbman_s_memtest( void )
{
    st_s* log = st_s_createf( "== tbman_s_memtest " );
    st_s_push_char_n( log, '=', 80 - log->size );
    st_s_push_char( log, '\n' );

    uz_t table_size = 10000;
    uz_t cycles     = 5;
    uz_t max_alloc  = 65536;
    uz_t seed       = 1237;

    {
        st_s_pushf( log, "\nbcore_internal_alloc:\n");
        st_s_push_st_d( log, tbman_alloc_challenge( bcore_tbman_bn_alloc, table_size, cycles, max_alloc, seed, true, false ) );
        st_s_push_st_d( log, bcore_tbman_s_status( tbman_s_g, 1 ) );
//        st_s_push_st_d( log, bcore_btree_vd_s_status( m->internal_btree ) );

    }

    {
        st_s_pushf( log, "\nbcore_external_alloc:\n");
        st_s_push_st_d( log, tbman_alloc_challenge( bcore_tbman_external_bn_alloc, table_size, cycles, max_alloc, seed, true, false ) );
    }

    st_s_push_char_n( log, '=', 80 );
    st_s_push_char( log, '\n' );
    return log;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
leaq 0x4b93e(%rip), %rdi     # 0x15818d
movb $0x0, %al
callq 0xff350
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl $0x50, %edx
subq 0x10(%rax), %rdx
movl $0x3d, %esi
callq 0xffca0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0xffba0
movq $0x2710, -0x10(%rbp)    # imm = 0x2710
movq $0x5, -0x18(%rbp)
movq $0x10000, -0x20(%rbp)   # imm = 0x10000
movq $0x4d5, -0x28(%rbp)     # imm = 0x4D5
movq -0x8(%rbp), %rdi
leaq 0x4b8f3(%rip), %rsi     # 0x1581a1
movb $0x0, %al
callq 0x100120
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movl %eax, %r8d
leaq -0x3407(%rip), %rdi     # 0x1094d0
movl $0x1, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x10ac80
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xfff40
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq 0xa6f6a(%rip), %rdi     # 0x1b3870
movl $0x1, %esi
callq 0x109b10
movq -0x38(%rbp), %rdi
movq %rax, %rsi
callq 0xfff40
movq -0x8(%rbp), %rdi
leaq 0x4b892(%rip), %rsi     # 0x1581b9
movb $0x0, %al
callq 0x100120
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movl %eax, %r8d
leaq -0x5120(%rip), %rdi     # 0x107830
movl $0x1, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
callq 0x10ac80
movq -0x30(%rbp), %rdi
movq %rax, %rsi
callq 0xfff40
movq -0x8(%rbp), %rdi
movl $0x3d, %esi
movl $0x50, %edx
callq 0xffca0
movq -0x8(%rbp), %rdi
movl $0xa, %esi
callq 0xffba0
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: block_manager_s_init
static void block_manager_s_init
    (
        block_manager_s* o,
        vd_t parent,
        uz_t pool_size,
        uz_t block_size,
        bl_t align,
        fp_lost_alignment lost_alignment_fp,
        bcore_btree_vd_s* internal_btree,
        down_manager_s* down_manager,
        bcore_mutex_s* mutex
    )
{
    bcore_memzero( o, sizeof( *o ) );
    o->parent = parent;
    o->aligned = true;
    o->sweep_hysteresis = 0.125;
    o->pool_size = pool_size;
    o->block_size = block_size;
    o->align = align;
    o->lost_alignment_fp = lost_alignment_fp;
    o->internal_btree = internal_btree;
    o->down_manager = down_manager;
    o->mutex = mutex;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %r8b, %al
movq 0x20(%rbp), %r8
movq 0x18(%rbp), %r8
movq 0x10(%rbp), %r8
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
andb $0x1, %al
movb %al, -0x21(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movl $0x70, %esi
callq 0x9d4f0
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x48(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x40(%rax)
movq -0x8(%rbp), %rax
movsd 0x4a97a(%rip), %xmm0    # 0x157378
movsd %xmm0, 0x38(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movb -0x21(%rbp), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x10(%rax)
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x50(%rax)
movq 0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq 0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq 0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: block_manager_s_down
static void block_manager_s_down( block_manager_s* o )
{
    if( o->data )
    {
        for( uz_t i = 0; i < o->size; i++ ) token_manager_s_discard( o->data[ i ] );
        free( o->data );
        o->data = NULL;
        o->size = o->space = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x10cb21
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x20(%rcx), %rax
jae 0x10caf0
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10cb30
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x10cabf
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4200
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x20(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: external_manager_s_fork
static void external_manager_s_fork( external_manager_s* o, vd_t ptr )
{
    bcore_btree_pp_kv_s* kv = bcore_btree_pp_s_largest_below_equal( o->ex_btree, ptr );
    if( !kv ) ERR( "Object has no root address in dynamic memory." );
    ext_s* ext = kv->val;
    if( ( ( ptrdiff_t )( ( u0_t* )ptr - ( u0_t* )kv->key ) ) >= ext->size ) ERR( "Object has no root address in dynamic memory." );
    ext->rc_count++;
    assert( ext->rc_count ); // overflow check
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x126590
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x10cc5d
leaq 0x4ac87(%rip), %rdi     # 0x1578ca
leaq 0x4a753(%rip), %rsi     # 0x15739d
movl $0x511, %edx            # imm = 0x511
leaq 0x4ac8c(%rip), %rcx     # 0x1578e2
movb $0x0, %al
callq 0x9cf40
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jb 0x10cca1
leaq 0x4ac43(%rip), %rdi     # 0x1578ca
leaq 0x4a70f(%rip), %rsi     # 0x15739d
movl $0x513, %edx            # imm = 0x513
leaq 0x4ac48(%rip), %rcx     # 0x1578e2
movb $0x0, %al
callq 0x9cf40
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x8(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: external_manager_s_release
static void external_manager_s_release( external_manager_s* o, vd_t ptr )
{
    bcore_btree_pp_kv_s* kv = bcore_btree_pp_s_largest_below_equal( o->ex_btree, ptr );
    if( !kv ) ERR( "Object has no root address in dynamic memory." );
    ext_s* ext = kv->val;
    if( ( ( ptrdiff_t )( ( u0_t* )ptr - ( u0_t* )kv->key ) ) >= ext->size ) ERR( "Object has no root address in dynamic memory." );
    external_manager_s_free_ext( o, kv->key, ext );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x126590
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x10cd8d
leaq 0x4abda(%rip), %rdi     # 0x15794d
leaq 0x4a623(%rip), %rsi     # 0x15739d
movl $0x51d, %edx            # imm = 0x51D
leaq 0x4ab5c(%rip), %rcx     # 0x1578e2
movb $0x0, %al
callq 0x9cf40
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
subq %rcx, %rax
movq -0x20(%rbp), %rcx
cmpq (%rcx), %rax
jb 0x10cdd1
leaq 0x4ab96(%rip), %rdi     # 0x15794d
leaq 0x4a5df(%rip), %rsi     # 0x15739d
movl $0x51f, %edx            # imm = 0x51F
leaq 0x4ab18(%rip), %rcx     # 0x1578e2
movb $0x0, %al
callq 0x9cf40
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x10d320
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_tbman.c
// Function: token_manager_s_free_token
static void token_manager_s_free_token( token_manager_s* o, u1_t token )
{
    #ifdef RTCHECKS
        if( token * o->block_size < sizeof( token_manager_s ) ) ERR( "Attempt to free reserved memory." );
        for( uz_t i = o->stack_index; i < o->stack_size; i++ ) if( o->token_stack[ i ] == token ) ERR( "Attempt to free memory that is declared free." );
    #endif // RTCHECKS

    // reference control
    if( o->rc_count_arr )
    {
        if( o->rc_count_arr[ token ] )
        {
            o->rc_count_arr[ token ]--;
            return;
        }

        if( o->rc_down_arr )
        {
            vd_t down = o->rc_down_arr[ token ];
            if( down )
            {
                bcore_mutex_s_unlock( o->mutex );
                ( ( down_s* )down )->_( down, ( u0_t* )o + token * o->block_size );
                bcore_mutex_s_lock( o->mutex );
                assert( o->down_manager );
                down_s_discard( o->down_manager, down );
                o->rc_down_arr[ token ] = NULL;
            }
        }
    }

    if( o->token_stack[ o->stack_index ] == 0 ) block_manager_s_full_to_free( o->parent, o );
    o->stack_index--;
    o->token_stack[ o->stack_index ] = token;
    if( o->stack_index == 0 ) block_manager_s_free_to_empty( o->parent, o );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x10cf0c
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movzwl -0xa(%rbp), %ecx
cmpq $0x0, (%rax,%rcx,8)
je 0x10ce82
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movzwl -0xa(%rbp), %ecx
movq (%rax,%rcx,8), %rdx
addq $-0x1, %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x10cf76
movq -0x8(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x10cf0a
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movzwl -0xa(%rbp), %ecx
movq (%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x10cf08
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10fc70
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
movzwl -0xa(%rbp), %ecx
movq -0x8(%rbp), %rdx
imulq 0x8(%rdx), %rcx
addq %rcx, %rsi
callq *%rax
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x10fc20
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x10cf80
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movzwl -0xa(%rbp), %ecx
movq $0x0, (%rax,%rcx,8)
jmp 0x10cf0a
jmp 0x10cf0c
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x12(%rcx), %ecx
movzwl 0x48(%rax,%rcx,2), %eax
cmpl $0x0, %eax
jne 0x10cf33
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x10cff0
movq -0x8(%rbp), %rax
movw 0x12(%rax), %cx
addw $-0x1, %cx
movw %cx, 0x12(%rax)
movw -0xa(%rbp), %dx
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movzwl 0x12(%rcx), %ecx
movw %dx, 0x48(%rax,%rcx,2)
movq -0x8(%rbp), %rax
movzwl 0x12(%rax), %eax
cmpl $0x0, %eax
jne 0x10cf76
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rsi
callq 0x10d080
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)