// File: /workspace/github_c_makefile_star2_O0/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:
subq $0x88, %rsp
movl %edi, 0x84(%rsp)
leaq 0xe8ea4(%rip), %rax     # 0x16f719
movq %rax, 0x78(%rsp)
leaq 0xe7f3d(%rip), %rax     # 0x16e7be
movq %rax, 0x70(%rsp)
movq $0x1, 0x68(%rsp)
movq $0x2, 0x60(%rsp)
movq $0x3, 0x58(%rsp)
movq $0x4, 0x50(%rsp)
movq $0x0, 0x48(%rsp)
movq $0x0, 0x40(%rsp)
movl $0x0, 0x2c(%rsp)
movl 0x84(%rsp), %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x86190
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x86cc0
movl 0x84(%rsp), %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x86190
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
callq 0x867b0
movq 0x38(%rsp), %rdi
callq 0x86cc0
movl 0x84(%rsp), %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x86190
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x86510
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86470
cmpq 0x70(%rsp), %rax
je 0x86961
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x86470
cmpq $0x0, %rax
je 0x86983
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
callq 0x86cc0
movl 0x84(%rsp), %edi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, %rsi
callq 0x86190
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x70(%rsp), %rdx
callq 0x86510
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
callq 0x86510
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86470
cmpq 0x70(%rsp), %rax
je 0x869f0
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x86470
cmpq 0x78(%rsp), %rax
je 0x86a13
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86580
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86470
cmpq $0x0, %rax
je 0x86a44
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x86470
cmpq 0x78(%rsp), %rax
je 0x86a67
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
callq 0x86cc0
cmpl $0x1, 0x84(%rsp)
jne 0x86bc9
movl 0x84(%rsp), %edi
leaq -0x78e6d(%rip), %rdx    # 0xdc20
movq %rdx, %rsi
callq 0x86190
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x78(%rsp), %rdi
callq 0x7c400
movq %rax, 0x10(%rsp)
movq 0x70(%rsp), %rdi
callq 0x7c400
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rdx
callq 0x86510
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x70(%rsp), %rdi
callq 0x7c400
movq %rax, 0x20(%rsp)
movq 0x78(%rsp), %rdi
callq 0x7c400
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
movq %rax, %rdx
callq 0x86510
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86470
movq %rax, %rdi
movq 0x70(%rsp), %rsi
callq 0xb850
cmpl $0x0, %eax
je 0x86b32
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x86470
movq %rax, %rdi
movq 0x78(%rsp), %rsi
callq 0xb850
cmpl $0x0, %eax
je 0x86b60
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86580
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x86470
cmpq $0x0, %rax
je 0x86b91
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
movq 0x70(%rsp), %rsi
callq 0x86470
movq %rax, %rdi
movq 0x78(%rsp), %rsi
callq 0xb850
cmpl $0x0, %eax
je 0x86bbf
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x38(%rsp), %rdi
callq 0x86cc0
callq 0x86d70
movq %rax, 0x30(%rsp)
cmpq $0x0, 0x48(%rsp)
je 0x86be8
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x30(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x58(%rsp), %rdx
callq 0x86db0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
cmpq 0x58(%rsp), %rax
je 0x86c1d
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x30(%rsp), %rdi
movq 0x68(%rsp), %rsi
movq 0x50(%rsp), %rdx
callq 0x86db0
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq (%rax), %rax
cmpq 0x50(%rsp), %rax
je 0x86c4f
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x48(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq 0x30(%rsp), %rdi
movq 0x68(%rsp), %rsi
callq 0x86e10
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x48(%rsp), %rax
je 0x86c88
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq 0x50(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x86ca8
movl $0xffffffff, 0x2c(%rsp) # imm = 0xFFFFFFFF
jmp 0x86cb2
movq 0x30(%rsp), %rdi
callq 0x888b0
movl 0x2c(%rsp), %eax
addq $0x88, %rsp
retq
nop