LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tpfp_s_fget
fp_t* bcore_hmap_tpfp_s_fget( bcore_hmap_tpfp_s* o, tp_t key, fp_t init_val )
{
    if( !key ) ERR( "key is 0" );
    uz_t idx = tpfp_find( o, key );
    if( idx < o->size )
    {
        return &o->nodes[ idx ].val;
    }
    else
    {
        return bcore_hmap_tpfp_s_set( o, key, init_val );
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
jne 0x683fe
leaq 0x5b070(%rip), %rdi     # 0xc3454
leaq 0x5af99(%rip), %rsi     # 0xc3384
leaq 0x5b016(%rip), %rcx     # 0xc3408
movl $0x70a, %edx            # imm = 0x70A
xorl %eax, %eax
callq 0x60031
movq %r15, %rdi
movq %r14, %rsi
callq 0x68366
cmpq 0x18(%r15), %rax
jae 0x68424
movq 0x8(%r15), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x68437
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tpfp_s_set
fp_t* bcore_hmap_tpfp_s_set( bcore_hmap_tpfp_s* o, tp_t key, fp_t val )
{
    if( !key ) ERR( "key is zero" );

    uz_t idx = tpfp_find( o, key );
    if( idx < o->size )
    {
        o->nodes[ idx ].val = val;
        return &o->nodes[ idx ].val;
    }

    idx = tpfp_set( o, ( bcore_hnode_tpfp_s ){ .key = key, .val = val }, 1 );
    if( idx < o->size ) return &o->nodes[ idx ].val;

    // rehash
    {
        o->flags = bcore_u_alloc( sizeof( bl_t ), o->flags, 0, NULL );
        bcore_hnode_tpfp_s* buf_nodes = o->nodes;
        uz_t  buf_size = o->size;
        o->depth_limit = ( o->size > 0 ) ? o->depth_limit + 1 : 4;
        o->size        = ( o->size > 0 ) ? o->size * 2        : 8;
        o->nodes = bcore_u_memzero( sizeof( bcore_hnode_tpfp_s ), NULL, o->size );
        for( uz_t i = 0; i < buf_size; i++ )
        {
            if( buf_nodes[ i ].key ) bcore_hmap_tpfp_s_set( o, buf_nodes[ i ].key, buf_nodes[ i ].val );
        }
        bcore_alloc( buf_nodes, 0 );
    }

    return bcore_hmap_tpfp_s_set( o, key, val );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %r12
testq %r15, %r15
jne 0x68476
leaq 0x5b00f(%rip), %rdi     # 0xc346b
leaq 0x5af21(%rip), %rsi     # 0xc3384
movl $0x71a, %edx            # imm = 0x71A
leaq 0x5af51(%rip), %rcx     # 0xc33c0
xorl %eax, %eax
callq 0x60031
movq %r14, %rdi
movq %r15, %rsi
callq 0x68366
cmpq 0x18(%r14), %rax
jb 0x6852d
movq %r14, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq %r12, %rcx
callq 0x681d4
cmpq 0x18(%r14), %rax
jb 0x68545
movq 0x10(%r14), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6025e
movq %rax, 0x10(%r14)
movq 0x18(%r14), %r13
pushq $0x4
popq %rax
testq %r13, %r13
je 0x684ce
movq 0x20(%r14), %rax
incq %rax
movq 0x8(%r14), %rbp
leaq (,%r13,2), %rdx
testq %r13, %r13
movq %rax, 0x20(%r14)
pushq $0x8
popq %rax
cmoveq %rax, %rdx
movq %rdx, 0x18(%r14)
pushq $0x10
popq %rdi
xorl %esi, %esi
callq 0x602ac
movq %rax, 0x8(%r14)
leaq 0x8(%rbp), %rbx
subq $0x1, %r13
jb 0x6851e
movq -0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x68518
movq (%rbx), %rdx
movq %r14, %rdi
callq 0x68437
addq $0x10, %rbx
jmp 0x684fe
movq %rbp, %rdi
xorl %esi, %esi
callq 0x6023e
jmp 0x68450
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
jmp 0x68554
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %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_hmap.c
// Function: bcore_hmap_tpfp_s_remove
fp_t bcore_hmap_tpfp_s_remove( bcore_hmap_tpfp_s* o, tp_t key )
{
    if( !key ) return 0;
    uz_t idx = tpfp_find( o, key );
    if( idx < o->size )
    {
        fp_t val = o->nodes[ idx ].val;
        o->nodes[ idx ].key = 0;
        o->nodes[ idx ].val = NULL;
        return val;
    }
    return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x68590
pushq %rbx
movq %rdi, %rbx
callq 0x68366
cmpq 0x18(%rbx), %rax
jae 0x68593
movq %rax, %rcx
movq 0x8(%rbx), %rdx
shlq $0x4, %rcx
movq 0x8(%rdx,%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rdx,%rcx)
jmp 0x68595
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tptp_s_copy
void bcore_hmap_tptp_s_copy( bcore_hmap_tptp_s* o, const bcore_hmap_tptp_s* src )
{
    o->nodes = bcore_alloc( o->nodes, 0 );
    o->flags = bcore_alloc( o->flags, 0 );
    o->size  = 0;
    o->nodes = bcore_u_memcpy( sizeof( bcore_hnode_tptp_s ), o->nodes, src->nodes, src->size );
    o->size  = src->size;
    o->depth_limit = src->depth_limit;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x10(%rbx)
andq $0x0, 0x18(%rbx)
movq 0x8(%rbx), %rsi
movq 0x8(%r14), %rdx
movq 0x18(%r14), %rcx
pushq $0x10
popq %rdi
callq 0x6033c
movq %rax, 0x8(%rbx)
movups 0x18(%r14), %xmm0
movups %xmm0, 0x18(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tptp_s_fget
tp_t* bcore_hmap_tptp_s_fget( bcore_hmap_tptp_s* o, tp_t key, tp_t init_val )
{
    if( !key ) ERR( "key is 0" );
    uz_t idx = tptp_find( o, key );
    if( idx < o->size )
    {
        return &o->nodes[ idx ].val;
    }
    else
    {
        return bcore_hmap_tptp_s_set( o, key, init_val );
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rsi, %rsi
jne 0x6893e
leaq 0x5ab5d(%rip), %rdi     # 0xc3481
leaq 0x5aa59(%rip), %rsi     # 0xc3384
leaq 0x5aad6(%rip), %rcx     # 0xc3408
movl $0x8bb, %edx            # imm = 0x8BB
xorl %eax, %eax
callq 0x60031
movq %r15, %rdi
movq %r14, %rsi
callq 0x688a6
cmpq 0x18(%r15), %rax
jae 0x68964
movq 0x8(%r15), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %r15
jmp 0x68977
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tptp_s_set
tp_t* bcore_hmap_tptp_s_set( bcore_hmap_tptp_s* o, tp_t key, tp_t val )
{
    if( !key ) ERR( "key is zero" );

    uz_t idx = tptp_find( o, key );
    if( idx < o->size )
    {
        o->nodes[ idx ].val = val;
        return &o->nodes[ idx ].val;
    }

    idx = tptp_set( o, ( bcore_hnode_tptp_s ){ .key = key, .val = val }, 1 );
    if( idx < o->size ) return &o->nodes[ idx ].val;

    // rehash
    {
        o->flags = bcore_u_alloc( sizeof( bl_t ), o->flags, 0, NULL );
        bcore_hnode_tptp_s* buf_nodes = o->nodes;
        uz_t  buf_size = o->size;
        o->depth_limit = ( o->size > 0 ) ? o->depth_limit + 1 : 4;
        o->size        = ( o->size > 0 ) ? o->size * 2        : 8;
        o->nodes = bcore_u_memzero( sizeof( bcore_hnode_tptp_s ), NULL, o->size );
        for( uz_t i = 0; i < buf_size; i++ )
        {
            if( buf_nodes[ i ].key ) bcore_hmap_tptp_s_set( o, buf_nodes[ i ].key, buf_nodes[ i ].val );
        }
        bcore_alloc( buf_nodes, 0 );
    }

    return bcore_hmap_tptp_s_set( o, key, val );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %r12
testq %r15, %r15
jne 0x689b6
leaq 0x5aafc(%rip), %rdi     # 0xc3498
leaq 0x5a9e1(%rip), %rsi     # 0xc3384
movl $0x8cb, %edx            # imm = 0x8CB
leaq 0x5aa11(%rip), %rcx     # 0xc33c0
xorl %eax, %eax
callq 0x60031
movq %r14, %rdi
movq %r15, %rsi
callq 0x688a6
cmpq 0x18(%r14), %rax
jb 0x68a6d
movq %r14, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq %r12, %rcx
callq 0x68714
cmpq 0x18(%r14), %rax
jb 0x68a85
movq 0x10(%r14), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6025e
movq %rax, 0x10(%r14)
movq 0x18(%r14), %r13
pushq $0x4
popq %rax
testq %r13, %r13
je 0x68a0e
movq 0x20(%r14), %rax
incq %rax
movq 0x8(%r14), %rbp
leaq (,%r13,2), %rdx
testq %r13, %r13
movq %rax, 0x20(%r14)
pushq $0x8
popq %rax
cmoveq %rax, %rdx
movq %rdx, 0x18(%r14)
pushq $0x10
popq %rdi
xorl %esi, %esi
callq 0x602ac
movq %rax, 0x8(%r14)
leaq 0x8(%rbp), %rbx
subq $0x1, %r13
jb 0x68a5e
movq -0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x68a58
movq (%rbx), %rdx
movq %r14, %rdi
callq 0x68977
addq $0x10, %rbx
jmp 0x68a3e
movq %rbp, %rdi
xorl %esi, %esi
callq 0x6023e
jmp 0x68990
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
jmp 0x68a94
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %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_hmap.c
// Function: bcore_hmap_tptp_s_remove
tp_t bcore_hmap_tptp_s_remove( bcore_hmap_tptp_s* o, tp_t key )
{
    if( !key ) return 0;
    uz_t idx = tptp_find( o, key );
    if( idx < o->size )
    {
        tp_t val = o->nodes[ idx ].val;
        o->nodes[ idx ].key = 0;
        o->nodes[ idx ].val = 0;
        return val;
    }
    return 0;
}

// Assembly:
testq %rsi, %rsi
je 0x68ad0
pushq %rbx
movq %rdi, %rbx
callq 0x688a6
cmpq 0x18(%rbx), %rax
jae 0x68ad3
movq %rax, %rcx
movq 0x8(%rbx), %rdx
shlq $0x4, %rcx
movq 0x8(%rdx,%rcx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rdx,%rcx)
jmp 0x68ad5
xorl %eax, %eax
retq
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: tpvd_set
uz_t tpvd_set( bcore_hmap_tpvd_s* o, bcore_hnode_tpvd_s node, uz_t depth ) // sets new node, returns valid index on success; o->size otherwise
{
    uz_t size = o->size;
    if( size == 0 ) return size;
    uz_t mask = o->size - 1;

    if( depth == o->depth_limit ) return size;

    uz_t idx1 = hash_tpu3_1( node.key ) & mask;
    if( !o->nodes[ idx1 ].key )
    {
        o->nodes[ idx1 ] = node;
        return idx1;
    }

    uz_t idx2 = hash_tpu3_2( node.key ) & mask;
    if( !o->nodes[ idx2 ].key )
    {
        o->nodes[ idx2 ] = node;
        return idx2;
    }

    if( !o->flags ) o->flags = bcore_u_memzero( sizeof( bl_t ), NULL, size );

    if( !o->flags[ idx1 ] )
    {
        o->flags[ idx1 ] = true;
        if( tpvd_set( o, o->nodes[ idx1 ], depth + 1 ) < size )
        {
            o->flags[ idx1 ] = false;
            o->nodes[ idx1 ] = node;
            return idx1;
        }
        o->flags[ idx1 ] = false;
    }

    if( !o->flags[ idx2 ] )
    {
        o->flags[ idx2 ] = true;
        if( tpvd_set( o, o->nodes[ idx2 ], depth + 1 ) < size )
        {
            o->flags[ idx2 ] = false;
            o->nodes[ idx2 ] = node;
            return idx2;
        }
        o->flags[ idx2 ] = false;
    }

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x18(%rdi), %r15
testq %r15, %r15
je 0x68d84
movq %rdi, %r12
cmpq %rcx, 0x20(%rdi)
je 0x68da8
movq %rcx, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
leaq -0x1(%r15), %r13
movq %rsi, %rdi
movq %rsi, %r14
callq 0x677c6
movq %rax, %rdx
andq %r13, %rdx
movq 0x8(%r12), %rbx
movq %rdx, %rbp
shlq $0x4, %rbp
cmpq $0x0, (%rbx,%rbp)
je 0x68d89
movq %rdx, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x67829
movq %rax, %r14
andq %r13, %r14
movq %r14, %r13
shlq $0x4, %r13
cmpq $0x0, (%rbx,%r13)
je 0x68d8e
movq 0x10(%r12), %rax
testq %rax, %rax
jne 0x68cf8
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x602ac
movq %rax, 0x10(%r12)
movq 0x10(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rbx
jne 0x68d3c
movb $0x1, (%rax,%rcx)
movq 0x8(%r12), %rax
leaq 0x1(%rbx), %rcx
movq (%rax,%rbp), %rsi
movq 0x8(%rax,%rbp), %rdx
movq %r12, %rdi
callq 0x68c54
movq 0x10(%rsp), %rdx
movq %rax, %rcx
movq 0x10(%r12), %rax
movb $0x0, (%rax,%rdx)
cmpq %r15, %rcx
jb 0x68d76
cmpb $0x0, (%rax,%r14)
jne 0x68da8
movb $0x1, (%rax,%r14)
movq 0x8(%r12), %rax
incq %rbx
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x68c54
movq 0x10(%r12), %rcx
movb $0x0, (%rcx,%r14)
movq %r14, %rdx
cmpq %r15, %rax
jae 0x68da8
movq %rdx, %rbx
shlq $0x4, %rbx
addq 0x8(%r12), %rbx
jmp 0x68d94
xorl %r15d, %r15d
jmp 0x68da8
addq %rbp, %rbx
jmp 0x68d99
addq %r13, %rbx
movq %r14, %rdx
movq 0x8(%rsp), %r14
movq %r14, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, %r15
movq %r15, %rax
addq $0x28, %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_hmap.c
// Function: bcore_hmap_tpvd_s_set
vd_t* bcore_hmap_tpvd_s_set( bcore_hmap_tpvd_s* o, tp_t key, vd_t val )
{
    if( !key ) ERR( "key is zero" );

    uz_t idx = tpvd_find( o, key );
    if( idx < o->size )
    {
        o->nodes[ idx ].val = val;
        return &o->nodes[ idx ].val;
    }

    idx = tpvd_set( o, ( bcore_hnode_tpvd_s ){ .key = key, .val = val }, 1 );
    if( idx < o->size ) return &o->nodes[ idx ].val;

    // rehash
    {
        o->flags = bcore_u_alloc( sizeof( bl_t ), o->flags, 0, NULL );
        bcore_hnode_tpvd_s* buf_nodes = o->nodes;
        uz_t  buf_size = o->size;
        o->depth_limit = ( o->size > 0 ) ? o->depth_limit + 1 : 4;
        o->size        = ( o->size > 0 ) ? o->size * 2        : 8;
        o->nodes = bcore_u_memzero( sizeof( bcore_hnode_tpvd_s ), NULL, o->size );
        for( uz_t i = 0; i < buf_size; i++ )
        {
            if( buf_nodes[ i ].key ) bcore_hmap_tpvd_s_set( o, buf_nodes[ i ].key, buf_nodes[ i ].val );
        }
        bcore_alloc( buf_nodes, 0 ); // rehashing does not destroy any object (only rearranges nodes)
    }

    return bcore_hmap_tpvd_s_set( o, key, val );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %r12
testq %r15, %r15
jne 0x68df9
leaq 0x5a6cf(%rip), %rdi     # 0xc34ae
leaq 0x5a59e(%rip), %rsi     # 0xc3384
movl $0xa5d, %edx            # imm = 0xA5D
leaq 0x5a5ce(%rip), %rcx     # 0xc33c0
xorl %eax, %eax
callq 0x60031
movq %r14, %rdi
movq %r15, %rsi
callq 0x68ee6
cmpq 0x18(%r14), %rax
jb 0x68eb0
movq %r14, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq %r12, %rcx
callq 0x68c54
cmpq 0x18(%r14), %rax
jb 0x68ec8
movq 0x10(%r14), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6025e
movq %rax, 0x10(%r14)
movq 0x18(%r14), %r13
pushq $0x4
popq %rax
testq %r13, %r13
je 0x68e51
movq 0x20(%r14), %rax
incq %rax
movq 0x8(%r14), %rbp
leaq (,%r13,2), %rdx
testq %r13, %r13
movq %rax, 0x20(%r14)
pushq $0x8
popq %rax
cmoveq %rax, %rdx
movq %rdx, 0x18(%r14)
pushq $0x10
popq %rdi
xorl %esi, %esi
callq 0x602ac
movq %rax, 0x8(%r14)
leaq 0x8(%rbp), %rbx
subq $0x1, %r13
jb 0x68ea1
movq -0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x68e9b
movq (%rbx), %rdx
movq %r14, %rdi
callq 0x68dba
addq $0x10, %rbx
jmp 0x68e81
movq %rbp, %rdi
xorl %esi, %esi
callq 0x6023e
jmp 0x68dd3
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
jmp 0x68ed7
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %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_hmap.c
// Function: bcore_hmap_tpvd_s_remove
void bcore_hmap_tpvd_s_remove( bcore_hmap_tpvd_s* o, tp_t key )
{
    if( !key ) return;
    uz_t idx = tpvd_find( o, key );
    if( idx < o->size )
    {
        o->nodes[ idx ].key = 0;
        o->nodes[ idx ].val = 0;
    }
}

// Assembly:
pushq %rbx
testq %rsi, %rsi
je 0x68f99
movq %rdi, %rbx
callq 0x68ee6
cmpq 0x18(%rbx), %rax
jae 0x68f99
movq 0x8(%rbx), %rcx
shlq $0x4, %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rcx,%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tpto_s_down
void bcore_hmap_tpto_s_down( bcore_hmap_tpto_s* o )
{
    if( o->size > 0 )
    {
        const bcore_inst_s* inst_p = NULL;
        for( uz_t i = 0; i < o->size; i++ )
        {
            if( o->nodes[ i ].val )
            {
                if( !inst_p ) inst_p = bcore_inst_s_get_typed( o->type );
                bcore_inst_p_discard( inst_p, o->nodes[ i ].val );
            }
        }
    }
    o->nodes = bcore_alloc( o->nodes, 0 );
    o->flags = bcore_alloc( o->flags, 0 );
    o->size  = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x20(%rdi), %rax
testq %rax, %rax
je 0x693ef
pushq $0x8
popq %r15
xorl %r14d, %r14d
xorl %r12d, %r12d
cmpq %rax, %r12
jae 0x693ef
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rsi
testq %rsi, %rsi
je 0x693e2
testq %r14, %r14
jne 0x693d8
movq 0x8(%rbx), %rdi
callq 0x6941e
movq %rax, %r14
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rsi
testq %rsi, %rsi
je 0x693e2
movq %r14, %rdi
callq *0xb8(%r14)
incq %r12
movq 0x20(%rbx), %rax
addq $0x10, %r15
jmp 0x693a8
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
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_hmap.c
// Function: bcore_hmap_tpto_s_copy
void bcore_hmap_tpto_s_copy( bcore_hmap_tpto_s* o, const bcore_hmap_tpto_s* src )
{
    const bcore_inst_s* inst_p = o->type ? bcore_inst_s_get_typed( o->type ) : NULL;
    for( uz_t i = 0; i < o->size; i++ )
    {
        if( o->nodes[ i ].val ) bcore_inst_p_discard( inst_p, o->nodes[ i ].val );
    }
    o->nodes = bcore_alloc( o->nodes, 0 );
    o->flags = bcore_alloc( o->flags, 0 );
    o->size  = 0;

    o->nodes = bcore_u_memzero( sizeof( bcore_hnode_tpto_s ), o->nodes, src->size );
    inst_p = src->type ? bcore_inst_s_get_typed( src->type ) : NULL;
    for( uz_t i = 0; i < src->size; i++ )
    {
        const bcore_hnode_tpto_s* src_node = &src->nodes[ i ];
              bcore_hnode_tpto_s* dst_node =   &o->nodes[ i ];

        dst_node->key = src_node->key;
        if( src_node->val )
        {
            dst_node->val = bcore_inst_p_clone( inst_p, src_node->val );
        }
    }

    o->type = src->type;
    o->size = src->size;
    o->depth_limit = src->depth_limit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x69492
callq 0x6941e
movq %rax, %r15
jmp 0x69495
xorl %r15d, %r15d
pushq $0x8
popq %r12
xorl %r13d, %r13d
movq 0x10(%rbx), %rdi
cmpq 0x20(%rbx), %r13
jae 0x694c2
movq (%rdi,%r12), %rsi
testq %rsi, %rsi
je 0x694b9
movq %r15, %rdi
callq *0xb8(%r15)
incq %r13
addq $0x10, %r12
jmp 0x6949c
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
movq 0x10(%rbx), %rsi
movq 0x20(%r14), %rdx
pushq $0x10
popq %rdi
callq 0x602ac
movq %rax, 0x10(%rbx)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x69509
callq 0x6941e
movq %rax, %r15
pushq $0x8
popq %r12
xorl %r13d, %r13d
movq 0x20(%r14), %rax
cmpq %rax, %r13
jae 0x6954c
movq 0x10(%r14), %rax
movq 0x10(%rbx), %rbp
movq -0x8(%rax,%r12), %rcx
movq %rcx, -0x8(%rbp,%r12)
movq (%rax,%r12), %rsi
testq %rsi, %rsi
je 0x69543
movq %r15, %rdi
callq *0xc0(%r15)
movq %rax, (%rbp,%r12)
incq %r13
addq $0x10, %r12
jmp 0x69510
movq 0x8(%r14), %rcx
movq %rcx, 0x8(%rbx)
movq %rax, 0x20(%rbx)
movq 0x28(%r14), %rax
movq %rax, 0x28(%rbx)
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_hmap.c
// Function: tpto_set
uz_t tpto_set( bcore_hmap_tpto_s* o, bcore_hnode_tpto_s node, uz_t depth ) // sets new node, returns valid index on success; o->size otherwise
{
    uz_t size = o->size;
    if( size == 0 ) return size;
    uz_t mask = o->size - 1;

    if( depth == o->depth_limit ) return size;

    uz_t idx1 = hash_tpu3_1( node.key ) & mask;
    if( !o->nodes[ idx1 ].key )
    {
        o->nodes[ idx1 ] = node;
        return idx1;
    }

    uz_t idx2 = hash_tpu3_2( node.key ) & mask;
    if( !o->nodes[ idx2 ].key )
    {
        o->nodes[ idx2 ] = node;
        return idx2;
    }

    if( !o->flags ) o->flags = bcore_u_memzero( sizeof( bl_t ), NULL, size );

    if( !o->flags[ idx1 ] )
    {
        o->flags[ idx1 ] = true;
        if( tpto_set( o, o->nodes[ idx1 ], depth + 1 ) < size )
        {
            o->flags[ idx1 ] = false;
            o->nodes[ idx1 ] = node;
            return idx1;
        }
        o->flags[ idx1 ] = false;
    }

    if( !o->flags[ idx2 ] )
    {
        o->flags[ idx2 ] = true;
        if( tpto_set( o, o->nodes[ idx2 ], depth + 1 ) < size )
        {
            o->flags[ idx2 ] = false;
            o->nodes[ idx2 ] = node;
            return idx2;
        }
        o->flags[ idx2 ] = false;
    }

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x20(%rdi), %r15
testq %r15, %r15
je 0x696fd
movq %rdi, %r12
cmpq %rcx, 0x28(%rdi)
je 0x69721
movq %rcx, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
leaq -0x1(%r15), %r13
movq %rsi, %rdi
movq %rsi, %r14
callq 0x677c6
movq %rax, %rdx
andq %r13, %rdx
movq 0x10(%r12), %rbx
movq %rdx, %rbp
shlq $0x4, %rbp
cmpq $0x0, (%rbx,%rbp)
je 0x69702
movq %rdx, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x67829
movq %rax, %r14
andq %r13, %r14
movq %r14, %r13
shlq $0x4, %r13
cmpq $0x0, (%rbx,%r13)
je 0x69707
movq 0x18(%r12), %rax
testq %rax, %rax
jne 0x69671
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x602ac
movq %rax, 0x18(%r12)
movq 0x10(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rbx
jne 0x696b5
movb $0x1, (%rax,%rcx)
movq 0x10(%r12), %rax
leaq 0x1(%rbx), %rcx
movq (%rax,%rbp), %rsi
movq 0x8(%rax,%rbp), %rdx
movq %r12, %rdi
callq 0x695cd
movq 0x10(%rsp), %rdx
movq %rax, %rcx
movq 0x18(%r12), %rax
movb $0x0, (%rax,%rdx)
cmpq %r15, %rcx
jb 0x696ef
cmpb $0x0, (%rax,%r14)
jne 0x69721
movb $0x1, (%rax,%r14)
movq 0x10(%r12), %rax
incq %rbx
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x695cd
movq 0x18(%r12), %rcx
movb $0x0, (%rcx,%r14)
movq %r14, %rdx
cmpq %r15, %rax
jae 0x69721
movq %rdx, %rbx
shlq $0x4, %rbx
addq 0x10(%r12), %rbx
jmp 0x6970d
xorl %r15d, %r15d
jmp 0x69721
addq %rbp, %rbx
jmp 0x69712
addq %r13, %rbx
movq %r14, %rdx
movq 0x8(%rsp), %r14
movq %r14, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, %r15
movq %r15, %rax
addq $0x28, %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_hmap.c
// Function: bcore_hmap_tpto_s_clear
void bcore_hmap_tpto_s_clear( bcore_hmap_tpto_s* o )
{
    const bcore_inst_s* inst_p = o->type ? bcore_inst_s_get_typed( o->type ) : NULL;
    for( uz_t i = 0; i < o->size; i++ ) if( o->nodes[ i ].val ) bcore_inst_p_discard( inst_p, o->nodes[ i ].val );
    o->nodes = bcore_alloc( o->nodes, 0 );
    o->flags = bcore_alloc( o->flags, 0 );
    o->size  = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x69772
callq 0x6941e
movq %rax, %r14
jmp 0x69775
xorl %r14d, %r14d
pushq $0x8
popq %r15
xorl %r12d, %r12d
movq 0x10(%rbx), %rdi
cmpq 0x20(%rbx), %r12
jae 0x697a2
movq (%rdi,%r15), %rsi
testq %rsi, %rsi
je 0x69799
movq %r14, %rdi
callq *0xb8(%r14)
incq %r12
addq $0x10, %r15
jmp 0x6977c
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
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_hmap.c
// Function: bcore_hmap_tpto_s_fget_d
vd_t* bcore_hmap_tpto_s_fget_d( bcore_hmap_tpto_s* o, tp_t key, vd_t init_val )
{
    if( !key ) ERR( "key is 0" );
    if( !o->type ) ERR( "type is 0" );
    uz_t idx = tpto_find( o, key );
    if( idx < o->size )
    {
        if( init_val ) bcore_inst_t_discard( o->type, init_val );
        return &o->nodes[ idx ].val;
    }
    else
    {
        return bcore_hmap_tpto_s_set_d( o, key, init_val );
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rsi, %rsi
jne 0x69894
leaq 0x59c4a(%rip), %rdi     # 0xc34c4
leaq 0x59b03(%rip), %rsi     # 0xc3384
leaq 0x59b80(%rip), %rcx     # 0xc3408
movl $0xc3e, %edx            # imm = 0xC3E
xorl %eax, %eax
callq 0x60031
cmpq $0x0, 0x8(%rbx)
jne 0x698bc
leaq 0x59c22(%rip), %rdi     # 0xc34c4
leaq 0x59adb(%rip), %rsi     # 0xc3384
leaq 0x59c2d(%rip), %rcx     # 0xc34dd
movl $0xc3f, %edx            # imm = 0xC3F
xorl %eax, %eax
callq 0x60031
movq %rbx, %rdi
movq %r15, %rsi
callq 0x697f9
cmpq 0x20(%rbx), %rax
jae 0x698fc
movq %rax, %r12
testq %r14, %r14
je 0x698e1
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x69915
movq 0x10(%rbx), %rax
shlq $0x4, %r12
addq %r12, %rax
addq $0x8, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x6992e
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tpto_s_remove
void bcore_hmap_tpto_s_remove( bcore_hmap_tpto_s* o, tp_t key )
{
    if( !key ) return;
    uz_t idx = tpto_find( o, key );
    if( idx < o->size )
    {
        if( o->nodes[ idx ].val ) bcore_inst_t_discard( o->type, o->nodes[ idx ].val );
        o->nodes[ idx ].key = 0;
        o->nodes[ idx ].val = 0;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x69b17
movq %rdi, %rbx
callq 0x697f9
cmpq 0x20(%rbx), %rax
jae 0x69b17
movq %rax, %r14
movq 0x10(%rbx), %rax
shlq $0x4, %r14
movq 0x8(%rax,%r14), %rsi
testq %rsi, %rsi
je 0x69b0f
movq 0x8(%rbx), %rdi
callq 0x69915
movq 0x10(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tpaw_s_down
void bcore_hmap_tpaw_s_down( bcore_hmap_tpaw_s* o )
{
    if( o->size > 0 )
    {
        const bcore_inst_s* inst_p = NULL;
        for( uz_t i = 0; i < o->size; i++ )
        {
            if( o->nodes[ i ].val )
            {
                vd_t val = o->nodes[ i ].val;
                tp_t type = *(aware_t*)val;
                if( !inst_p || inst_p->header.o_type != type ) inst_p = bcore_inst_s_get_typed( type );
                bcore_inst_p_discard( inst_p, val );
            }
        }
    }
    o->nodes = bcore_alloc( o->nodes, 0 );
    o->flags = bcore_alloc( o->flags, 0 );
    o->size  = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x18(%rdi), %rax
testq %rax, %rax
je 0x69bf7
pushq $0x8
popq %r12
xorl %r13d, %r13d
xorl %r14d, %r14d
cmpq %rax, %r13
jae 0x69bf7
movq 0x8(%rbx), %rcx
movq (%rcx,%r12), %r15
testq %r15, %r15
je 0x69bee
movq (%r15), %rdi
testq %r14, %r14
je 0x69bd5
cmpq %rdi, 0x8(%r14)
je 0x69bdd
callq 0x6941e
movq %rax, %r14
movq %r14, %rdi
movq %r15, %rsi
callq *0xb8(%r14)
movq 0x18(%rbx), %rax
incq %r13
addq $0x10, %r12
jmp 0x69bb5
movq 0x8(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x10(%rbx)
andq $0x0, 0x18(%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tpaw_s_copy
void bcore_hmap_tpaw_s_copy( bcore_hmap_tpaw_s* o, const bcore_hmap_tpaw_s* src )
{
    const bcore_inst_s* inst_p = NULL;
    for( uz_t i = 0; i < o->size; i++ )
    {
        if( o->nodes[ i ].val )
        {
            vd_t val = o->nodes[ i ].val;
            tp_t type = *(aware_t*)val;
            if( !inst_p || inst_p->header.o_type != type ) inst_p = bcore_inst_s_get_typed( type );
            bcore_inst_p_discard( inst_p, val );
        }
    }
    o->nodes = bcore_alloc( o->nodes, 0 );
    o->flags = bcore_alloc( o->flags, 0 );
    o->size  = 0;

    o->nodes = bcore_u_memzero( sizeof( bcore_hnode_tpaw_s ), o->nodes, src->size );
    for( uz_t i = 0; i < src->size; i++ )
    {
        const bcore_hnode_tpaw_s* src_node = &src->nodes[ i ];
              bcore_hnode_tpaw_s* dst_node =   &o->nodes[ i ];

        dst_node->key = src_node->key;
        if( src_node->val )
        {
            vd_t val = src_node->val;
            tp_t type = *(aware_t*)val;
            if( !inst_p || inst_p->header.o_type != type ) inst_p = bcore_inst_s_get_typed( type );
            dst_node->val = bcore_inst_p_clone( inst_p, src_node->val );
        }
    }

    o->size = src->size;
    o->depth_limit = src->depth_limit;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %rbx
pushq $0x8
popq %r13
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x8(%rbx), %rdi
cmpq 0x18(%rbx), %rbp
jae 0x69c7f
movq (%rdi,%r13), %r12
testq %r12, %r12
je 0x69c76
movq (%r12), %rdi
testq %r15, %r15
je 0x69c61
cmpq %rdi, 0x8(%r15)
je 0x69c69
callq 0x6941e
movq %rax, %r15
movq %r15, %rdi
movq %r12, %rsi
callq *0xb8(%r15)
incq %rbp
addq $0x10, %r13
jmp 0x69c3f
xorl %r12d, %r12d
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
xorl %esi, %esi
callq 0x6023e
movq %rax, 0x10(%rbx)
andq $0x0, 0x18(%rbx)
movq 0x8(%rbx), %rsi
movq (%rsp), %r14
movq 0x18(%r14), %rdx
pushq $0x10
popq %rdi
callq 0x602ac
movq %r14, %rcx
movq %rax, 0x8(%rbx)
pushq $0x8
popq %r13
movq 0x18(%rcx), %rax
cmpq %rax, %r12
jae 0x69d23
movq 0x8(%rcx), %r14
movq 0x8(%rbx), %rbp
movq -0x8(%r14,%r13), %rax
movq %rax, -0x8(%rbp,%r13)
movq (%r14,%r13), %rsi
testq %rsi, %rsi
je 0x69d1a
movq (%rsi), %rdi
testq %r15, %r15
je 0x69cf2
cmpq %rdi, 0x8(%r15)
je 0x69d03
callq 0x6941e
movq %rax, %r15
movq (%r14,%r13), %rsi
testq %rsi, %rsi
je 0x69d0f
movq %r15, %rdi
callq *0xc0(%r15)
jmp 0x69d11
xorl %eax, %eax
movq %rax, (%rbp,%r13)
movq (%rsp), %rcx
incq %r12
addq $0x10, %r13
jmp 0x69cc0
movq %rax, 0x18(%rbx)
movq 0x20(%rcx), %rax
movq %rax, 0x20(%rbx)
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_hmap.c
// Function: tpaw_set
uz_t tpaw_set( bcore_hmap_tpaw_s* o, bcore_hnode_tpaw_s node, uz_t depth ) // sets new node, returns valid index on success; o->size otherwise
{
    uz_t size = o->size;
    if( size == 0 ) return size;
    uz_t mask = o->size - 1;

    if( depth == o->depth_limit ) return size;

    uz_t idx1 = hash_tpu3_1( node.key ) & mask;
    if( !o->nodes[ idx1 ].key )
    {
        o->nodes[ idx1 ] = node;
        return idx1;
    }

    uz_t idx2 = hash_tpu3_2( node.key ) & mask;
    if( !o->nodes[ idx2 ].key )
    {
        o->nodes[ idx2 ] = node;
        return idx2;
    }

    if( !o->flags ) o->flags = bcore_u_memzero( sizeof( bl_t ), NULL, size );

    if( !o->flags[ idx1 ] )
    {
        o->flags[ idx1 ] = true;
        if( tpaw_set( o, o->nodes[ idx1 ], depth + 1 ) < size )
        {
            o->flags[ idx1 ] = false;
            o->nodes[ idx1 ] = node;
            return idx1;
        }
        o->flags[ idx1 ] = false;
    }

    if( !o->flags[ idx2 ] )
    {
        o->flags[ idx2 ] = true;
        if( tpaw_set( o, o->nodes[ idx2 ], depth + 1 ) < size )
        {
            o->flags[ idx2 ] = false;
            o->nodes[ idx2 ] = node;
            return idx2;
        }
        o->flags[ idx2 ] = false;
    }

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x18(%rdi), %r15
testq %r15, %r15
je 0x69ecc
movq %rdi, %r12
cmpq %rcx, 0x20(%rdi)
je 0x69ef0
movq %rcx, 0x18(%rsp)
movq %rdx, 0x20(%rsp)
leaq -0x1(%r15), %r13
movq %rsi, %rdi
movq %rsi, %r14
callq 0x677c6
movq %rax, %rdx
andq %r13, %rdx
movq 0x8(%r12), %rbx
movq %rdx, %rbp
shlq $0x4, %rbp
cmpq $0x0, (%rbx,%rbp)
je 0x69ed1
movq %rdx, 0x10(%rsp)
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x67829
movq %rax, %r14
andq %r13, %r14
movq %r14, %r13
shlq $0x4, %r13
cmpq $0x0, (%rbx,%r13)
je 0x69ed6
movq 0x10(%r12), %rax
testq %rax, %rax
jne 0x69e40
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x602ac
movq %rax, 0x10(%r12)
movq 0x10(%rsp), %rcx
cmpb $0x0, (%rax,%rcx)
movq 0x18(%rsp), %rbx
jne 0x69e84
movb $0x1, (%rax,%rcx)
movq 0x8(%r12), %rax
leaq 0x1(%rbx), %rcx
movq (%rax,%rbp), %rsi
movq 0x8(%rax,%rbp), %rdx
movq %r12, %rdi
callq 0x69d9c
movq 0x10(%rsp), %rdx
movq %rax, %rcx
movq 0x10(%r12), %rax
movb $0x0, (%rax,%rdx)
cmpq %r15, %rcx
jb 0x69ebe
cmpb $0x0, (%rax,%r14)
jne 0x69ef0
movb $0x1, (%rax,%r14)
movq 0x8(%r12), %rax
incq %rbx
movq (%rax,%r13), %rsi
movq 0x8(%rax,%r13), %rdx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x69d9c
movq 0x10(%r12), %rcx
movb $0x0, (%rcx,%r14)
movq %r14, %rdx
cmpq %r15, %rax
jae 0x69ef0
movq %rdx, %rbx
shlq $0x4, %rbx
addq 0x8(%r12), %rbx
jmp 0x69edc
xorl %r15d, %r15d
jmp 0x69ef0
addq %rbp, %rbx
jmp 0x69ee1
addq %r13, %rbx
movq %r14, %rdx
movq 0x8(%rsp), %r14
movq %r14, (%rbx)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rbx)
movq %rdx, %r15
movq %r15, %rax
addq $0x28, %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_hmap.c
// Function: bcore_hmap_tpaw_s_set_d
vd_t* bcore_hmap_tpaw_s_set_d( bcore_hmap_tpaw_s* o, tp_t key, vd_t val )
{
    if( !key ) ERR( "key is zero" );

    uz_t idx = tpaw_find( o, key );
    if( idx < o->size )
    {
        if( o->nodes[ idx ].val ) bcore_inst_a_discard( o->nodes[ idx ].val );
        o->nodes[ idx ].val = val;
        return &o->nodes[ idx ].val;
    }

    idx = tpaw_set( o, ( bcore_hnode_tpaw_s ){ .key = key, .val = val }, 1 );
    if( idx < o->size ) return &o->nodes[ idx ].val;

    // rehash
    {
        o->flags = bcore_u_alloc( sizeof( bl_t ), o->flags, 0, NULL );
        bcore_hnode_tpaw_s* buf_nodes = o->nodes;
        uz_t  buf_size = o->size;
        o->depth_limit = ( o->size > 0 ) ? o->depth_limit + 1 : 4;
        o->size        = ( o->size > 0 ) ? o->size * 2        : 8;
        o->nodes = bcore_u_memzero( sizeof( bcore_hnode_tpaw_s ), NULL, o->size );
        for( uz_t i = 0; i < buf_size; i++ )
        {
            if( buf_nodes[ i ].key ) bcore_hmap_tpaw_s_set_d( o, buf_nodes[ i ].key, buf_nodes[ i ].val );
        }
        bcore_alloc( buf_nodes, 0 ); // rehashing does not destroy any object (only rearranges nodes)
    }

    return bcore_hmap_tpaw_s_set_d( o, key, val );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, (%rsp)
movq %rsi, %r15
movq %rdi, %r14
pushq $0x1
popq %r12
testq %r15, %r15
jne 0x69fd1
leaq 0x5955c(%rip), %rdi     # 0xc3513
leaq 0x593c6(%rip), %rsi     # 0xc3384
movl $0xe42, %edx            # imm = 0xE42
leaq 0x593f6(%rip), %rcx     # 0xc33c0
xorl %eax, %eax
callq 0x60031
movq %r14, %rdi
movq %r15, %rsi
callq 0x69f2e
cmpq 0x18(%r14), %rax
jb 0x6a088
movq %r14, %rdi
movq %r15, %rsi
movq (%rsp), %rdx
movq %r12, %rcx
callq 0x69d9c
cmpq 0x18(%r14), %rax
jb 0x6a0b6
movq 0x10(%r14), %rsi
movq %r12, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6025e
movq %rax, 0x10(%r14)
movq 0x18(%r14), %r13
pushq $0x4
popq %rax
testq %r13, %r13
je 0x6a029
movq 0x20(%r14), %rax
incq %rax
movq 0x8(%r14), %rbp
leaq (,%r13,2), %rdx
testq %r13, %r13
movq %rax, 0x20(%r14)
pushq $0x8
popq %rax
cmoveq %rax, %rdx
movq %rdx, 0x18(%r14)
pushq $0x10
popq %rdi
xorl %esi, %esi
callq 0x602ac
movq %rax, 0x8(%r14)
leaq 0x8(%rbp), %rbx
subq $0x1, %r13
jb 0x6a079
movq -0x8(%rbx), %rsi
testq %rsi, %rsi
je 0x6a073
movq (%rbx), %rdx
movq %r14, %rdi
callq 0x69f92
addq $0x10, %rbx
jmp 0x6a059
movq %rbp, %rdi
xorl %esi, %esi
callq 0x6023e
jmp 0x69fab
movq %rax, %rbp
movq 0x8(%r14), %rax
shlq $0x4, %rbp
movq 0x8(%rax,%rbp), %rdi
testq %rdi, %rdi
je 0x6a0a6
callq 0x671cf
movq 0x8(%r14), %rax
addq %rbp, %rax
addq $0x8, %rax
movq (%rsp), %rcx
movq %rcx, (%rax)
jmp 0x6a0c5
movq 0x8(%r14), %rcx
shlq $0x4, %rax
addq %rcx, %rax
addq $0x8, %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_hmap.c
// Function: bcore_hmap_tpaw_s_remove
void bcore_hmap_tpaw_s_remove( bcore_hmap_tpaw_s* o, tp_t key )
{
    if( !key ) return;
    uz_t idx = tpaw_find( o, key );
    if( idx < o->size )
    {
        if( o->nodes[ idx ].val ) bcore_inst_a_discard( o->nodes[ idx ].val );
        o->nodes[ idx ].key = 0;
        o->nodes[ idx ].val = 0;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x6a165
movq %rdi, %rbx
callq 0x69f2e
cmpq 0x18(%rbx), %rax
jae 0x6a165
movq %rax, %r14
movq 0x8(%rbx), %rax
shlq $0x4, %r14
movq 0x8(%rax,%r14), %rdi
testq %rdi, %rdi
je 0x6a15d
callq 0x671cf
movq 0x8(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tp_s_fget
uz_t bcore_hmap_tp_s_fget( bcore_hmap_tp_s* o, tp_t key )
{
    if( !key ) ERR( "key is 0" );
    uz_t idx = tp_find( o, key );
    if( idx < o->size )
    {
        return idx;
    }
    else
    {
        return bcore_hmap_tp_s_set( o, key );
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
jne 0x6a3e6
leaq 0x5915f(%rip), %rdi     # 0xc352b
leaq 0x58fb1(%rip), %rsi     # 0xc3384
leaq 0x5902e(%rip), %rcx     # 0xc3408
movl $0xf77, %edx            # imm = 0xF77
xorl %eax, %eax
callq 0x60031
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6a360
cmpq 0x18(%r14), %rax
jae 0x6a3ff
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x6a411
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_tp_s_set
uz_t bcore_hmap_tp_s_set( bcore_hmap_tp_s* o, tp_t key )
{
    if( !key ) ERR( "key is zero" );

    {
        uz_t idx = tp_find( o, key );
        if( idx < o->size ) return idx;
        idx = tp_set( o, key, 1 );
        if( idx < o->size ) return idx;
    }

    // rehash
    {
        tp_t* buf_keys  = o->keys;
        uz_t  buf_size  = o->size;
        o->flags = bcore_u_alloc( sizeof( bl_t ), o->flags, 0, NULL );
        o->depth_limit = ( o->size > 0 ) ? o->depth_limit + 1 : 4;
        o->size        = ( o->size > 0 ) ? o->size * 2        : 8;
        o->keys = bcore_u_memzero( sizeof( tp_t ), NULL, o->size );
        for( uz_t i = 0; i < buf_size; i++ )
        {
            if( buf_keys[ i ] ) bcore_hmap_tp_s_set( o, buf_keys[ i ] );
        }
        bcore_u_alloc( sizeof( tp_t ), buf_keys, 0, NULL );
    }

    return bcore_hmap_tp_s_set( o, key );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rbp
testq %rbx, %rbx
jne 0x6a44b
leaq 0x5910f(%rip), %rdi     # 0xc3540
leaq 0x58f4c(%rip), %rsi     # 0xc3384
movl $0xf87, %edx            # imm = 0xF87
leaq 0x58f7c(%rip), %rcx     # 0xc33c0
xorl %eax, %eax
callq 0x60031
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6a360
cmpq 0x18(%r14), %rax
jb 0x6a4fe
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0x6a50d
movq 0x18(%r14), %r13
cmpq %r13, %rax
jb 0x6a4fe
movq 0x8(%r14), %r12
movq 0x10(%r14), %rsi
movq %rbp, %r15
movq %rbp, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6025e
movq %rax, 0x10(%r14)
movq 0x18(%r14), %rax
pushq $0x4
popq %rcx
testq %rax, %rax
je 0x6a4a9
movq 0x20(%r14), %rcx
incq %rcx
leaq (%rax,%rax), %rdx
testq %rax, %rax
movq %rcx, 0x20(%r14)
pushq $0x8
popq %rdi
cmoveq %rdi, %rdx
movq %rdx, 0x18(%r14)
xorl %esi, %esi
callq 0x602ac
movq %rax, 0x8(%r14)
xorl %ebp, %ebp
cmpq %rbp, %r13
je 0x6a4e7
movq (%r12,%rbp,8), %rsi
testq %rsi, %rsi
je 0x6a4e2
movq %r14, %rdi
callq 0x6a411
incq %rbp
jmp 0x6a4cc
pushq $0x8
popq %rdi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x6025e
movq %r15, %rbp
jmp 0x6a425
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_hmap.c
// Function: tp_set
static uz_t tp_set( bcore_hmap_tp_s* o, tp_t key, uz_t depth ) // sets new node, returns valid index on success; o->size otherwise
{
    uz_t size = o->size;
    if( size == 0 ) return size;
    uz_t mask = o->size - 1;

    if( depth == o->depth_limit ) return size;

    uz_t idx1 = hash_tpu3_1( key ) & mask;
    if( !o->keys[ idx1 ] )
    {
        o->keys[ idx1 ] = key;
        return idx1;
    }

    uz_t idx2 = hash_tpu3_2( key ) & mask;
    if( !o->keys[ idx2 ] )
    {
        o->keys[ idx2 ] = key;
        return idx2;
    }

    if( !o->flags ) o->flags = bcore_u_memzero( sizeof( bl_t ), NULL, size );

    if( !o->flags[ idx1 ] )
    {
        o->flags[ idx1 ] = true;
        if( tp_set( o, o->keys[ idx1 ], depth + 1 ) < size )
        {
            o->flags[ idx1 ] = false;
            o->keys[  idx1 ] = key;
            return idx1;
        }
        o->flags[ idx1 ] = false;
    }

    if( !o->flags[ idx2 ] )
    {
        o->flags[ idx2 ] = true;
        if( tp_set( o, o->keys[ idx2 ], depth + 1 ) < size )
        {
            o->flags[ idx2 ] = false;
            o->keys[  idx2 ] = key;
            return idx2;
        }
        o->flags[ idx2 ] = false;
    }

    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0x18(%rdi), %r14
testq %r14, %r14
je 0x6a60f
movq %rdi, %r15
cmpq %rdx, 0x20(%rdi)
je 0x6a63a
movq %rdx, 0x8(%rsp)
leaq -0x1(%r14), %rbx
movq %rsi, %rdi
movq %rsi, %r12
callq 0x677c6
movq %rax, %r13
andq %rbx, %r13
movq 0x8(%r15), %rbp
cmpq $0x0, (%rbp,%r13,8)
movq %r12, 0x10(%rsp)
je 0x6a614
movq %r12, %rdi
callq 0x67829
movq %rax, %r12
andq %rbx, %r12
cmpq $0x0, (%rbp,%r12,8)
je 0x6a621
movq 0x10(%r15), %rax
testq %rax, %rax
jne 0x6a598
pushq $0x1
popq %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x602ac
movq %rax, 0x10(%r15)
cmpb $0x0, (%rax,%r13)
movq 0x8(%rsp), %rbx
jne 0x6a5ce
movb $0x1, (%rax,%r13)
movq 0x8(%r15), %rax
movq (%rax,%r13,8), %rsi
leaq 0x1(%rbx), %rdx
movq %r15, %rdi
callq 0x6a50d
movq %rax, %rcx
movq 0x10(%r15), %rax
movb $0x0, (%rax,%r13)
cmpq %r14, %rcx
jb 0x6a601
cmpb $0x0, (%rax,%r12)
jne 0x6a63a
movb $0x1, (%rax,%r12)
movq 0x8(%r15), %rax
movq (%rax,%r12,8), %rsi
incq %rbx
movq %r15, %rdi
movq %rbx, %rdx
callq 0x6a50d
movq 0x10(%r15), %rcx
movb $0x0, (%rcx,%r12)
movq %r12, %r13
cmpq %r14, %rax
jae 0x6a63a
leaq (,%r13,8), %rax
addq 0x8(%r15), %rax
jmp 0x6a62f
xorl %r14d, %r14d
jmp 0x6a63a
leaq (,%r13,8), %rax
addq %rbp, %rax
jmp 0x6a62f
leaq (,%r12,8), %rax
addq %rbp, %rax
movq %r12, %r13
movq 0x10(%rsp), %rcx
movq %rcx, (%rax)
movq %r13, %r14
movq %r14, %rax
addq $0x18, %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_hmap.c
// Function: bcore_hmap_tp_s_remove
uz_t bcore_hmap_tp_s_remove( bcore_hmap_tp_s* o, tp_t key )
{
    if( !key ) return o->size;

    uz_t idx = tp_find( o, key );
    if( idx < o->size )
    {
        o->keys[ idx ] = 0;
    }
    return idx;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rsi, %rsi
je 0x6a66e
movq %rbx, %rdi
callq 0x6a360
cmpq 0x18(%rbx), %rax
jae 0x6a672
movq 0x8(%rbx), %rcx
andq $0x0, (%rcx,%rax,8)
jmp 0x6a672
movq 0x18(%rbx), %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: hmap_u3vd_s_create_self
static bcore_self_s* hmap_u3vd_s_create_self( void )
{
    sc_t def = "\
        bcore_hmap_u3vd_s = bcore_inst \
            { \
                aware_t _; \
                private bcore_array_dyn_solid_static_s arr; \
                uz_t depth_limit; \
                private fp_t h1; \
                private fp_t h2; \
                private fp_t h3; \
            }";
    bcore_self_s* self = BCORE_SELF_S_BUILD_PARSE_SC( def, bcore_hmap_u3vd_s );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_u3vd_s_init,    "bcore_fp_init",    "init"    );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_u3vd_s_down,    "bcore_fp_down",    "down"    );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_u3vd_s_copy,    "bcore_fp_copy",    "copy"    );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_u3vd_s_create,  "bcore_fp_create",  "create"  );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_u3vd_s_clone,   "bcore_fp_clone",   "clone"   );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_u3vd_s_discard, "bcore_fp_discard", "discard" );
    return self;
}

// Assembly:
pushq %rbx
leaq 0x55a31(%rip), %rdi     # 0xc35a3
pushq $0x40
popq %rsi
pushq $0x8
popq %rdx
callq 0x64356
movq %rax, %rbx
leaq -0x738b(%rip), %rsi     # 0x667fc
leaq 0x52c2d(%rip), %rdx     # 0xc07bb
leaq 0x52c2f(%rip), %rcx     # 0xc07c4
movq %rax, %rdi
callq 0x63a2b
leaq -0x72ac(%rip), %rsi     # 0x668f8
leaq 0x52c1e(%rip), %rdx     # 0xc07c9
leaq 0x46a36(%rip), %rcx     # 0xb45e8
movq %rbx, %rdi
callq 0x63a2b
leaq -0x7273(%rip), %rsi     # 0x6694e
leaq 0x52c0f(%rip), %rdx     # 0xc07d7
leaq 0x4e185(%rip), %rcx     # 0xbbd54
movq %rbx, %rdi
callq 0x63a2b
leaq -0x716f(%rip), %rsi     # 0x66a6f
leaq 0x551a0(%rip), %rdx     # 0xc2d85
leaq 0x551a2(%rip), %rcx     # 0xc2d8e
movq %rbx, %rdi
callq 0x63a2b
leaq -0x715c(%rip), %rsi     # 0x66a9f
leaq 0x55193(%rip), %rdx     # 0xc2d95
leaq 0x55195(%rip), %rcx     # 0xc2d9e
movq %rbx, %rdi
callq 0x63a2b
leaq -0x718e(%rip), %rsi     # 0x66a8a
leaq 0x55185(%rip), %rdx     # 0xc2da4
leaq 0x55187(%rip), %rcx     # 0xc2dad
movq %rbx, %rdi
callq 0x63a2b
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: hmap_tpuz_s_create_self
static bcore_self_s* hmap_tpuz_s_create_self( void )
{
    sc_t def = "\
        bcore_hmap_tpuz_s = bcore_inst \
            { \
                aware_t _; \
                private bcore_hnode_tpuz_s* nodes; \
                private bl_t* flags; \
                private uz_t size; \
                private uz_t depth_limit; \
                shell { bcore_hnode_tpuz_s []; } data; } \
            }";
    bcore_self_s* self = BCORE_SELF_S_BUILD_PARSE_SC( def, bcore_hmap_tpuz_s );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_tpuz_s_init,    "bcore_fp_init",  "init"     );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_tpuz_s_down,    "bcore_fp_down",  "down"     );
    bcore_self_s_push_ns_func( self, ( fp_t )bcore_hmap_tpuz_s_copy,    "bcore_fp_copy",  "copy"     );
    bcore_self_s_push_ns_func( self, ( fp_t )tpuz_s_get_data,           "bcore_fp_get",   "get_data" );
    bcore_self_s_push_ns_func( self, ( fp_t )tpuz_s_set_data,           "bcore_fp_set",   "set_data" );
    return self;
}

// Assembly:
pushq %rbx
leaq 0x55aa9(%rip), %rdi     # 0xc36f6
pushq $0x28
popq %rsi
pushq $0x8
popq %rdx
callq 0x64356
movq %rax, %rbx
leaq -0x6711(%rip), %rsi     # 0x67551
leaq 0x52b52(%rip), %rdx     # 0xc07bb
leaq 0x52b54(%rip), %rcx     # 0xc07c4
movq %rax, %rdi
callq 0x63a2b
leaq -0x6713(%rip), %rsi     # 0x6756c
leaq 0x52b43(%rip), %rdx     # 0xc07c9
leaq 0x4695b(%rip), %rcx     # 0xb45e8
movq %rbx, %rdi
callq 0x63a2b
leaq -0x66fd(%rip), %rsi     # 0x6759f
leaq 0x52b34(%rip), %rdx     # 0xc07d7
leaq 0x4e0aa(%rip), %rcx     # 0xbbd54
movq %rbx, %rdi
callq 0x63a2b
leaq 0x590(%rip), %rsi       # 0x6e249
leaq 0x53c67(%rip), %rdx     # 0xc1927
leaq 0x49515(%rip), %rcx     # 0xb71dc
movq %rbx, %rdi
callq 0x63a2b
leaq 0x649(%rip), %rsi       # 0x6e31f
leaq 0x53c3d(%rip), %rdx     # 0xc191a
leaq 0x55b4e(%rip), %rcx     # 0xc3832
movq %rbx, %rdi
callq 0x63a2b
movq %rbx, %rax
popq %rbx
retq