// File: /workspace/github_c_makefile_star2_O3/genometools[P]genometools/src/core/hashtable.c
// Function: gt_hashtable_test
static int
gt_hashtable_test(HashElemInfo table_info)
{
  GtFree orig_free_elem = table_info.free_op.free_elem;
  char *s1 = "foo", *s2 = "bar";
  GtHashtable *ht;
  int had_err = 0;
  struct gt_ht_elem_2cstr elemA = { s1, s2 }, elemB = { s2, s1 };
  table_info.free_op.free_elem = NULL;
  do {
    struct gt_ht_elem_2cstr *elem_p;
    /* empty hash */
    ht = gt_hashtable_new(table_info);
    gt_hashtable_delete(ht);

    /* empty hash with reset */
    ht = gt_hashtable_new(table_info);
    gt_hashtable_reset(ht);
    gt_hashtable_delete(ht);

    /* hashes containing one element */
    ht = gt_hashtable_new(table_info);
    gt_hashtable_add(ht, &elemA);
    my_ensure(had_err, !memcmp(gt_hashtable_get(ht, &elemA), &elemA,
                               table_info.elem_size));
    my_ensure(had_err, !gt_hashtable_get(ht, &elemB));
    gt_hashtable_delete(ht);

    /* hashes containing two elements */
    ht = gt_hashtable_new(table_info);
    gt_hashtable_add(ht, &elemA);
    gt_hashtable_add(ht, &elemB);
    elem_p = gt_hashtable_get(ht, &elemA);
    my_ensure(had_err, elem_p
              && !memcmp(elem_p, &elemA, table_info.elem_size));
    elem_p = gt_hashtable_get(ht, &elemB);
    my_ensure(had_err, elem_p
              && !memcmp(elem_p, &elemB, table_info.elem_size));

    /* remove element A and ensure it's no longer present */
    my_ensure(had_err, gt_hashtable_remove(ht, &elemA));
    my_ensure(had_err, !gt_hashtable_get(ht, &elemA));

    elem_p = gt_hashtable_get(ht, &elemB);
    my_ensure(had_err, elem_p
              && !memcmp(elem_p, &elemB, table_info.elem_size));
    gt_hashtable_delete(ht);

    /* hashes containing two elements (store key and value in
     * hashtable) where simple free is the correct way to get rid of them
     */
    if (orig_free_elem == gt_ht_2ptr_elem_free)
    {
      struct gt_ht_elem_2cstr elem_dup;
      table_info.free_op.free_elem = gt_ht_2ptr_elem_free;
      ht = gt_hashtable_new(table_info);

      cstr_cstr_elem_dup(&elem_dup, s1, s2);
      gt_hashtable_add(ht, &elem_dup);

      cstr_cstr_elem_dup(&elem_dup, s2, s1);
      gt_hashtable_add(ht, &elem_dup);

      elem_p = gt_hashtable_get(ht, &s1);
      my_ensure(had_err, elem_p && !strcmp(elem_p->value, s2));

      elem_p = gt_hashtable_get(ht, &s2);
      my_ensure(had_err, elem_p && !strcmp(elem_p->value, s1));

      /* remove first element */
      my_ensure(had_err, gt_hashtable_remove(ht, &s1));
      my_ensure(had_err, !gt_hashtable_get(ht, &s1));

      elem_p = gt_hashtable_get(ht, s2);
      my_ensure(had_err, elem_p && !strcmp(elem_p->value,  s1));
      gt_hashtable_delete(ht);
    }
  } while (0);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq 0xb8(%rsp), %r13
leaq 0x78e4b(%rip), %rax     # 0xf1be1
movq %rax, 0x38(%rsp)
leaq 0x784d5(%rip), %rcx     # 0xf1277
movq %rcx, 0x50(%rsp)
leaq 0x58(%rsp), %rbx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movq %rcx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
xorl %r12d, %r12d
movq %r12, 0xb8(%rsp)
leaq 0x7862a(%rip), %r14     # 0xf13f9
movl $0x80, %edi
movq %r14, %rsi
movl $0x99, %edx
callq 0x35862
movq %rax, %r15
callq 0x3cf33
movq %rax, 0x68(%r15)
movb %r12b, 0x78(%r15)
movl %r12d, 0x54(%r15)
movq %r12, 0x70(%r15)
movq %r12, 0x58(%r15)
movq %r12, 0x30(%r15)
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movl $0x4, %esi
movl $0xc0, %edx
movl $0x20, %ecx
callq 0x7874a
movq %r15, %rdi
callq 0x788a0
movl $0x80, %edi
movq %r14, %rsi
movl $0x99, %edx
callq 0x35862
movq %rax, %r15
callq 0x3cf33
movq %rax, 0x68(%r15)
movb %r12b, 0x78(%r15)
movl %r12d, 0x54(%r15)
movq %r12, 0x70(%r15)
movq %r12, 0x58(%r15)
movq %r12, 0x30(%r15)
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movl $0x4, %esi
movl $0xc0, %edx
movl $0x20, %ecx
callq 0x7874a
movq %r15, %rdi
callq 0x7867f
movq %r15, %rdi
callq 0x788a0
movl $0x80, %edi
movq %r14, %rsi
movl $0x99, %edx
callq 0x35862
movq %rax, %r15
callq 0x3cf33
movq %rax, 0x68(%r15)
movb %r12b, 0x78(%r15)
movl %r12d, 0x54(%r15)
movq %r12, 0x70(%r15)
movq %r12, 0x58(%r15)
movq %r12, 0x30(%r15)
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movl $0x4, %esi
movl $0xc0, %edx
movl $0x20, %ecx
callq 0x7874a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x77e8a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x77dfe
movq 0xc0(%rsp), %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb6b0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x78f7b
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x78f8c
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb0(%rsp), %rbp
movq %r15, %rdi
callq 0x788a0
leaq 0x78456(%rip), %rsi     # 0xf13f9
movl $0x80, %edi
movl $0x99, %edx
callq 0x35862
movq %rax, %r15
callq 0x3cf33
movq %rax, 0x68(%r15)
movb $0x0, 0x78(%r15)
movl $0x0, 0x54(%r15)
xorl %eax, %eax
movq %rax, 0x70(%r15)
movq %rax, 0x58(%r15)
movq %rax, 0x30(%r15)
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups 0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movq %r15, %rdi
movl $0x4, %esi
movl $0xc0, %edx
movl $0x20, %ecx
callq 0x7874a
leaq 0x58(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x77e8a
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x77e8a
movq %r15, %rdi
movq %r12, %rsi
callq 0x77dfe
testq %rax, %rax
je 0x78f7b
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x78f7b
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x78f7b
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x78f7b
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x78166
testl %eax, %eax
je 0x78f7b
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
jne 0x78f7b
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x78f7b
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x78f7b
movq %r15, %rdi
callq 0x788a0
xorl %ebx, %ebx
cmpq 0xd7eed(%rip), %r13     # 0x150fd8
jne 0x78f7b
leaq -0x436(%rip), %rax      # 0x78cc2
movq %rax, 0x8(%rbp)
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups 0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x77ca4
movq %rax, %r14
leaq 0x78abc(%rip), %rbx     # 0xf1be1
movq %rbx, %rdi
callq 0x728c0
leaq 0x68(%rsp), %r15
movq %rax, (%r15)
leaq 0x7813b(%rip), %r12     # 0xf1277
movq %r12, %rdi
callq 0x728c0
movq %rax, 0x8(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x77e8a
movq %r12, %rdi
callq 0x728c0
movq %rax, (%r15)
movq %rbx, %rdi
callq 0x728c0
movq %rax, 0x8(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x77e8a
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x77dfe
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x78f7b
movq 0x8(%rax), %rdi
leaq 0x780dc(%rip), %rsi     # 0xf1277
callq 0xb890
testl %eax, %eax
jne 0x78f7b
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x78f7b
movq 0x8(%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0xb890
testl %eax, %eax
jne 0x78f7b
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x78166
testl %eax, %eax
je 0x78f7b
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x77dfe
testq %rax, %rax
jne 0x78f7b
movq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x78f7b
movq 0x8(%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0xb890
testl %eax, %eax
jne 0x78f7b
movq %r14, %rdi
callq 0x788a0
xorl %ebx, %ebx
jmp 0x78f7b