// File: /workspace/github_c_makefile_star2_O3/deplinenoise[P]tundra/unittest/Test_HashTable.cpp
// Function: HashTableTest_MultiDistinct_Test::TestBody()
TEST_F(HashTableTest, MultiDistinct)
{
  HashTable<int, kFlagCaseSensitive> tbl;
  HashTableInit(&tbl, &heap);

  for (int i = 0; i < 2048; ++i)
  {
    char str[128];
    sprintf(str, "foo%d", i);
    HashTableInsert(&tbl, Djb2Hash(str), StrDup(&alloc, str), i);
  }
  EXPECT_EQ(2048, tbl.m_RecordCount);

  for (int i = 0; i < 2048; ++i)
  {
    char str[128];
    sprintf(str, "foo%d", i);
    int* ptr = HashTableLookup(&tbl, Djb2Hash(str), str);
    ASSERT_NE(nullptr, ptr);
    EXPECT_EQ(i, *ptr);
  }
  HashTableDestroy(&tbl);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rcx
movups %xmm0, 0xc(%rcx)
movaps %xmm0, (%rcx)
movq %rax, 0x20(%rcx)
movq $0x0, 0x28(%rcx)
addq $0x18, %rbx
leaq 0x60(%rsp), %r12
xorl %ebp, %ebp
movq %r12, %rdi
leaq 0x178fd(%rip), %rsi     # 0x563b5
movl %ebp, %edx
xorl %eax, %eax
callq 0xc0f0
movq %r12, %rdi
callq 0x40c20
movl %eax, %r13d
movq %r12, %rdi
callq 0xc260
movq %rax, %r15
leaq 0x1(%rax), %rsi
movl $0x1, %edx
movq %rbx, %rdi
callq 0x41fb0
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0xc4b0
movb $0x0, (%r14,%r15)
leaq 0x30(%rsp), %rdi
movl %r13d, %esi
movq %r14, %rdx
callq 0x400b6
movq 0x58(%rsp), %rcx
cltq
movl %ebp, (%rcx,%rax,4)
incl %ebp
cmpl $0x800, %ebp            # imm = 0x800
jne 0x3eaae
leaq 0x8(%rsp), %rcx
movl $0x800, (%rcx)          # imm = 0x800
leaq 0x48(%rsp), %r8
leaq 0x17882(%rip), %rsi     # 0x563bb
leaq 0x1784d(%rip), %rdx     # 0x5638d
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ba7c
cmpb $0x0, (%rbx)
jne 0x3ebcc
leaq 0x8(%rsp), %rdi
callq 0x12e46
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x3eb6b
movq (%rax), %r8
jmp 0x3eb72
leaq 0x19355(%rip), %r8      # 0x57ec7
leaq 0x177f8(%rip), %rdx     # 0x56371
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x4f, %ecx
callq 0x10b64
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10c00
leaq 0x20(%rsp), %rdi
callq 0x10bd0
cmpq $0x0, 0x8(%rsp)
je 0x3ebcc
movl $0x1, %edi
callq 0x10b61
testb %al, %al
je 0x3ebcc
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3ebcc
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x68(%rsp), %rdi
xorl %esi, %esi
callq 0x2c37a
leaq 0x1c(%rsp), %rax
movl $0x0, (%rax)
leaq 0x60(%rsp), %r13
leaq 0x177b4(%rip), %r15     # 0x563a3
leaq 0x8(%rsp), %r12
movq %rsp, %r14
leaq 0x20(%rsp), %rbp
leaq 0x28(%rsp), %rbx
xorl %edx, %edx
movq %r13, %rdi
leaq 0x177a8(%rip), %rsi     # 0x563b5
xorl %eax, %eax
callq 0xc0f0
movq %r13, %rdi
callq 0x40c20
leaq 0x30(%rsp), %rdi
movl %eax, %esi
movq %r13, %rdx
callq 0x40288
cltq
leaq (,%rax,4), %rcx
addq 0x58(%rsp), %rcx
cmpl $-0x1, %eax
movl $0x0, %eax
cmovneq %rcx, %rax
movq %rax, 0x20(%rsp)
movq $0x0, (%rsp)
movq %r12, %rdi
leaq 0x157ae(%rip), %rsi     # 0x5440b
movq %r15, %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0x3fc6f
cmpb $0x0, 0x8(%rsp)
je 0x3ed46
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2c37a
movq 0x20(%rsp), %r8
movq %r12, %rdi
leaq 0x162a0(%rip), %rsi     # 0x54f31
leaq 0x1770a(%rip), %rdx     # 0x563a2
leaq 0x1c(%rsp), %rcx
callq 0x31b38
cmpb $0x0, 0x8(%rsp)
jne 0x3ed15
movq %r14, %rdi
callq 0x12e46
movq 0x10(%rsp), %rax
leaq 0x1920a(%rip), %r8      # 0x57ec7
testq %rax, %rax
je 0x3ecc5
movq (%rax), %r8
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x1769d(%rip), %rdx     # 0x56371
movl $0x57, %ecx
callq 0x10b64
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10c00
movq %rbx, %rdi
callq 0x10bd0
cmpq $0x0, (%rsp)
je 0x3ed15
movl $0x1, %edi
callq 0x10b61
testb %al, %al
je 0x3ed15
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3ed15
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2c37a
movl 0x1c(%rsp), %eax
leal 0x1(%rax), %edx
movl %edx, 0x1c(%rsp)
cmpl $0x7fe, %eax            # imm = 0x7FE
jle 0x3ec03
leaq 0x30(%rsp), %rdi
callq 0x3fc31
jmp 0x3edc6
movq %rsp, %rdi
callq 0x12e46
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x3ed5d
movq (%rax), %r8
jmp 0x3ed64
leaq 0x19163(%rip), %r8      # 0x57ec7
leaq 0x17606(%rip), %rdx     # 0x56371
leaq 0x28(%rsp), %rdi
movl $0x2, %esi
movl $0x56, %ecx
callq 0x10b64
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0x10c00
leaq 0x28(%rsp), %rdi
callq 0x10bd0
cmpq $0x0, (%rsp)
je 0x3edba
movl $0x1, %edi
callq 0x10b61
testb %al, %al
je 0x3edba
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3edba
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2c37a
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3ee43
jmp 0x3ee43
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x10bd0
jmp 0x3edee
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x31a70
jmp 0x3edfd
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x3ee34
jmp 0x3ee43
jmp 0x3ee15
jmp 0x3ee24
jmp 0x3ee10
jmp 0x3ee43
jmp 0x3ee43
movq %rax, %rbx
jmp 0x3ee2f
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x10bd0
jmp 0x3ee27
movq %rax, %rbx
movq %rsp, %rdi
callq 0x31a70
leaq 0x8(%rsp), %rdi
callq 0x31a82
movq %rbx, %rdi
callq 0xcbb0
jmp 0x3ee43
movq %rax, %rdi
callq 0x287ef
nop