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

  for (int i = 0; i < 2048; ++i)
  {
    char str[128];
    sprintf(str, "foo%d", i);
    HashTableInsert(&tbl, Djb2HashNoCase(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, Djb2HashNoCase(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 0x17521(%rip), %rsi     # 0x563b5
movl %ebp, %edx
xorl %eax, %eax
callq 0xc0f0
movq %r12, %rdi
callq 0x40c8a
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 0x40494
movq 0x58(%rsp), %rcx
cltq
movl %ebp, (%rcx,%rax,4)
incl %ebp
cmpl $0x800, %ebp            # imm = 0x800
jne 0x3ee8a
leaq 0x8(%rsp), %rcx
movl $0x800, (%rcx)          # imm = 0x800
leaq 0x48(%rsp), %r8
leaq 0x174a6(%rip), %rsi     # 0x563bb
leaq 0x17471(%rip), %rdx     # 0x5638d
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x3ba7c
cmpb $0x0, (%rbx)
jne 0x3efa8
leaq 0x8(%rsp), %rdi
callq 0x12e46
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x3ef47
movq (%rax), %r8
jmp 0x3ef4e
leaq 0x18f79(%rip), %r8      # 0x57ec7
leaq 0x1741c(%rip), %rdx     # 0x56371
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x67, %ecx
callq 0x10b64
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x10c00
leaq 0x20(%rsp), %rdi
callq 0x10bd0
cmpq $0x0, 0x8(%rsp)
je 0x3efa8
movl $0x1, %edi
callq 0x10b61
testb %al, %al
je 0x3efa8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3efa8
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 0x173d8(%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 0x173ef(%rip), %rsi     # 0x563d8
xorl %eax, %eax
callq 0xc0f0
movq %r13, %rdi
callq 0x40c8a
leaq 0x30(%rsp), %rdi
movl %eax, %esi
movq %r13, %rdx
callq 0x40666
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 0x153d2(%rip), %rsi     # 0x5440b
movq %r15, %rdx
movq %r14, %rcx
movq %rbp, %r8
callq 0x3fc6f
cmpb $0x0, 0x8(%rsp)
je 0x3f122
leaq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0x2c37a
movq 0x20(%rsp), %r8
movq %r12, %rdi
leaq 0x15ec4(%rip), %rsi     # 0x54f31
leaq 0x1732e(%rip), %rdx     # 0x563a2
leaq 0x1c(%rsp), %rcx
callq 0x31b38
cmpb $0x0, 0x8(%rsp)
jne 0x3f0f1
movq %r14, %rdi
callq 0x12e46
movq 0x10(%rsp), %rax
leaq 0x18e2e(%rip), %r8      # 0x57ec7
testq %rax, %rax
je 0x3f0a1
movq (%rax), %r8
movq %rbx, %rdi
movl $0x1, %esi
leaq 0x172c1(%rip), %rdx     # 0x56371
movl $0x6f, %ecx
callq 0x10b64
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10c00
movq %rbx, %rdi
callq 0x10bd0
cmpq $0x0, (%rsp)
je 0x3f0f1
movl $0x1, %edi
callq 0x10b61
testb %al, %al
je 0x3f0f1
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3f0f1
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 0x3efdf
leaq 0x30(%rsp), %rdi
callq 0x3fc97
jmp 0x3f1a2
movq %rsp, %rdi
callq 0x12e46
movq 0x10(%rsp), %rax
testq %rax, %rax
je 0x3f139
movq (%rax), %r8
jmp 0x3f140
leaq 0x18d87(%rip), %r8      # 0x57ec7
leaq 0x1722a(%rip), %rdx     # 0x56371
leaq 0x28(%rsp), %rdi
movl $0x2, %esi
movl $0x6e, %ecx
callq 0x10b64
leaq 0x28(%rsp), %rdi
movq %rsp, %rsi
callq 0x10c00
leaq 0x28(%rsp), %rdi
callq 0x10bd0
cmpq $0x0, (%rsp)
je 0x3f196
movl $0x1, %edi
callq 0x10b61
testb %al, %al
je 0x3f196
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x3f196
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 0x3f21f
jmp 0x3f21f
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x10bd0
jmp 0x3f1ca
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x31a70
jmp 0x3f1d9
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x3f210
jmp 0x3f21f
jmp 0x3f1f1
jmp 0x3f200
jmp 0x3f1ec
jmp 0x3f21f
jmp 0x3f21f
movq %rax, %rbx
jmp 0x3f20b
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x10bd0
jmp 0x3f203
movq %rax, %rbx
movq %rsp, %rdi
callq 0x31a70
leaq 0x8(%rsp), %rdi
callq 0x31a82
movq %rbx, %rdi
callq 0xcbb0
jmp 0x3f21f
movq %rax, %rdi
callq 0x287ef
nop