// File: /workspace/github_c_makefile_star2_O2/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
callq 0x7201f
movq %rax, %rbx
testq %rax, %rax
jne 0x720ef
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x71d28
movq 0x8(%rax), %r8
leaq 0x52bbd(%rip), %rdi     # 0xc4c92
leaq 0x52aea(%rip), %rsi     # 0xc4bc6
leaq 0x52bc4(%rip), %rcx     # 0xc4ca7
movl $0xe3, %edx
xorl %eax, %eax
callq 0x60031
movq 0xa5ce2(%rip), %rdi     # 0x117dd8
addq $0x30, %rdi
callq 0x97ae2
movq 0xa5cd2(%rip), %rdi     # 0x117dd8
movq %rbx, %rsi
callq 0xa8a80
testq %rax, %rax
je 0x721b2
movq %rax, %r13
cmpq %r12, 0x8(%rax)
jne 0x72145
movq 0x10(%r13), %rbp
movq %rbp, %rdi
callq 0x60379
movq %r15, %rdi
movq %r14, %rsi
movq %rbp, %rdx
movq %rax, %rcx
callq 0x60374
testl %eax, %eax
je 0x72224
movq 0xa5c8c(%rip), %rdi     # 0x117dd8
addq $0x30, %rdi
callq 0x97b12
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x71d28
movq 0x8(%rax), %r14
movq 0x8(%r13), %rdi
movq 0x10(%r13), %rsi
callq 0x71d8f
movq 0x8(%rax), %r9
movq %rbx, (%rsp)
leaq 0x52b0f(%rip), %rdi     # 0xc4c92
leaq 0x52a3c(%rip), %rsi     # 0xc4bc6
leaq 0x52b46(%rip), %rcx     # 0xc4cd7
movl $0xeb, %edx
movq %r14, %r8
xorl %eax, %eax
callq 0x60031
movq 0xa5c31(%rip), %rdi     # 0x117dd8
addq $0x30, %rdi
callq 0x97ae2
jmp 0x72224
testq %r12, %r12
je 0x721ee
movq 0xa5c1a(%rip), %rdi     # 0x117dd8
movq %r12, %rsi
callq 0xa8ac1
testb %al, %al
jne 0x721ee
leaq 0x52ac1(%rip), %rdi     # 0xc4c92
leaq 0x529ee(%rip), %rsi     # 0xc4bc6
leaq 0x52b17(%rip), %rcx     # 0xc4cf6
movl $0xf1, %edx
movq %r12, %r8
xorl %eax, %eax
callq 0x60031
movq 0xa5be3(%rip), %r13     # 0x117dd8
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0xa8575
movq 0x10(%rbp), %rax
movq %rax, 0x10(%rsp)
movups (%rbp), %xmm0
movups %xmm0, (%rsp)
movq %r13, %rdi
callq 0xa8a9d
movq 0xa5bad(%rip), %rdi     # 0x117dd8
addq $0x30, %rdi
callq 0x97b12
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq