// File: /workspace/github_c_makefile_star2_O0/johsteffens[P]beth/lib/bcore/bcore_hmap.c
// Function: bcore_hmap_u3vd_s_setf
void bcore_hmap_u3vd_s_setf( bcore_hmap_u3vd_s* o, u3_t key, fp_t func )
{
    if( !key ) ERR( "key is zero" );

    {
        uz_t idx = u3vd_find( o, key );
        if( idx < o->size )
        {
            bcore_hnode_u3vd_s_set_func( &o->data[ idx ], func );
            return;
        }
    }

    {
        bcore_hnode_u3vd_s node;
        bcore_hnode_u3vd_s_init( &node );
        node.key = key;
        bcore_hnode_u3vd_s* p_node = u3vd_set( o, node, 1 );
        if( p_node )
        {
            bcore_hnode_u3vd_s_set_func( p_node, func );
            return;
        }
    }

    // rehash
    {
        bcore_hnode_u3vd_s* buf_data  = o->data;
        uz_t buf_size  = o->size;
        uz_t buf_space = o->space;
        o->depth_limit = ( o->size > 0 ) ? o->depth_limit + 1 : 4;
        o->size        = ( o->size > 0 ) ? o->size * 2        : 8;
        o->data = bcore_u_alloc( sizeof( bcore_hnode_u3vd_s ), NULL, o->size, &o->space );
        bcore_memzero( o->data, sizeof( bcore_hnode_u3vd_s ) * o->size );
        for( uz_t i = 0; i < buf_size; i++ )
        {
            bcore_hnode_u3vd_s* p_node = &buf_data[ i ];
            if( p_node->key ) bcore_hmap_u3vd_s_set( o, p_node->key, p_node->dp, p_node->flag_holds );
        }
        bcore_un_alloc( sizeof( bcore_hnode_u3vd_s ), buf_data, buf_space, 0, NULL );
    }

    bcore_hmap_u3vd_s_setf( o, key, func );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0xabedf
leaq 0xa3926(%rip), %rdi     # 0x14f7eb
leaq 0xa38d7(%rip), %rsi     # 0x14f7a3
movl $0x1ac, %edx            # imm = 0x1AC
leaq 0xa3907(%rip), %rcx     # 0x14f7df
movb $0x0, %al
callq 0x9cf40
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0xab6c0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0xabf1c
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
imulq $0x18, -0x20(%rbp), %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0xac0e0
jmp 0xac0ce
leaq -0x38(%rbp), %rdi
callq 0xab440
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x38(%rbp), %rax
movl $0x1, %esi
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0xabb30
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0xabf75
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xac0e0
jmp 0xac0ce
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jbe 0xabfb6
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0xabfc1
movl $0x4, %eax
movq %rax, -0x70(%rbp)
jmp 0xabfc1
movq -0x70(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
jbe 0xabfe9
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
shlq %rax
movq %rax, -0x78(%rbp)
jmp 0xabff4
movl $0x8, %eax
movq %rax, -0x78(%rbp)
jmp 0xabff4
movq -0x78(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rcx
addq $0x8, %rcx
addq $0x10, %rcx
movl $0x18, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x9d330
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
imulq $0x18, 0x10(%rax), %rsi
callq 0x9d4f0
movq $0x0, -0x60(%rbp)
movq -0x60(%rbp), %rax
cmpq -0x50(%rbp), %rax
jae 0xac0a3
movq -0x48(%rbp), %rax
imulq $0x18, -0x60(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
cmpq $0x0, (%rax)
je 0xac093
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rax
movq (%rax), %rsi
movq -0x68(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x68(%rbp), %rax
movb 0x9(%rax), %al
andb $0x1, %al
movzbl %al, %ecx
callq 0xab870
jmp 0xac095
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0xac04b
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
movl $0x18, %edi
xorl %eax, %eax
movl %eax, %r8d
movq %r8, %rcx
callq 0x9d370
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0xabea0
addq $0x90, %rsp
popq %rbp
retq
nopw (%rax,%rax)