// File: /workspace/github_c_makefile_star2_O2/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 0x8379d(%rip), %rax     # 0xdaf01
movq %rax, 0x38(%rsp)
leaq 0x82ab7(%rip), %rcx     # 0xda227
movq %rcx, 0x50(%rsp)
leaq 0x58(%rsp), %rbx
movq %rax, (%rbx)
movq %rcx, 0x8(%rbx)
movq %rcx, 0x40(%rsp)
movq %rax, 0x48(%rsp)
andq $0x0, 0xb8(%rsp)
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x12f7(%rip), %r14     # 0x564ca
pushq $0x4
popq %rbp
movl %ebp, %edi
movq %r14, %rsi
callq 0x56460
movq %rax, %rdi
callq 0x572a1
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %ebp, %edi
movq %r14, %rsi
callq 0x56460
movq %rax, %r15
movq %rax, %rdi
callq 0x57019
movq %r15, %rdi
callq 0x572a1
movaps 0xb0(%rsp), %xmm0
movaps 0xc0(%rsp), %xmm1
movaps 0xd0(%rsp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
movl %ebp, %edi
movq %r14, %rsi
callq 0x56460
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x56680
movq %r15, %rdi
movq %rbx, %rsi
callq 0x565c1
movq 0xc0(%rsp), %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xb6b0
pushq $-0x1
popq %rbx
testl %eax, %eax
jne 0x57891
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x565c1
testq %rax, %rax
je 0x578a2
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 0x572a1
movups (%rbp), %xmm0
movups 0x10(%rbp), %xmm1
movups 0x20(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq -0x1409(%rip), %rsi     # 0x564ca
pushq $0x4
popq %rdi
callq 0x56460
movq %rax, %r15
leaq 0x58(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x56680
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x56680
movq %r15, %rdi
movq %r12, %rsi
callq 0x565c1
testq %rax, %rax
je 0x57891
leaq 0x58(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x57891
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x565c1
testq %rax, %rax
je 0x57891
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x57891
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x56a16
testl %eax, %eax
je 0x57891
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0x565c1
testq %rax, %rax
jne 0x57891
leaq 0x40(%rsp), %rsi
movq %r15, %rdi
callq 0x565c1
testq %rax, %rax
je 0x57891
leaq 0x40(%rsp), %rsi
movq %rax, %rdi
movq %r14, %rdx
callq 0xb6b0
testl %eax, %eax
jne 0x57891
movq %r15, %rdi
callq 0x572a1
xorl %ebx, %ebx
cmpq 0xd6615(%rip), %r13     # 0x12dfd0
jne 0x57891
leaq -0x39c(%rip), %rax      # 0x5762c
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)
leaq -0x1523(%rip), %rsi     # 0x564ca
pushq $0x4
popq %rdi
callq 0x56460
movq %rax, %r14
leaq 0x83502(%rip), %rbx     # 0xdaf01
leaq 0x82821(%rip), %r15     # 0xda227
leaq 0x68(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x57b94
movq %r14, %rdi
movq %r12, %rsi
callq 0x56680
movq %r12, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x57b94
movq %r14, %rdi
movq %r12, %rsi
callq 0x56680
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x565c1
pushq $-0x1
popq %rbx
testq %rax, %rax
je 0x57891
movq 0x8(%rax), %rdi
leaq 0x827c6(%rip), %rsi     # 0xda227
callq 0xb880
testl %eax, %eax
jne 0x57891
leaq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x565c1
testq %rax, %rax
je 0x57891
movq 0x8(%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0xb880
testl %eax, %eax
jne 0x57891
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x56a16
testl %eax, %eax
je 0x57891
leaq 0x38(%rsp), %rsi
movq %r14, %rdi
callq 0x565c1
testq %rax, %rax
jne 0x57891
movq 0x50(%rsp), %rsi
movq %r14, %rdi
callq 0x565c1
testq %rax, %rax
je 0x57891
movq 0x8(%rax), %rdi
movq 0x38(%rsp), %rsi
callq 0xb880
testl %eax, %eax
jne 0x57891
movq %r14, %rdi
callq 0x572a1
xorl %ebx, %ebx
jmp 0x57891