// File: /workspace/github_c_makefile_star2_O1/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 0xe1060
movabsq $0x100000001b3, %rax    # imm = 0x100000001B3
movq %r12, %rcx
xorq $0x3a, %rcx
imulq %rax, %rcx
testq %r14, %r14
je 0xe1094
xorl %edx, %edx
movzbl (%r15,%rdx), %ebx
xorq %rcx, %rbx
imulq %rax, %rbx
incq %rdx
movq %rbx, %rcx
cmpq %rdx, %r14
jne 0xe1047
jmp 0xe109c
movabsq $-0x340d631b7bdddcdb, %rdx # imm = 0xCBF29CE484222325
testq %r14, %r14
je 0xe1099
movabsq $0x100000001b3, %rax    # imm = 0x100000001B3
xorl %ecx, %ecx
movzbl (%r15,%rcx), %ebx
xorq %rdx, %rbx
imulq %rax, %rbx
incq %rcx
movq %rbx, %rdx
cmpq %rcx, %r14
jne 0xe107b
jmp 0xe109c
movq %rcx, %rbx
jmp 0xe109c
movq %rdx, %rbx
testq %rbx, %rbx
jne 0xe10d4
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xe0c2c
movq 0x8(%rax), %r8
leaq 0x70c6b(%rip), %rdi     # 0x151d25
leaq 0x70b98(%rip), %rsi     # 0x151c59
leaq 0x70c72(%rip), %rcx     # 0x151d3a
movl $0xe3, %edx
xorl %eax, %eax
callq 0xc80f6
movq 0xc7cfd(%rip), %rdi     # 0x1a8dd8
addq $0x30, %rdi
callq 0x11f515
movq 0xc7ced(%rip), %rdi     # 0x1a8dd8
movq %rbx, %rsi
callq 0x1370e2
testq %rax, %rax
je 0xe11a8
movq %rax, %r13
cmpq %r12, 0x8(%rax)
jne 0xe112a
movq 0x10(%r13), %rbp
movq %rbp, %rdi
callq 0xc84d7
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rax, %rcx
callq 0xc84d2
testl %eax, %eax
je 0xe121a
movq 0xc7ca7(%rip), %rdi     # 0x1a8dd8
addq $0x30, %rdi
callq 0x11f547
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xe0c2c
movq 0x8(%rax), %r14
movq 0x8(%r13), %r15
movq 0x10(%r13), %r12
movq %r12, %rdi
callq 0xc84d7
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0xe0c2c
movq 0x8(%rax), %r9
movq %rbx, (%rsp)
leaq 0x70bac(%rip), %rdi     # 0x151d25
leaq 0x70ad9(%rip), %rsi     # 0x151c59
leaq 0x70be3(%rip), %rcx     # 0x151d6a
movl $0xeb, %edx
movq %r14, %r8
xorl %eax, %eax
callq 0xc80f6
movq 0xc7c3b(%rip), %rdi     # 0x1a8dd8
addq $0x30, %rdi
callq 0x11f515
jmp 0xe121a
testq %r12, %r12
je 0xe11e4
movq 0xc7c24(%rip), %rdi     # 0x1a8dd8
movq %r12, %rsi
callq 0x13712b
testb %al, %al
jne 0xe11e4
leaq 0x70b5e(%rip), %rdi     # 0x151d25
leaq 0x70a8b(%rip), %rsi     # 0x151c59
leaq 0x70bb4(%rip), %rcx     # 0x151d89
movl $0xf1, %edx
movq %r12, %r8
xorl %eax, %eax
callq 0xc80f6
movq 0xc7bed(%rip), %r13     # 0x1a8dd8
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x1369b5
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0x137103
movq 0xc7bb7(%rip), %rdi     # 0x1a8dd8
addq $0x30, %rdi
callq 0x11f547
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq