// File: /workspace/github_c_makefile_star2_O3/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 -0x290(%rip), %rbx      # 0x7750f
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x77415
movq %rax, %rdi
callq 0x788a0
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x77415
movq %rax, %r14
movq %rax, %rdi
callq 0x7867f
movq %r14, %rdi
callq 0x788a0
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x77415
movq %rax, %r15
leaq 0x7a3f5(%rip), %r14     # 0xf1be1
leaq 0x79a84(%rip), %r12     # 0xf1277
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x77628
leaq 0x30(%rsp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0x77dfe
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x77821
cmpq %r12, 0x8(%rax)
je 0x77832
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x30(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x7784e
cmpq $0x0, 0x8(%rax)
jne 0x77821
movq %r15, %rdi
callq 0x788a0
leaq -0x34e(%rip), %rcx      # 0x7750f
movl %ebp, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x77415
movq %rax, %r15
leaq 0x79a05(%rip), %r12     # 0xf1277
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x77628
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x77628
leaq 0x30(%rsp), %rsi
movq %r14, (%rsi)
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x77821
cmpq %r12, 0x8(%rax)
jne 0x77821
leaq 0x30(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x77821
cmpq %r14, 0x8(%rax)
jne 0x77821
leaq 0x30(%rsp), %r13
movq %r14, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x78166
movq %r14, (%r13)
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x77909
cmpq $0x0, 0x8(%rax)
jne 0x77821
leaq 0x30(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x77821
cmpq %r14, 0x8(%rax)
jne 0x77821
movq %r15, %rdi
callq 0x788a0
cmpl $0x1, %ebp
jne 0x77ab8
leaq 0x799f5(%rip), %rsi     # 0xf1339
movl $0x10, %edi
movl $0x33, %edx
callq 0x35862
leaq -0x41c74(%rip), %rcx    # 0x35ce6
movq %rcx, (%rax)
movq %rcx, 0x8(%rax)
leaq 0x12fd(%rip), %rdx      # 0x78c65
leaq 0x30(%rsp), %r13
movq %rdx, (%r13)
leaq 0x238(%rip), %rdx       # 0x77bb0
movq %rdx, 0x8(%r13)
movq $0x10, 0x10(%r13)
leaq 0x132c(%rip), %rdx      # 0x78cb7
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 0x77ca4
movq %rax, %r15
movq %r14, %rdi
callq 0x728c0
movq %rax, %rbp
leaq 0x798a9(%rip), %r12     # 0xf1277
movq %r12, %rdi
callq 0x728c0
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x77628
movq %r12, %rdi
callq 0x728c0
movq %rax, %rbp
movq %r14, %rdi
callq 0x728c0
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x77628
movq %r14, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x77dfe
movq 0x8(%rax), %rdi
movq %r12, %rsi
callq 0xb890
testl %eax, %eax
jne 0x77821
leaq 0x30(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77dfe
movq 0x8(%rax), %rdi
leaq 0x7a19e(%rip), %r14     # 0xf1be1
movq %r14, %rsi
callq 0xb890
testl %eax, %eax
jne 0x77821
leaq 0x30(%rsp), %r13
movq %r14, (%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x78166
movq %r14, (%r13)
leaq 0x30(%rsp), %rsi
movq %r15, %rdi
callq 0x77dfe
testq %rax, %rax
je 0x77a88
cmpq $0x0, 0x8(%rax)
jne 0x77821
leaq 0x30(%rsp), %rsi
movq %r12, (%rsi)
movq %r15, %rdi
callq 0x77dfe
movq 0x8(%rax), %rdi
leaq 0x7a13e(%rip), %rsi     # 0xf1be1
callq 0xb890
testl %eax, %eax
jne 0x77821
movq %r15, %rdi
callq 0x788a0
movups 0xd9c89(%rip), %xmm0    # 0x151748
movups %xmm0, 0x20(%rsp)
movups 0xd9c6d(%rip), %xmm0    # 0x151738
movups %xmm0, 0x10(%rsp)
movups 0xd9c51(%rip), %xmm0    # 0x151728
movups %xmm0, (%rsp)
callq 0x77ca4
movq %rax, %r14
leaq 0x30(%rsp), %rsi
movq $0x1, (%rsi)
movq $0x3, 0x8(%rsi)
leaq 0x60(%rsp), %r15
movq %rax, %rdi
movq %r15, %rdx
callq 0x780fe
movq (%r15), %rcx
testl %eax, %eax
jne 0x77b16
movq $0x3, 0x8(%rcx)
cmpq $0x3, 0x8(%rcx)
jne 0x77821
leaq 0x30(%rsp), %rsi
movq $0x1, (%rsi)
movq $0x4, 0x8(%rsi)
leaq 0x60(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x780fe
movq (%r15), %r15
testl %eax, %eax
jne 0x77b54
movq $0x4, 0x8(%r15)
cmpq $0x4, 0x8(%r15)
jne 0x77821
addq $0x8, %r15
movq $0x5, (%r15)
leaq 0x30(%rsp), %rsi
movq $0x1, (%rsi)
movq %r14, %rdi
callq 0x77dfe
leaq 0x8(%rax), %rcx
testq %rax, %rax
cmoveq %rax, %rcx
cmpq %r15, %rcx
jne 0x77821
cmpq $0x5, (%rcx)
jne 0x77821
movq %r14, %rdi
callq 0x788a0
xorl %ebx, %ebx
jmp 0x77821