// File: /workspace/github_c_makefile_star2_O1/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 0x7933a(%rip), %rax     # 0xf1c31
movq %rax, 0x40(%rsp)
leaq 0x789c4(%rip), %rcx     # 0xf12c7
movq %rcx, 0x38(%rsp)
leaq 0x58(%rsp), %rbx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movq %rcx, 0x48(%rsp)
movq %rax, 0x50(%rsp)
xorl %r12d, %r12d
movq %r12, 0xb8(%rsp)
leaq 0x78b19(%rip), %r14     # 0xf1449
movl $0x80, %edi
movq %r14, %rsi
movl $0x99, %edx
callq 0x35ee2
movq %rax, %r15
callq 0x3d8a7
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 0x782aa
movq %r15, %rdi
callq 0x78408
movl $0x80, %edi
movq %r14, %rsi
movl $0x99, %edx
callq 0x35ee2
movq %rax, %r15
callq 0x3d8a7
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 0x782aa
movq %r15, %rdi
callq 0x781df
movq %r15, %rdi
callq 0x78408
movl $0x80, %edi
movq %r14, %rsi
movl $0x99, %edx
callq 0x35ee2
movq %rax, %r15
callq 0x3d8a7
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 0x782aa
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7799a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x77906
movq 0xc0(%rsp), %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb6b0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x78adc
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x78aed
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 0x78408
leaq 0x78945(%rip), %rsi     # 0xf1449
movl $0x80, %edi
movl $0x99, %edx
callq 0x35ee2
movq %rax, %r15
callq 0x3d8a7
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 0x782aa
leaq 0x58(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x7799a
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x7799a
movq %r15, %rdi
movq %r12, %rsi
callq 0x77906
testq %rax, %rax
je 0x78adc
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x78adc
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x78adc
leaq 0x48(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x78adc
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x77c96
testl %eax, %eax
je 0x78adc
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
jne 0x78adc
leaq 0x48(%rsp), %rsi
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x78adc
leaq 0x48(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x78adc
movq %r15, %rdi
callq 0x78408
xorl %ebx, %ebx
cmpq 0xd838c(%rip), %r13     # 0x150fd8
jne 0x78adc
leaq -0x42f(%rip), %rax      # 0x7882a
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 0x777ac
movq %rax, %r14
leaq 0x40(%rsp), %rbx
movq (%rbx), %rdi
movq 0x38(%rsp), %r15
callq 0x722dc
leaq 0x68(%rsp), %r12
movq %rax, (%r12)
movq %r15, %rdi
callq 0x722dc
movq %rax, 0x8(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x7799a
movq 0x38(%rsp), %rdi
movq (%rbx), %r15
callq 0x722dc
movq %rax, (%r12)
movq %r15, %rdi
callq 0x722dc
movq %rax, 0x8(%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x7799a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x77906
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x78adc
movq 0x8(%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0xb890
testl %eax, %eax
jne 0x78adc
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x77906
testq %rax, %rax
je 0x78adc
movq 0x8(%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0xb890
testl %eax, %eax
jne 0x78adc
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x77c96
testl %eax, %eax
je 0x78adc
leaq 0x40(%rsp), %rsi
movq %r14, %rdi
callq 0x77906
testq %rax, %rax
jne 0x78adc
movq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x77906
testq %rax, %rax
je 0x78adc
movq 0x8(%rax), %rdi
movq 0x40(%rsp), %rsi
callq 0xb890
testl %eax, %eax
jne 0x78adc
movq %r14, %rdi
callq 0x78408
xorl %ebx, %ebx
jmp 0x78adc