// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/priority_queue.c
// Function: gt_priority_queue_unit_test
int gt_priority_queue_unit_test(GtError *err)
{
  int had_err = 0;
  GtUword idx,
          maxsize = 10000UL,
          trials = 1000UL,
          *numbers = gt_malloc(sizeof *numbers * maxsize),
          *numbers_copy = gt_malloc(sizeof *numbers_copy * maxsize);
  GtUword arr[] = {76UL, 132UL, 136UL, 538UL, 545UL, 401UL};
  GtPriorityQueue *tmp = NULL;
  gt_error_check(err);

  tmp = gt_priority_queue_new(gt_priority_queue_cmpulong, 42);
  gt_ensure(gt_priority_queue_is_empty(tmp));
  gt_priority_queue_delete(tmp);

  tmp = gt_priority_queue_new(gt_priority_queue_cmpulong, 0);
  gt_ensure(gt_priority_queue_is_empty(tmp));
  gt_priority_queue_delete(tmp);

  if (!had_err) {
    gt_priority_sort(arr, (GtUword) sizeof arr/sizeof arr[0]);
    for (idx = 0; !had_err && idx < trials; idx++)
    {
      GtUword j,
              size = gt_rand_max(maxsize),
              maximal_value = 1 + gt_rand_max(1000UL);
      GtPriorityQueue *pq = gt_priority_queue_new(gt_priority_queue_cmpulong,
                                                  size);
      gt_ensure(gt_priority_queue_is_empty(pq));

      for (j = 0; !had_err && j < size; j++)
      {
        numbers_copy[j] = numbers[j] = gt_rand_max(maximal_value);
        gt_priority_queue_add(pq, numbers_copy + j);
      }
      gt_ensure(gt_priority_queue_is_full(pq));
      qsort(numbers,(size_t) size, sizeof *numbers, gt_priority_queue_cmpulong);

      for (j = 0; !had_err && j < size; j++)
      {
        GtUword this_min, elem;
        this_min = *((GtUword*) gt_priority_queue_find_min(pq));
        elem = *((GtUword *) gt_priority_queue_extract_min(pq));
        gt_ensure(elem == this_min);
        gt_ensure(elem == numbers[j]);
      }
      gt_ensure(gt_priority_queue_is_empty(pq));
      gt_priority_queue_delete(pq);
    }
  }
  gt_free(numbers);
  gt_free(numbers_copy);

  return had_err;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0xa0(%rsp)
movl $0x0, 0x9c(%rsp)
movq $0x2710, 0x88(%rsp) # imm = 0x2710
movq $0x3e8, 0x80(%rsp) # imm = 0x3E8
movq 0x88(%rsp), %rdi
shlq $0x3, %rdi
leaq 0x3aa22f(%rip), %rsi    # 0x560974
movl $0xca, %edx
callq 0xe80f0
movq %rax, 0x78(%rsp)
movq 0x88(%rsp), %rdi
shlq $0x3, %rdi
leaq 0x3aa20d(%rip), %rsi    # 0x560974
movl $0xcb, %edx
callq 0xe80f0
movq %rax, 0x70(%rsp)
leaq 0x40(%rsp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x19360
movq $0x4c, 0x40(%rsp)
movq $0x84, 0x48(%rsp)
movq $0x88, 0x50(%rsp)
movq $0x21a, 0x58(%rsp)      # imm = 0x21A
movq $0x221, 0x60(%rsp)      # imm = 0x221
movq $0x191, 0x68(%rsp)      # imm = 0x191
movq $0x0, 0x38(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x1b681c
movq 0xa0(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1b67e4
jmp 0x1b681c
movq 0x4857b5(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x35f81e(%rip), %rsi    # 0x516013
leaq 0x35f9c3(%rip), %rdx    # 0x5161bf
leaq 0x3aa299(%rip), %rcx    # 0x560a9c
leaq 0x3aa16a(%rip), %r8     # 0x560974
movl $0xce, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b681e
leaq 0x4bb(%rip), %rdi       # 0x1b6ce0
movl $0x2a, %esi
callq 0x1b5fb0
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x9c(%rsp)
jne 0x1b688a
movq 0x38(%rsp), %rdi
callq 0x1b6040
testb $0x1, %al
jne 0x1b6888
movq 0xa0(%rsp), %rdi
leaq 0x378d9f(%rip), %rsi    # 0x52f5fa
leaq 0x3aa256(%rip), %rdx    # 0x560ab8
leaq 0x3aa233(%rip), %rcx    # 0x560a9c
leaq 0x3aa104(%rip), %r8     # 0x560974
movl $0xd1, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b688a
jmp 0x1b688c
movq 0x38(%rsp), %rdi
callq 0x1b66c0
leaq 0x443(%rip), %rdi       # 0x1b6ce0
xorl %eax, %eax
movl %eax, %esi
callq 0x1b5fb0
movq %rax, 0x38(%rsp)
cmpl $0x0, 0x9c(%rsp)
jne 0x1b6901
movq 0x38(%rsp), %rdi
callq 0x1b6040
testb $0x1, %al
jne 0x1b68ff
movq 0xa0(%rsp), %rdi
leaq 0x378d28(%rip), %rsi    # 0x52f5fa
leaq 0x3aa1df(%rip), %rdx    # 0x560ab8
leaq 0x3aa1bc(%rip), %rcx    # 0x560a9c
leaq 0x3aa08d(%rip), %r8     # 0x560974
movl $0xd5, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b6901
jmp 0x1b6903
movq 0x38(%rsp), %rdi
callq 0x1b66c0
cmpl $0x0, 0x9c(%rsp)
jne 0x1b6ca0
leaq 0x40(%rsp), %rdi
movl $0x6, %esi
callq 0x1b6d90
movq $0x0, 0x90(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x9c(%rsp)
movb %al, 0x7(%rsp)
jne 0x1b695d
movq 0x90(%rsp), %rax
cmpq 0x80(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x1b696a
jmp 0x1b6c9e
movq 0x88(%rsp), %rdi
callq 0xec350
movq %rax, 0x28(%rsp)
movl $0x3e8, %edi            # imm = 0x3E8
callq 0xec350
addq $0x1, %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rsi
leaq 0x345(%rip), %rdi       # 0x1b6ce0
callq 0x1b5fb0
movq %rax, 0x18(%rsp)
cmpl $0x0, 0x9c(%rsp)
jne 0x1b69fb
movq 0x18(%rsp), %rdi
callq 0x1b6040
testb $0x1, %al
jne 0x1b69f9
movq 0xa0(%rsp), %rdi
leaq 0x378c2e(%rip), %rsi    # 0x52f5fa
leaq 0x3aa051(%rip), %rdx    # 0x560a24
leaq 0x3aa0c2(%rip), %rcx    # 0x560a9c
leaq 0x3a9f93(%rip), %r8     # 0x560974
movl $0xe1, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b69fb
jmp 0x1b69fd
movq $0x0, 0x30(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x9c(%rsp)
movb %al, 0x6(%rsp)
jne 0x1b6a27
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
setb %al
movb %al, 0x6(%rsp)
movb 0x6(%rsp), %al
testb $0x1, %al
jne 0x1b6a31
jmp 0x1b6a85
movq 0x20(%rsp), %rdi
callq 0xec350
movq %rax, %rdx
movq 0x78(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x70(%rsp), %rax
movq 0x30(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x18(%rsp), %rdi
movq 0x70(%rsp), %rsi
movq 0x30(%rsp), %rax
shlq $0x3, %rax
addq %rax, %rsi
callq 0x1b6120
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x1b6a06
jmp 0x1b6a87
cmpl $0x0, 0x9c(%rsp)
jne 0x1b6add
movq 0x18(%rsp), %rdi
callq 0x1b60b0
testb $0x1, %al
jne 0x1b6adb
movq 0xa0(%rsp), %rdi
leaq 0x378b4c(%rip), %rsi    # 0x52f5fa
leaq 0x3a9f2c(%rip), %rdx    # 0x5609e1
leaq 0x3a9fe0(%rip), %rcx    # 0x560a9c
leaq 0x3a9eb1(%rip), %r8     # 0x560974
movl $0xe8, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b6add
jmp 0x1b6adf
movq 0x78(%rsp), %rdi
movq 0x28(%rsp), %rsi
movl $0x8, %edx
leaq 0x1eb(%rip), %rcx       # 0x1b6ce0
callq 0x19e70
movq $0x0, 0x30(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x9c(%rsp)
movb %al, 0x5(%rsp)
jne 0x1b6b24
movq 0x30(%rsp), %rax
cmpq 0x28(%rsp), %rax
setb %al
movb %al, 0x5(%rsp)
movb 0x5(%rsp), %al
testb $0x1, %al
jne 0x1b6b31
jmp 0x1b6c21
movq 0x18(%rsp), %rdi
callq 0x1b6610
movq (%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rdi
callq 0x1b6360
movq (%rax), %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x9c(%rsp)
jne 0x1b6ba9
movq 0x8(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x1b6ba7
movq 0xa0(%rsp), %rdi
leaq 0x378a80(%rip), %rsi    # 0x52f5fa
leaq 0x3a9f57(%rip), %rdx    # 0x560ad8
leaq 0x3a9f14(%rip), %rcx    # 0x560a9c
leaq 0x3a9de5(%rip), %r8     # 0x560974
movl $0xf0, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b6ba9
jmp 0x1b6bab
jmp 0x1b6bad
cmpl $0x0, 0x9c(%rsp)
jne 0x1b6c0a
movq 0x8(%rsp), %rax
movq 0x78(%rsp), %rcx
movq 0x30(%rsp), %rdx
cmpq (%rcx,%rdx,8), %rax
je 0x1b6c08
movq 0xa0(%rsp), %rdi
leaq 0x378a1f(%rip), %rsi    # 0x52f5fa
leaq 0x3a9f07(%rip), %rdx    # 0x560ae9
leaq 0x3a9eb3(%rip), %rcx    # 0x560a9c
leaq 0x3a9d84(%rip), %r8     # 0x560974
movl $0xf1, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b6c0a
jmp 0x1b6c0c
jmp 0x1b6c0e
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x1b6b03
jmp 0x1b6c23
cmpl $0x0, 0x9c(%rsp)
jne 0x1b6c79
movq 0x18(%rsp), %rdi
callq 0x1b6040
testb $0x1, %al
jne 0x1b6c77
movq 0xa0(%rsp), %rdi
leaq 0x3789b0(%rip), %rsi    # 0x52f5fa
leaq 0x3a9dd3(%rip), %rdx    # 0x560a24
leaq 0x3a9e44(%rip), %rcx    # 0x560a9c
leaq 0x3a9d15(%rip), %r8     # 0x560974
movl $0xf3, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x9c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b6c79
jmp 0x1b6c7b
movq 0x18(%rsp), %rdi
callq 0x1b66c0
movq 0x90(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x90(%rsp)
jmp 0x1b6936
jmp 0x1b6ca0
movq 0x78(%rsp), %rdi
leaq 0x3a9cc8(%rip), %rsi    # 0x560974
movl $0xf7, %edx
callq 0xe88c0
movq 0x70(%rsp), %rdi
leaq 0x3a9cb2(%rip), %rsi    # 0x560974
movl $0xf8, %edx
callq 0xe88c0
movl 0x9c(%rsp), %eax
addq $0xa8, %rsp
retq
nopl (%rax,%rax)