// File: /workspace/github_c_makefile_star2_O3/johsteffens[P]beth/lib/bcore/bcore_name_manager.c
// Function: bcore_name_check_collision_sn
er_t bcore_name_check_collision_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 )
    {
        return bcore_error_push_fa( TYPEOF_general_error, "Hash of '#<sc_t>' 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 );
    bcore_mutex_s_unlock( &hmap_s_g->mutex );

    if( node )
    {
        if( node->name_space != name_space || ( bcore_strcmp_n( name, n, node->name, bcore_strlen( node->name ) ) != 0 ) )
        {
            return bcore_error_push_fa( TYPEOF_general_error, "'#<sc_t>' collides with '#<sc_t>' at key value '#<tp_t>'", cat_name_ns_n( name_space, name, n )->sc, cat_name_ns( node->name_space, node->name )->sc, key );
        }
    }
    else
    {
        if( name_space && !bcore_name_map_s_exists( &hmap_s_g->map, name_space ) )
        {
            return bcore_error_push_fa( TYPEOF_general_error, "Namespace '#<tp_t>' not found", name_space );
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
testq %rdi, %rdi
je 0xd704a
movabsq $0x100000001b3, %rcx    # imm = 0x100000001B3
movq %rbx, %rdx
xorq $0x3a, %rdx
imulq %rcx, %rdx
testq %r14, %r14
je 0xd707e
xorl %esi, %esi
movzbl (%r15,%rsi), %eax
xorq %rdx, %rax
imulq %rcx, %rax
incq %rsi
movq %rax, %rdx
cmpq %rsi, %r14
jne 0xd7031
jmp 0xd7081
movabsq $-0x340d631b7bdddcdb, %r12 # imm = 0xCBF29CE484222325
testq %r14, %r14
je 0xd708d
movabsq $0x100000001b3, %rcx    # imm = 0x100000001B3
xorl %edx, %edx
movzbl (%r15,%rdx), %eax
xorq %r12, %rax
imulq %rcx, %rax
incq %rdx
movq %rax, %r12
cmpq %rdx, %r14
jne 0xd7065
jmp 0xd7081
movq %rdx, %rax
movq %rax, %r12
testq %rax, %rax
je 0xd7153
movq 0xc4d44(%rip), %rdi     # 0x19bdd8
addq $0x30, %rdi
callq 0x1142c9
movq 0xc4d34(%rip), %rdi     # 0x19bdd8
movq %r12, %rsi
callq 0x12bb6f
movq %rax, %r13
movq 0xc4d22(%rip), %rdi     # 0x19bdd8
addq $0x30, %rdi
callq 0x1142fb
testq %r13, %r13
je 0xd718b
cmpq %rbx, 0x8(%r13)
jne 0xd70f3
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 0xd71a3
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd6e34
movq 0x8(%rax), %rbx
movq 0x8(%r13), %r14
movq 0x10(%r13), %r15
movq %r15, %rdi
callq 0xbe963
movq %r14, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0xd6e34
movq 0x8(%rax), %rcx
leaq 0x6fbc6(%rip), %rsi     # 0x146cf4
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
movq %rbx, %rdx
movq %r12, %r8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbec3c
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xd6e34
movq 0x8(%rax), %rdx
leaq 0x6fb53(%rip), %rsi     # 0x146cbf
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xbec3c
testq %rbx, %rbx
je 0xd71a3
movq 0xc4c41(%rip), %rdi     # 0x19bdd8
movq %rbx, %rsi
callq 0x12bbb8
testb %al, %al
je 0xd71b4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6fb72(%rip), %rsi     # 0x146d2d
movabsq $0x4d9e984c5b21faea, %rdi # imm = 0x4D9E984C5B21FAEA
movq %rbx, %rdx
jmp 0xd7176