// File: /workspace/github_c_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
leaq 0x228dc8(%rip), %r14    # 0x32e524
movl $0x13880, %edi          # imm = 0x13880
movq %r14, %rsi
movl $0xca, %edx
callq 0x93160
movq %rax, 0x8(%rsp)
movl $0x13880, %edi          # imm = 0x13880
movq %r14, %rsi
movl $0xcb, %edx
callq 0x93160
movq %rax, 0x10(%rsp)
movq $0x4c, 0x20(%rsp)
movq $0x84, 0x28(%rsp)
movq $0x88, 0x30(%rsp)
movq $0x21a, 0x38(%rsp)      # imm = 0x21A
movq $0x221, 0x40(%rsp)      # imm = 0x221
movq $0x191, 0x48(%rsp)      # imm = 0x191
testq %rbx, %rbx
je 0x1057d5
movq %rbx, %rdi
callq 0x89eb7
testb %al, %al
jne 0x105b86
leaq 0x43d(%rip), %rdi       # 0x105c19
pushq $0x2a
popq %rsi
callq 0x10537c
movq %rax, %r14
movq %rax, %rdi
callq 0x1053da
movl %eax, %ebp
testb %al, %al
jne 0x105821
leaq 0x1f8bf6(%rip), %rsi    # 0x2fe3f2
leaq 0x228e4f(%rip), %rdx    # 0x32e652
leaq 0x228e2c(%rip), %rcx    # 0x32e636
leaq 0x228d13(%rip), %r8     # 0x32e524
movq %rbx, %rdi
movl $0xd1, %r9d
xorl %eax, %eax
callq 0x89dbb
movq %r14, %rdi
callq 0x105708
leaq 0x3e9(%rip), %rdi       # 0x105c19
xorl %esi, %esi
callq 0x10537c
movq %rax, %r14
testb %bpl, %bpl
je 0x1058b4
movq %r14, %rdi
callq 0x1053da
testb %al, %al
je 0x105888
movq %r14, %rdi
callq 0x105708
leaq 0x3bf(%rip), %rdi       # 0x105c19
pushq $0x6
popq %rsi
callq 0x10537c
movq %rax, %r14
xorl %r15d, %r15d
cmpq $0x30, %r15
je 0x1058fd
leaq (%rsp,%r15), %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x105467
addq $0x8, %r15
jmp 0x105868
leaq 0x1f8b63(%rip), %rsi    # 0x2fe3f2
leaq 0x228dbc(%rip), %rdx    # 0x32e652
leaq 0x228d99(%rip), %rcx    # 0x32e636
leaq 0x228c80(%rip), %r8     # 0x32e524
movq %rbx, %rdi
movl $0xd5, %r9d
xorl %eax, %eax
callq 0x89dbb
movq %r14, %rdi
callq 0x105708
pushq $-0x1
popq %r13
leaq 0x228c5d(%rip), %r14    # 0x32e524
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0xf7, %edx
callq 0x936f9
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movl $0xf8, %edx
callq 0x936f9
movl %r13d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x10541f
testb %al, %al
je 0x105bb7
pushq $-0x1
popq %r15
pushq $0x7
popq %r12
movq %r14, %rdi
decq %r12
je 0x105974
callq 0x105585
cmpq $-0x1, %r15
setne %cl
movq (%rax), %rax
cmpq %rax, %r15
seta %dl
andb %cl, %dl
movq %rax, %r15
cmpb $0x1, %dl
jne 0x105915
movq 0x332625(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1df6c6(%rip), %rsi    # 0x2e5013
leaq 0x228d8b(%rip), %rdx    # 0x32e6df
leaq 0x228d73(%rip), %rcx    # 0x32e6ce
leaq 0x228bc2(%rip), %r8     # 0x32e524
movl $0xbc, %r9d
xorl %eax, %eax
callq 0x17a50
callq 0x17390
callq 0x1053da
testb %al, %al
je 0x105be8
movq %r14, %rdi
callq 0x105708
xorl %eax, %eax
xorl %r13d, %r13d
testl %r13d, %r13d
jne 0x1058c0
cmpq $0x3e7, %rax            # imm = 0x3E7
ja 0x1058c0
movq %rax, 0x18(%rsp)
movl $0x2710, %edi           # imm = 0x2710
callq 0x955fa
movq %rax, %r13
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x955fa
movq %rax, %rbp
leaq 0x250(%rip), %rdi       # 0x105c19
movq %r13, %rsi
callq 0x10537c
movq %rax, %r12
movq %rax, %rdi
callq 0x1053da
testb %al, %al
je 0x105a18
incq %rbp
movq 0x10(%rsp), %r14
xorl %r15d, %r15d
cmpq %r15, %r13
je 0x105a3f
movq %rbp, %rdi
callq 0x955fa
movq 0x8(%rsp), %rcx
movq %rax, (%rcx,%r15,8)
movq %rax, (%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0x105467
incq %r15
addq $0x8, %r14
jmp 0x1059eb
movq %rbx, %rdi
leaq 0x1f89d0(%rip), %rsi    # 0x2fe3f2
leaq 0x228bab(%rip), %rdx    # 0x32e5d4
leaq 0x228c06(%rip), %rcx    # 0x32e636
leaq 0x228aed(%rip), %r8     # 0x32e524
movl $0xe1, %r9d
jmp 0x105a72
movq %r12, %rdi
callq 0x10541f
xorl %ebp, %ebp
testb %al, %al
jne 0x105a7c
movq %rbx, %rdi
leaq 0x1f899b(%rip), %rsi    # 0x2fe3f2
leaq 0x228b33(%rip), %rdx    # 0x32e591
leaq 0x228bd1(%rip), %rcx    # 0x32e636
leaq 0x228ab8(%rip), %r8     # 0x32e524
movl $0xe8, %r9d
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
movq 0x8(%rsp), %rdi
movq %r13, %rsi
pushq $0x8
popq %rdx
leaq 0x18b(%rip), %rcx       # 0x105c19
callq 0x17ed0
xorl %r14d, %r14d
testl %ebp, %ebp
jne 0x105b2a
cmpq %r13, %r14
jae 0x105b2a
movq %r12, %rdi
callq 0x1056a9
movq (%rax), %r15
movq %r12, %rdi
callq 0x105585
cmpq %r15, (%rax)
jne 0x105af3
xorl %ebp, %ebp
movq 0x8(%rsp), %rax
cmpq (%rax,%r14,8), %r15
je 0x105b22
movq %rbx, %rdi
leaq 0x1f891c(%rip), %rsi    # 0x2fe3f2
leaq 0x228ba6(%rip), %rdx    # 0x32e683
leaq 0x228b52(%rip), %rcx    # 0x32e636
leaq 0x228a39(%rip), %r8     # 0x32e524
movl $0xf1, %r9d
jmp 0x105b18
movq %rbx, %rdi
leaq 0x1f88f5(%rip), %rsi    # 0x2fe3f2
leaq 0x228b6e(%rip), %rdx    # 0x32e672
leaq 0x228b2b(%rip), %rcx    # 0x32e636
leaq 0x228a12(%rip), %r8     # 0x32e524
movl $0xf0, %r9d
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %rbp
incq %r14
jmp 0x105a96
pushq $-0x1
popq %r13
testl %ebp, %ebp
jne 0x105b71
movq %r12, %rdi
callq 0x1053da
xorl %r13d, %r13d
testb %al, %al
jne 0x105b71
movq %rbx, %rdi
leaq 0x1f88a7(%rip), %rsi    # 0x2fe3f2
leaq 0x228a82(%rip), %rdx    # 0x32e5d4
leaq 0x228add(%rip), %rcx    # 0x32e636
leaq 0x2289c4(%rip), %r8     # 0x32e524
movl $0xf3, %r9d
xorl %eax, %eax
callq 0x89dbb
pushq $-0x1
popq %r13
movq %r12, %rdi
callq 0x105708
movq 0x18(%rsp), %rax
incq %rax
jmp 0x10598e
movq 0x3323db(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1df47c(%rip), %rsi    # 0x2e5013
leaq 0x1df621(%rip), %rdx    # 0x2e51bf
leaq 0x228a91(%rip), %rcx    # 0x32e636
leaq 0x228978(%rip), %r8     # 0x32e524
movl $0xce, %r9d
jmp 0x105968
movq 0x3323aa(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1df44b(%rip), %rsi    # 0x2e5013
leaq 0x2289c2(%rip), %rdx    # 0x32e591
leaq 0x228af8(%rip), %rcx    # 0x32e6ce
leaq 0x228947(%rip), %r8     # 0x32e524
movl $0xb5, %r9d
jmp 0x105968
movq 0x332379(%rip), %rax    # 0x437f68
movq (%rax), %rdi
leaq 0x1df41a(%rip), %rsi    # 0x2e5013
leaq 0x2289d4(%rip), %rdx    # 0x32e5d4
leaq 0x228ac7(%rip), %rcx    # 0x32e6ce
leaq 0x228916(%rip), %r8     # 0x32e524
movl $0xc0, %r9d
jmp 0x105968