// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_name_manager.c
// Function: bcore_name_enroll_sn
tp_t bcore_name_enroll_sn( tp_t name_space, sc_t name, uz_t n )
{
    assert( hmap_s_g != NULL );
    tp_t key = bcore_name_key_ns_n( name_space, name, n );
    if( key == 0 ) ERR( "Hash of '%s' is zero. Zero is a reserved value.", cat_name_ns_n( name_space, name, n )->sc );
    bcore_mutex_s_lock( &hmap_s_g->mutex );
    bcore_name_s* node = bcore_name_map_s_get( &hmap_s_g->map, key );
    if( node )
    {
        if( node->name_space != name_space || ( bcore_strcmp_n( name, n, node->name, bcore_strlen( node->name ) ) != 0 ) )
        {
            bcore_mutex_s_unlock( &hmap_s_g->mutex );
            ERR( "'%s' collides with '%s' at %"PRItp_t"", cat_name_ns_n( name_space, name, n )->sc, cat_name_ns( node->name_space, node->name )->sc, key );
            bcore_mutex_s_lock( &hmap_s_g->mutex );
        }
    }
    else
    {
        if( name_space && !bcore_name_map_s_exists( &hmap_s_g->map, name_space ) ) ERR( "Namespace %"PRItp_t" not found", name_space );
        bcore_name_map_s_set( &hmap_s_g->map, bcore_name_ns_sc_n( name_space, name, n ) );
    }
    bcore_mutex_s_unlock( &hmap_s_g->mutex );
    return key;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
testq %rdi, %rdi
je 0xd7266
movabsq $0x100000001b3, %rcx    # imm = 0x100000001B3
movq %r12, %rdx
xorq $0x3a, %rdx
imulq %rcx, %rdx
testq %r14, %r14
je 0xd729a
xorl %esi, %esi
movzbl (%r15,%rsi), %eax
xorq %rdx, %rax
imulq %rcx, %rax
incq %rsi
movq %rax, %rdx
cmpq %rsi, %r14
jne 0xd724d
jmp 0xd729d
movabsq $-0x340d631b7bdddcdb, %rbx # imm = 0xCBF29CE484222325
testq %r14, %r14
je 0xd72da
movabsq $0x100000001b3, %rcx    # imm = 0x100000001B3
xorl %edx, %edx
movzbl (%r15,%rdx), %eax
xorq %rbx, %rax
imulq %rcx, %rax
incq %rdx
movq %rax, %rbx
cmpq %rdx, %r14
jne 0xd7281
jmp 0xd729d
movq %rdx, %rax
movq %rax, %rbx
testq %rax, %rax
jne 0xd72da
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd6e34
movq 0x8(%rax), %r8
leaq 0x6fa8d(%rip), %rdi     # 0x146d4b
leaq 0x6f9ba(%rip), %rsi     # 0x146c7f
leaq 0x6fa94(%rip), %rcx     # 0x146d60
xorl %ebx, %ebx
movl $0xe3, %edx
xorl %eax, %eax
callq 0xbe592
movq 0xc4af7(%rip), %rdi     # 0x19bdd8
addq $0x30, %rdi
callq 0x1142c9
movq 0xc4ae7(%rip), %rdi     # 0x19bdd8
movq %rbx, %rsi
callq 0x12bb6f
testq %rax, %rax
je 0xd73ae
movq %rax, %r13
cmpq %r12, 0x8(%rax)
jne 0xd7330
movq 0x10(%r13), %rbp
movq %rbp, %rdi
callq 0xbe963
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rax, %rcx
callq 0xbe95e
testl %eax, %eax
je 0xd7420
movq 0xc4aa1(%rip), %rdi     # 0x19bdd8
addq $0x30, %rdi
callq 0x1142fb
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd6e34
movq 0x8(%rax), %r14
movq 0x8(%r13), %r15
movq 0x10(%r13), %r12
movq %r12, %rdi
callq 0xbe963
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xd6e34
movq 0x8(%rax), %r9
movq %rbx, (%rsp)
leaq 0x6f9cc(%rip), %rdi     # 0x146d4b
leaq 0x6f8f9(%rip), %rsi     # 0x146c7f
leaq 0x6fa03(%rip), %rcx     # 0x146d90
movl $0xeb, %edx
movq %r14, %r8
xorl %eax, %eax
callq 0xbe592
movq 0xc4a35(%rip), %rdi     # 0x19bdd8
addq $0x30, %rdi
callq 0x1142c9
jmp 0xd7420
testq %r12, %r12
je 0xd73ea
movq 0xc4a1e(%rip), %rdi     # 0x19bdd8
movq %r12, %rsi
callq 0x12bbb8
testb %al, %al
jne 0xd73ea
leaq 0x6f97e(%rip), %rdi     # 0x146d4b
leaq 0x6f8ab(%rip), %rsi     # 0x146c7f
leaq 0x6f9d4(%rip), %rcx     # 0x146daf
movl $0xf1, %edx
movq %r12, %r8
xorl %eax, %eax
callq 0xbe592
movq 0xc49e7(%rip), %r13     # 0x19bdd8
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x12b45d
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x12bb90
movq 0xc49b1(%rip), %rdi     # 0x19bdd8
addq $0x30, %rdi
callq 0x1142fb
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq