// File: /workspace/github_c_makefile_star2_O3/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, %r15
leaq 0x22902f(%rip), %r14    # 0x38e134
movl $0x13880, %edi          # imm = 0x13880
movq %r14, %rsi
movl $0xca, %edx
callq 0x104226
movq %rax, %r12
movl $0x13880, %edi          # imm = 0x13880
movq %r14, %rsi
movl $0xcb, %edx
callq 0x104226
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 %r15, %r15
je 0x16517c
movq %r15, %rdi
callq 0xfcc32
testb %al, %al
jne 0x165561
leaq 0x3ed(%rip), %rdi       # 0x165570
movl $0x2a, %esi
callq 0x164e18
movq %rax, %r14
movq %rax, %rdi
callq 0x164e7e
movl %eax, %ebp
testb %al, %al
jne 0x1651ca
leaq 0x1f9299(%rip), %rsi    # 0x35e43e
leaq 0x2290b6(%rip), %rdx    # 0x38e262
leaq 0x229093(%rip), %rcx    # 0x38e246
leaq 0x228f7a(%rip), %r8     # 0x38e134
movq %r15, %rdi
movl $0xd1, %r9d
xorl %eax, %eax
callq 0xfcb67
movq %r14, %rdi
callq 0x1650b1
leaq 0x397(%rip), %rdi       # 0x165570
xorl %esi, %esi
callq 0x164e18
movq %rax, %r14
testb %bpl, %bpl
je 0x165515
movq %r14, %rdi
callq 0x164e7e
testb %al, %al
je 0x1654e9
movq %r14, %rdi
callq 0x1650b1
leaq 0x365(%rip), %rdi       # 0x165570
movl $0x6, %esi
callq 0x164e18
movq %rax, %r14
xorl %ebx, %ebx
leaq (%rsp,%rbx), %rsi
addq $0x20, %rsi
movq %r14, %rdi
callq 0x164ea9
addq $0x8, %rbx
cmpq $0x30, %rbx
jne 0x16521a
movq %r15, 0x8(%rsp)
movq %r14, %rdi
callq 0x164e92
testb %al, %al
je 0x165566
movq $-0x1, %rbx
movl $0x6, %r15d
movq %r14, %rdi
callq 0x164f95
cmpq $-0x1, %rbx
setne %cl
movq (%rax), %rax
cmpq %rax, %rbx
seta %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x16555c
movq %rax, %rbx
decq %r15
jne 0x165256
movq %r14, %rdi
callq 0x164e7e
testb %al, %al
movq 0x8(%rsp), %r15
je 0x16556b
movq %r14, %rdi
callq 0x1650b1
leaq 0x2cb(%rip), %rbx       # 0x165570
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movl $0x2710, %edi           # imm = 0x2710
callq 0x105d85
movq %rax, %rbp
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x105d85
movq %rax, %r14
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x164e18
movq %rax, %r13
movq %rax, %rdi
callq 0x164e7e
testb %al, %al
je 0x165343
testq %rbp, %rbp
setne %cl
je 0x16536d
movb %al, 0x3(%rsp)
movl %ecx, 0x4(%rsp)
incq %r14
movq %r12, %r15
movq 0x10(%rsp), %r12
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x105d85
movq %rax, (%r15,%rbx,8)
movq %rax, (%r12)
movq %r13, %rdi
movq %r12, %rsi
callq 0x164ea9
incq %rbx
addq $0x8, %r12
cmpq %rbp, %rbx
jb 0x165301
cmpb $0x0, 0x3(%rsp)
movq %r15, %r12
movq 0x8(%rsp), %r15
leaq 0x234(%rip), %rbx       # 0x165570
jne 0x165375
jmp 0x16540e
movq %r15, %rdi
leaq 0x1f90f1(%rip), %rsi    # 0x35e43e
leaq 0x228e90(%rip), %rdx    # 0x38e1e4
leaq 0x228eeb(%rip), %rcx    # 0x38e246
leaq 0x228dd2(%rip), %r8     # 0x38e134
movl $0xe1, %r9d
jmp 0x165407
movl $0x0, 0x4(%rsp)
movq %r13, %rdi
callq 0x164e92
testb %al, %al
je 0x1653e2
movl $0x8, %edx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rcx
callq 0x17f60
cmpb $0x0, 0x4(%rsp)
je 0x1653cc
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x165083
movq (%rax), %rbx
movq %r13, %rdi
callq 0x164f95
cmpq %rbx, (%rax)
jne 0x16547f
cmpq (%r12,%r14,8), %rbx
jne 0x1654a9
incq %r14
cmpq %rbp, %r14
jb 0x16539e
movq %r13, %rdi
callq 0x164e7e
testb %al, %al
je 0x165455
xorl %ebp, %ebp
movb $0x1, %r14b
jmp 0x1654dd
movq %r15, %rdi
leaq 0x1f9052(%rip), %rsi    # 0x35e43e
leaq 0x228dae(%rip), %rdx    # 0x38e1a1
leaq 0x228e4c(%rip), %rcx    # 0x38e246
leaq 0x228d33(%rip), %r8     # 0x38e134
movl $0xe8, %r9d
xorl %eax, %eax
callq 0xfcb67
movl $0x8, %edx
movq %r12, %rdi
movq %rbp, %rsi
movq %rbx, %rcx
callq 0x17f60
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
movq %r13, %rdi
callq 0x1650b1
testb %r14b, %r14b
je 0x165522
movq 0x18(%rsp), %rcx
leaq 0x1(%rcx), %rax
cmpq $0x3e7, %rcx            # imm = 0x3E7
jb 0x1652a7
jmp 0x165522
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x1f8fdc(%rip), %rsi    # 0x35e43e
leaq 0x228d7b(%rip), %rdx    # 0x38e1e4
leaq 0x228dd6(%rip), %rcx    # 0x38e246
leaq 0x228cbd(%rip), %r8     # 0x38e134
movl $0xf3, %r9d
jmp 0x1654d1
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x1f8fb2(%rip), %rsi    # 0x35e43e
leaq 0x228def(%rip), %rdx    # 0x38e282
leaq 0x228dac(%rip), %rcx    # 0x38e246
leaq 0x228c93(%rip), %r8     # 0x38e134
movl $0xf0, %r9d
jmp 0x1654d1
xorl %r14d, %r14d
movq %r15, %rdi
leaq 0x1f8f88(%rip), %rsi    # 0x35e43e
leaq 0x228dd6(%rip), %rdx    # 0x38e293
leaq 0x228d82(%rip), %rcx    # 0x38e246
leaq 0x228c69(%rip), %r8     # 0x38e134
movl $0xf1, %r9d
xorl %eax, %eax
callq 0xfcb67
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x8c(%rip), %rbx        # 0x165570
jmp 0x165429
leaq 0x1f8f4e(%rip), %rsi    # 0x35e43e
leaq 0x228d6b(%rip), %rdx    # 0x38e262
leaq 0x228d48(%rip), %rcx    # 0x38e246
leaq 0x228c2f(%rip), %r8     # 0x38e134
movq %r15, %rdi
movl $0xd5, %r9d
xorl %eax, %eax
callq 0xfcb67
movq %r14, %rdi
callq 0x1650b1
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
leaq 0x228c0b(%rip), %r14    # 0x38e134
movq %r12, %rdi
movq %r14, %rsi
movl $0xf7, %edx
callq 0x1045eb
movq 0x10(%rsp), %rdi
movq %r14, %rsi
movl $0xf8, %edx
callq 0x1045eb
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4eba7
callq 0x4eafc
callq 0x4eb35
callq 0x4eb6e