// File: /workspace/github_c_makefile_star2_O1/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 $0x68, %rsp
movq %rdi, %r15
leaq 0x22a4f7(%rip), %r14    # 0x397514
movl $0x13880, %edi          # imm = 0x13880
movq %r14, %rsi
movl $0xca, %edx
callq 0x1092b2
movq %rax, 0x8(%rsp)
movl $0x13880, %edi          # imm = 0x13880
movq %r14, %rsi
movl $0xcb, %edx
callq 0x1092b2
movq %rax, 0x18(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x50(%rsp)
movq $0x4c, 0x30(%rsp)
movq $0x84, 0x38(%rsp)
movq $0x88, 0x40(%rsp)
movq $0x21a, 0x48(%rsp)      # imm = 0x21A
movq $0x221, 0x50(%rsp)      # imm = 0x221
movq $0x191, 0x58(%rsp)      # imm = 0x191
testq %r15, %r15
je 0x16d0a8
movq %r15, %rdi
callq 0x101a9a
testb %al, %al
jne 0x16d4a2
leaq 0x402(%rip), %rdi       # 0x16d4b1
movl $0x2a, %esi
callq 0x16cd48
movq %rax, %r14
movq %rax, %rdi
callq 0x16cdae
movl %eax, %ebp
testb %al, %al
jne 0x16d0f6
leaq 0x1fa469(%rip), %rsi    # 0x36753a
leaq 0x22a56a(%rip), %rdx    # 0x397642
leaq 0x22a547(%rip), %rcx    # 0x397626
leaq 0x22a42e(%rip), %r8     # 0x397514
movq %r15, %rdi
movl $0xd1, %r9d
xorl %eax, %eax
callq 0x1019cf
movq %r14, %rdi
callq 0x16cfc9
leaq 0x3ac(%rip), %rdi       # 0x16d4b1
xorl %esi, %esi
callq 0x16cd48
movq %rax, %r14
testb %bpl, %bpl
je 0x16d452
movq %r14, %rdi
callq 0x16cdae
testb %al, %al
je 0x16d426
movq %r14, %rdi
callq 0x16cfc9
leaq 0x37a(%rip), %rdi       # 0x16d4b1
movl $0x6, %esi
callq 0x16cd48
movq %rax, %r14
xorl %ebx, %ebx
leaq (%rsp,%rbx), %rsi
addq $0x30, %rsi
movq %r14, %rdi
callq 0x16cdd9
addq $0x8, %rbx
cmpq $0x30, %rbx
jne 0x16d146
movq %r15, %rbp
movq %r14, %rdi
callq 0x16cdc2
testb %al, %al
je 0x16d4a7
movq $-0x1, %r15
movl $0x6, %ebx
movq %r14, %rdi
callq 0x16ceb2
cmpq $-0x1, %r15
je 0x16d196
cmpq (%rax), %r15
ja 0x16d49d
movq (%rax), %r15
decq %rbx
jne 0x16d17f
movq %r14, %rdi
callq 0x16cdae
testb %al, %al
je 0x16d4ac
movq %r14, %rdi
callq 0x16cfc9
xorl %eax, %eax
movq %rbp, 0x20(%rsp)
movq %rax, 0x28(%rsp)
movl $0x2710, %edi           # imm = 0x2710
callq 0x10ae3c
movq %rax, %r13
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x10ae3c
movq %rax, %r12
leaq 0x2ce(%rip), %rdi       # 0x16d4b1
movq %r13, %rsi
callq 0x16cd48
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x16cdae
testb %al, %al
jne 0x16d22e
movq %rbp, %rdi
leaq 0x1fa334(%rip), %rsi    # 0x36753a
leaq 0x22a3b7(%rip), %rdx    # 0x3975c4
movl %eax, %r14d
leaq 0x22a40f(%rip), %rcx    # 0x397626
leaq 0x22a2f6(%rip), %r8     # 0x397514
movl $0xe1, %r9d
xorl %eax, %eax
callq 0x1019cf
movl %r14d, %eax
testq %r13, %r13
setne %cl
andb %al, %cl
cmpb $0x1, %cl
movq 0x10(%rsp), %r14
jne 0x16d283
incq %r12
movl $0x1, %ebx
movq 0x18(%rsp), %r15
movq %r12, %rdi
movl %eax, %ebp
callq 0x10ae3c
movq 0x8(%rsp), %rcx
movq %rax, -0x8(%rcx,%rbx,8)
movq %rax, (%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x16cdd9
movl %ebp, %eax
cmpq %r13, %rbx
setb %cl
incq %rbx
addq $0x8, %r15
testb %cl, %bpl
jne 0x16d24d
testb %al, %al
je 0x16d2d9
movq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x16cdc2
movb $0x1, %r14b
testb %al, %al
movq 0x8(%rsp), %r15
movq 0x20(%rsp), %rbp
movq %r13, %rbx
jne 0x16d2ee
xorl %r14d, %r14d
movq %rbp, %rdi
leaq 0x1fa285(%rip), %rsi    # 0x36753a
leaq 0x22a2c5(%rip), %rdx    # 0x397581
leaq 0x22a363(%rip), %rcx    # 0x397626
leaq 0x22a24a(%rip), %r8     # 0x397514
movl $0xe8, %r9d
xorl %eax, %eax
callq 0x1019cf
jmp 0x16d2ee
xorl %r14d, %r14d
movq 0x8(%rsp), %r15
movq 0x20(%rsp), %rbp
movq %r13, %rbx
movq 0x10(%rsp), %r12
movl $0x8, %edx
movq %r15, %rdi
movq %rbx, %rsi
leaq 0x1b1(%rip), %rcx       # 0x16d4b1
callq 0x17f60
testq %rbx, %rbx
setne %al
andb %r14b, %al
cmpb $0x1, %al
jne 0x16d3b4
movl $0x1, %r15d
movq %r12, %rdi
callq 0x16cf9b
movq (%rax), %rbx
movq %r12, %rdi
callq 0x16ceb2
movq (%rax), %rax
cmpq %rbx, %rax
jne 0x16d370
movb $0x1, %r14b
movq 0x8(%rsp), %rcx
cmpq -0x8(%rcx,%r15,8), %rax
je 0x16d39f
xorl %r14d, %r14d
movq %rbp, %rdi
leaq 0x1fa1e7(%rip), %rsi    # 0x36753a
leaq 0x22a319(%rip), %rdx    # 0x397673
leaq 0x22a2c5(%rip), %rcx    # 0x397626
leaq 0x22a1ac(%rip), %r8     # 0x397514
movl $0xf1, %r9d
jmp 0x16d398
xorl %r14d, %r14d
movq %rbp, %rdi
leaq 0x1fa1bd(%rip), %rsi    # 0x36753a
leaq 0x22a2de(%rip), %rdx    # 0x397662
leaq 0x22a29b(%rip), %rcx    # 0x397626
leaq 0x22a182(%rip), %r8     # 0x397514
movl $0xf0, %r9d
xorl %eax, %eax
callq 0x1019cf
testb %r14b, %r14b
je 0x16d3b4
leaq 0x1(%r15), %rax
cmpq %r13, %r15
movq %rax, %r15
jb 0x16d31c
xorl %r15d, %r15d
testb %r14b, %r14b
je 0x16d3fa
movq %r12, %rdi
callq 0x16cdae
movb $0x1, %bl
testb %al, %al
jne 0x16d402
xorl %ebx, %ebx
movq %rbp, %rdi
leaq 0x1fa164(%rip), %rsi    # 0x36753a
leaq 0x22a1e7(%rip), %rdx    # 0x3975c4
leaq 0x22a242(%rip), %rcx    # 0x397626
leaq 0x22a129(%rip), %r8     # 0x397514
movl $0xf3, %r9d
xorl %eax, %eax
callq 0x1019cf
jmp 0x16d3fc
xorl %ebx, %ebx
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
movq %r12, %rdi
callq 0x16cfc9
testb %bl, %bl
je 0x16d460
movq 0x28(%rsp), %rcx
leaq 0x1(%rcx), %rax
cmpq $0x3e7, %rcx            # imm = 0x3E7
jb 0x16d1bd
jmp 0x16d460
leaq 0x1fa10d(%rip), %rsi    # 0x36753a
leaq 0x22a20e(%rip), %rdx    # 0x397642
leaq 0x22a1eb(%rip), %rcx    # 0x397626
leaq 0x22a0d2(%rip), %r8     # 0x397514
movq %r15, %rdi
movl $0xd5, %r9d
xorl %eax, %eax
callq 0x1019cf
movq %r14, %rdi
callq 0x16cfc9
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
leaq 0x22a0ad(%rip), %r14    # 0x397514
movq 0x8(%rsp), %rdi
movq %r14, %rsi
movl $0xf7, %edx
callq 0x109670
movq 0x18(%rsp), %rdi
movq %r14, %rsi
movl $0xf8, %edx
callq 0x109670
movl %r15d, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4fa63
callq 0x4f9f1
callq 0x4fa2a
callq 0x4fa9c