// File: /workspace/github_c_makefile_star2_O1/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), %r15
testq %r15, %r15
je 0xd50fe
leaq 0xd43f6(%rip), %rax     # 0x1a9468
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r15, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r15, %rdx
je 0xd50cc
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r15, %rdx
je 0xd50cc
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r15, %rdx
je 0xd50cc
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r15, %rdx
jne 0xd5282
movq (%rax,%rcx), %r12
testq %r12, %r12
jne 0xd5101
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r15, %rsi
callq 0xf3f85
movq %rax, %r12
leaq 0xd4377(%rip), %rdi     # 0x1a9468
movq %r15, %rsi
movq %rax, %rdx
callq 0x12128c
jmp 0xd5101
xorl %r12d, %r12d
cmpq $0x0, 0x20(%rbx)
je 0xd5136
movl $0x8, %r15d
xorl %r13d, %r13d
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rsi
testq %rsi, %rsi
je 0xd5129
movq %r12, %rdi
callq *0xb8(%r12)
incq %r13
addq $0x10, %r15
cmpq 0x20(%rbx), %r13
jb 0xd5111
movq 0x10(%rbx), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0xc8315
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
xorl %esi, %esi
callq 0xc8315
movq %rax, 0x18(%rbx)
movq $0x0, 0x20(%rbx)
movq 0x10(%rbx), %rsi
movq 0x20(%r14), %rdx
movl $0x10, %edi
callq 0xc8389
movq %rax, 0x10(%rbx)
movq 0x8(%r14), %r12
testq %r12, %r12
je 0xd5213
leaq 0xd42df(%rip), %rax     # 0x1a9468
movl (%rax), %ecx
movslq %ecx, %rcx
leaq (%rcx,%rcx,2), %rcx
movq 0x20(%rax,%rcx,8), %rdx
movq 0x18(%rax,%rcx,8), %rcx
andq %r12, %rcx
shlq $0x4, %rcx
leaq (%rdx,%rcx), %rax
movq (%rdx,%rcx), %rdx
movl $0x8, %ecx
cmpq %r12, %rdx
je 0xd51e3
movq 0x10(%rax), %rdx
movl $0x18, %ecx
cmpq %r12, %rdx
je 0xd51e3
movq 0x20(%rax), %rdx
movl $0x28, %ecx
cmpq %r12, %rdx
je 0xd51e3
movq 0x30(%rax), %rdx
movl $0x38, %ecx
cmpq %r12, %rdx
jne 0xd528a
movq (%rax,%rcx), %r15
testq %r15, %r15
jne 0xd5213
movabsq $0x782b96602f424981, %rdi # imm = 0x782B96602F424981
movq %r12, %rsi
callq 0xf3f85
movq %rax, %r15
leaq 0xd4260(%rip), %rdi     # 0x1a9468
movq %r12, %rsi
movq %rax, %rdx
callq 0x12128c
movq 0x20(%r14), %rax
testq %rax, %rax
je 0xd525f
movl $0x8, %r12d
xorl %r13d, %r13d
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 0xd524f
movq %r15, %rdi
callq *0xc0(%r15)
movq %rax, (%rbp,%r12)
incq %r13
movq 0x20(%r14), %rax
addq $0x10, %r12
cmpq %rax, %r13
jb 0xd5225
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
xorl %r12d, %r12d
jmp 0xd50d0
xorl %r15d, %r15d
jmp 0xd51e7