// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/core/hashmap.c
// Function: gt_hashmap_test
static int
gt_hashmap_test(GtHashType hash_type)
{
  char *s1 = "foo", *s2 = "bar";
  GT_UNUSED GtUword ul1 = 1UL, ul2 = 2UL;
  GT_UNUSED GtUint64 ull1 = 3ULL, ull2 = 4ULL, *sptr = NULL,
                               *tptr = NULL;
  GtHashmap *hm;
  GtHashtable *ht;
  int had_err = 0;
  do {
    /* empty hash */
    hm = gt_hashmap_new(hash_type, NULL, NULL);
    gt_hashmap_delete(hm);

    /* empty hash with reset */
    hm = gt_hashmap_new(hash_type, NULL, NULL);
    gt_hashmap_reset(hm);
    gt_hashmap_delete(hm);

    /* hashes containing one element */
    hm = gt_hashmap_new(hash_type, NULL, NULL);
    gt_hashmap_add(hm, s1, s2);
    my_ensure(had_err, gt_hashmap_get(hm, s1) == s2);
    my_ensure(had_err, !gt_hashmap_get(hm, s2));
    gt_hashmap_delete(hm);

    /* hashes containing two elements */
    hm = gt_hashmap_new(hash_type, NULL, NULL);
    gt_hashmap_add(hm, s1, s2);
    gt_hashmap_add(hm, s2, s1);
    my_ensure(had_err, gt_hashmap_get(hm, s1) == s2);
    my_ensure(had_err, gt_hashmap_get(hm, s2) == s1);

    /* remove element A and ensure it's no longer present */
    gt_hashmap_remove(hm, s1);
    my_ensure(had_err, !gt_hashmap_get(hm, s1));
    my_ensure(had_err, gt_hashmap_get(hm, s2) == s1);
    gt_hashmap_delete(hm);

    /* hashes containing two elements (store key and value in
     * hashmap) where simple free is the correct way to get rid of them
     */
    if (hash_type == GT_HASH_STRING)
    {
      hm = gt_hashmap_new(hash_type, gt_free_func, gt_free_func);

      gt_hashmap_add(hm, gt_cstr_dup(s1), gt_cstr_dup(s2));
      gt_hashmap_add(hm, gt_cstr_dup(s2), gt_cstr_dup(s1));
      my_ensure(had_err, !strcmp(gt_hashmap_get(hm, s1), s2));
      my_ensure(had_err, !strcmp(gt_hashmap_get(hm, s2), s1));
      gt_hashmap_remove(hm, s1); /* remove first element */
      my_ensure(had_err, !gt_hashmap_get(hm, s1));
      my_ensure(had_err, !strcmp(gt_hashmap_get(hm, s2),  s1));
      gt_hashmap_delete(hm);
    }

    /* test direct modification of hash contents */
    ht = testul_testull_gt_hashmap_new();
    my_ensure(had_err, !sptr);
    sptr = testul_testull_gt_hashmap_add_and_return_storage(ht, ul1, ull1);
    my_ensure(had_err, *sptr == ull1);
    sptr = testul_testull_gt_hashmap_add_and_return_storage(ht, ul1, ull2);
    my_ensure(had_err, *sptr == ull2);
    (*sptr)++;
    tptr = testul_testull_gt_hashmap_get(ht, ul1);
    my_ensure(had_err, tptr == sptr);
    my_ensure(had_err, *tptr == ull2+1);
    gt_hashtable_delete(ht);

  } while (0);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edi, %ebp
leaq -0x28d(%rip), %rbx      # 0x7702b
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x76f31
movq %rax, %rdi
callq 0x78408
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x76f31
movq %rax, %r14
movq %rax, %rdi
callq 0x781df
movq %r14, %rdi
callq 0x78408
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x76f31
movq %rax, %r15
leaq 0x7a92c(%rip), %r14     # 0xf1c31
leaq 0x79fbb(%rip), %r12     # 0xf12c7
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x77144
leaq 0x38(%rsp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0x77906
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x7733a
cmpq %r12, 0x8(%rax)
je 0x7734b
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x38(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x77367
cmpq $0x0, 0x8(%rax)
jne 0x7733a
movq %r15, %rdi
callq 0x78408
leaq -0x34b(%rip), %rcx      # 0x7702b
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x76f31
movq %rax, %r15
leaq 0x79f3c(%rip), %r12     # 0xf12c7
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x77144
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x77144
leaq 0x38(%rsp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x7733a
cmpq %r12, 0x8(%rax)
jne 0x7733a
leaq 0x38(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x7733a
cmpq %r14, 0x8(%rax)
jne 0x7733a
leaq 0x38(%rsp), %r13
movq %r14, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x77c96
movq %r14, (%r13)
leaq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x77422
cmpq $0x0, 0x8(%rax)
jne 0x7733a
leaq 0x38(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x7733a
cmpq %r14, 0x8(%rax)
jne 0x7733a
movq %r15, %rdi
callq 0x78408
cmpl $0x1, %ebp
jne 0x775d1
leaq 0x79f2c(%rip), %rsi     # 0xf1389
movl $0x10, %edi
movl $0x33, %edx
callq 0x35ee2
leaq -0x41114(%rip), %rcx    # 0x3635f
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
leaq 0x134c(%rip), %rdx      # 0x787cd
leaq 0x38(%rsp), %r13
movq %rdx, (%r13)
leaq 0x1e9(%rip), %rdx       # 0x7767a
movq %rdx, 0x8(%r13)
movq $0x10, 0x10(%r13)
leaq 0x137b(%rip), %rdx      # 0x7881f
movq %rdx, 0x18(%r13)
movq %rax, 0x20(%r13)
movq %rcx, 0x28(%r13)
movups (%r13), %xmm0
movups 0x10(%r13), %xmm1
movups 0x20(%r13), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x777ac
movq %rax, %r15
movq %r14, %rdi
callq 0x722dc
movq %rax, %rbp
leaq 0x79de0(%rip), %r12     # 0xf12c7
movq %r12, %rdi
callq 0x722dc
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x77144
movq %r12, %rdi
callq 0x722dc
movq %rax, %rbp
movq %r14, %rdi
callq 0x722dc
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x77144
movq %r14, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x77906
movq 0x8(%rax), %rdi
movq %r12, %rsi
callq 0xb890
testl %eax, %eax
jne 0x7733a
leaq 0x38(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77906
movq 0x8(%rax), %rdi
leaq 0x7a6d5(%rip), %r14     # 0xf1c31
movq %r14, %rsi
callq 0xb890
testl %eax, %eax
jne 0x7733a
leaq 0x38(%rsp), %r13
movq %r14, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x77c96
movq %r14, (%r13)
leaq 0x38(%rsp), %rsi
movq %r15, %rdi
callq 0x77906
testq %rax, %rax
je 0x775a1
cmpq $0x0, 0x8(%rax)
jne 0x7733a
leaq 0x38(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77906
movq 0x8(%rax), %rdi
leaq 0x7a675(%rip), %rsi     # 0xf1c31
callq 0xb890
testl %eax, %eax
jne 0x7733a
movq %r15, %rdi
callq 0x78408
movups 0xda170(%rip), %xmm0    # 0x151748
movups %xmm0, 0x20(%rsp)
movups 0xda154(%rip), %xmm0    # 0x151738
movups %xmm0, 0x10(%rsp)
movups 0xda138(%rip), %xmm0    # 0x151728
movups %xmm0, (%rsp)
callq 0x777ac
movq %rax, %r14
movl $0x3, %esi
movq %rax, %rdi
callq 0x776be
cmpq $0x3, (%rax)
jne 0x7733a
movl $0x4, %esi
movq %r14, %rdi
callq 0x776be
cmpq $0x4, (%rax)
jne 0x7733a
movq %rax, %r15
movq $0x5, (%rax)
leaq 0x38(%rsp), %rsi
movq $0x1, (%rsi)
movq %r14, %rdi
callq 0x77906
leaq 0x8(%rax), %rcx
testq %rax, %rax
cmoveq %rax, %rcx
cmpq %r15, %rcx
jne 0x7733a
cmpq $0x5, (%rcx)
jne 0x7733a
movq %r14, %rdi
callq 0x78408
xorl %ebx, %ebx
jmp 0x7733a