// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/extended/ranked_list.c
// Function: gt_ranked_list_unit_test
int gt_ranked_list_unit_test(GtError *err)
{
  int had_err = 0;
  GtRankedList *rl;
  GtRankedListIter *iter;
  GtArray *arr;
  const GtUword nof_best = 30UL, nof_tests = 100UL;
  GtRankedListTestStruct *mystr;
  int values[8] = {-3, 4, 1, 545, 24, 33, 22, 42},
      i, j;
  gt_error_check(err);

  rl = gt_ranked_list_new(5UL, gt_ranked_list_cmp_numbers, NULL, NULL);
  gt_ensure(rl != NULL);
  gt_ensure(gt_ranked_list_size(rl) == 0);

  iter = gt_ranked_list_iter_new_from_first(rl);
  mystr = gt_ranked_list_iter_next(iter);
  gt_ensure(mystr == NULL);
  mystr = gt_ranked_list_iter_next(iter);
  gt_ensure(mystr == NULL);
  gt_ranked_list_iter_delete(iter);

  iter = gt_ranked_list_iter_new_from_last(rl);
  mystr = gt_ranked_list_iter_prev(iter);
  gt_ensure(mystr == NULL);
  mystr = gt_ranked_list_iter_prev(iter);
  gt_ensure(mystr == NULL);
  gt_ranked_list_iter_delete(iter);

  for (i = 0; i < 8; i++) {
    gt_ranked_list_insert(rl, values+i);
    if (i < 5)
      gt_ensure(gt_ranked_list_size(rl) == (GtUword) i + 1UL);
    else
      gt_ensure(gt_ranked_list_size(rl) == 5UL);
  }
  gt_ensure((*(int*) gt_ranked_list_first(rl)) == 545);
  gt_ensure((*(int*) gt_ranked_list_last(rl)) == 22);
  gt_ranked_list_delete(rl);

  for (j = 0; (GtUword) j < nof_tests; j++) {
    rl = gt_ranked_list_new(30UL, gt_ranked_list_cmp_teststructs, gt_free_func,
                            NULL);
    arr = gt_array_new(sizeof (GtRankedListTestStruct));
    for (i = 0; i < 200; i++) {
      GtRankedListTestStruct newstr,
                             *ptr;
      newstr.id = (GtUword) i;
      newstr.score = (GtUword) (random() % (2*nof_best));
      gt_array_add(arr, newstr);
      ptr = gt_malloc(sizeof (*ptr));
      ptr->id = newstr.id;
      ptr->score = newstr.score;
      gt_ranked_list_insert(rl, ptr);
        if ((GtUword) i < nof_best)
        gt_ensure(gt_ranked_list_size(rl) == (GtUword) i + 1UL);
      else
        gt_ensure(gt_ranked_list_size(rl) == nof_best);
    }
    gt_array_sort_stable_with_data(arr, gt_ranked_list_cmp_teststructs, NULL);
    gt_array_reverse(arr);

    gt_ensure(gt_ranked_list_size(rl) == nof_best);
    iter = gt_ranked_list_iter_new_from_first(rl);

    i = 0;
    for (mystr = gt_ranked_list_iter_next(iter);
         mystr != NULL;
         mystr = gt_ranked_list_iter_next(iter)) {
      GtRankedListTestStruct *str = (GtRankedListTestStruct*)
                                         gt_array_get(arr, (GtUword) i++);
      gt_ensure(mystr != NULL);
      gt_ensure(mystr->id == str->id);
      gt_ensure(mystr->score == str->score);
      /*
      printf("id: "GT_WU"/"GT_WU", score "GT_WU"/"GT_WU"\n", mystr->id,
             str->id, mystr->score, str->score); */
    }
    gt_ranked_list_iter_delete(iter);

    gt_array_delete(arr);
    gt_ranked_list_delete(rl);
  }
  return had_err;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
movq $0x1e, 0x68(%rsp)
movq $0x64, 0x60(%rsp)
movq 0x3a984d(%rip), %rax    # 0x560d10
movq %rax, 0x30(%rsp)
movq 0x3a9849(%rip), %rax    # 0x560d18
movq %rax, 0x38(%rsp)
movq 0x3a9845(%rip), %rax    # 0x560d20
movq %rax, 0x40(%rsp)
movq 0x3a9841(%rip), %rax    # 0x560d28
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x90(%rsp)
je 0x1b7542
movq 0x90(%rsp), %rdi
callq 0xd8a60
testb $0x1, %al
jne 0x1b750a
jmp 0x1b7542
movq 0x484a8f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x35eaf8(%rip), %rsi    # 0x516013
leaq 0x35ec9d(%rip), %rdx    # 0x5161bf
leaq 0x3a9696(%rip), %rcx    # 0x560bbf
leaq 0x3a9674(%rip), %r8     # 0x560ba4
movl $0xf3, %r9d
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x1b7544
movl $0x5, %edi
leaq 0x870(%rip), %rsi       # 0x1b7dc0
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdx
callq 0x1b6f40
movq %rax, 0x80(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x1b75b7
cmpq $0x0, 0x80(%rsp)
jne 0x1b75b5
movq 0x90(%rsp), %rdi
leaq 0x378072(%rip), %rsi    # 0x52f5fa
leaq 0x3a9649(%rip), %rdx    # 0x560bd8
leaq 0x3a9629(%rip), %rcx    # 0x560bbf
leaq 0x3a9607(%rip), %r8     # 0x560ba4
movl $0xf6, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b75b7
jmp 0x1b75b9
jmp 0x1b75bb
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7616
movq 0x80(%rsp), %rdi
callq 0x1b7240
cmpq $0x0, %rax
je 0x1b7614
movq 0x90(%rsp), %rdi
leaq 0x378013(%rip), %rsi    # 0x52f5fa
leaq 0x3a95f5(%rip), %rdx    # 0x560be3
leaq 0x3a95ca(%rip), %rcx    # 0x560bbf
leaq 0x3a95a8(%rip), %r8     # 0x560ba4
movl $0xf7, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7616
jmp 0x1b7618
movq 0x80(%rsp), %rdi
callq 0x1b7260
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0x1b7300
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7689
cmpq $0x0, 0x58(%rsp)
je 0x1b7687
movq 0x90(%rsp), %rdi
leaq 0x377fa0(%rip), %rsi    # 0x52f5fa
leaq 0x3a959f(%rip), %rdx    # 0x560c00
leaq 0x3a9557(%rip), %rcx    # 0x560bbf
leaq 0x3a9535(%rip), %r8     # 0x560ba4
movl $0xfb, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7689
jmp 0x1b768b
movq 0x78(%rsp), %rdi
callq 0x1b7300
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x1b76ea
cmpq $0x0, 0x58(%rsp)
je 0x1b76e8
movq 0x90(%rsp), %rdi
leaq 0x377f3f(%rip), %rsi    # 0x52f5fa
leaq 0x3a953e(%rip), %rdx    # 0x560c00
leaq 0x3a94f6(%rip), %rcx    # 0x560bbf
leaq 0x3a94d4(%rip), %r8     # 0x560ba4
movl $0xfd, %r9d
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b76ea
jmp 0x1b76ec
movq 0x78(%rsp), %rdi
callq 0x1b7460
movq 0x80(%rsp), %rdi
callq 0x1b72b0
movq %rax, 0x78(%rsp)
movq 0x78(%rsp), %rdi
callq 0x1b7360
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7767
cmpq $0x0, 0x58(%rsp)
je 0x1b7765
movq 0x90(%rsp), %rdi
leaq 0x377ec2(%rip), %rsi    # 0x52f5fa
leaq 0x3a94c1(%rip), %rdx    # 0x560c00
leaq 0x3a9479(%rip), %rcx    # 0x560bbf
leaq 0x3a9457(%rip), %r8     # 0x560ba4
movl $0x102, %r9d            # imm = 0x102
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7767
jmp 0x1b7769
movq 0x78(%rsp), %rdi
callq 0x1b7360
movq %rax, 0x58(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x1b77c8
cmpq $0x0, 0x58(%rsp)
je 0x1b77c6
movq 0x90(%rsp), %rdi
leaq 0x377e61(%rip), %rsi    # 0x52f5fa
leaq 0x3a9460(%rip), %rdx    # 0x560c00
leaq 0x3a9418(%rip), %rcx    # 0x560bbf
leaq 0x3a93f6(%rip), %r8     # 0x560ba4
movl $0x104, %r9d            # imm = 0x104
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b77c8
jmp 0x1b77ca
movq 0x78(%rsp), %rdi
callq 0x1b7460
movl $0x0, 0x2c(%rsp)
cmpl $0x8, 0x2c(%rsp)
jge 0x1b78e8
movq 0x80(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movslq 0x2c(%rsp), %rax
shlq $0x2, %rax
addq %rax, %rsi
callq 0x1b7030
cmpl $0x5, 0x2c(%rsp)
jge 0x1b7875
jmp 0x1b780e
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7871
movq 0x80(%rsp), %rdi
callq 0x1b7240
movslq 0x2c(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x1b786f
movq 0x90(%rsp), %rdi
leaq 0x377db8(%rip), %rsi    # 0x52f5fa
leaq 0x3a93c5(%rip), %rdx    # 0x560c0e
leaq 0x3a936f(%rip), %rcx    # 0x560bbf
leaq 0x3a934d(%rip), %r8     # 0x560ba4
movl $0x10a, %r9d            # imm = 0x10A
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7871
jmp 0x1b7873
jmp 0x1b78d6
jmp 0x1b7877
cmpl $0x0, 0x8c(%rsp)
jne 0x1b78d2
movq 0x80(%rsp), %rdi
callq 0x1b7240
cmpq $0x5, %rax
je 0x1b78d0
movq 0x90(%rsp), %rdi
leaq 0x377d57(%rip), %rsi    # 0x52f5fa
leaq 0x3a9391(%rip), %rdx    # 0x560c3b
leaq 0x3a930e(%rip), %rcx    # 0x560bbf
leaq 0x3a92ec(%rip), %r8     # 0x560ba4
movl $0x10c, %r9d            # imm = 0x10C
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b78d2
jmp 0x1b78d4
jmp 0x1b78d6
jmp 0x1b78d8
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x1b77dc
jmp 0x1b78ea
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7947
movq 0x80(%rsp), %rdi
callq 0x1b71f0
cmpl $0x221, (%rax)          # imm = 0x221
je 0x1b7945
movq 0x90(%rsp), %rdi
leaq 0x377ce2(%rip), %rsi    # 0x52f5fa
leaq 0x3a933b(%rip), %rdx    # 0x560c5a
leaq 0x3a9299(%rip), %rcx    # 0x560bbf
leaq 0x3a9277(%rip), %r8     # 0x560ba4
movl $0x10e, %r9d            # imm = 0x10E
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7947
jmp 0x1b7949
jmp 0x1b794b
cmpl $0x0, 0x8c(%rsp)
jne 0x1b79a5
movq 0x80(%rsp), %rdi
callq 0x1b71a0
cmpl $0x16, (%rax)
je 0x1b79a3
movq 0x90(%rsp), %rdi
leaq 0x377c84(%rip), %rsi    # 0x52f5fa
leaq 0x3a9307(%rip), %rdx    # 0x560c84
leaq 0x3a923b(%rip), %rcx    # 0x560bbf
leaq 0x3a9219(%rip), %r8     # 0x560ba4
movl $0x10f, %r9d            # imm = 0x10F
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b79a5
jmp 0x1b79a7
movq 0x80(%rsp), %rdi
callq 0x1b73c0
movl $0x0, 0x28(%rsp)
movslq 0x28(%rsp), %rax
cmpq $0x64, %rax
jae 0x1b7da3
movl $0x1e, %edi
leaq 0x449(%rip), %rsi       # 0x1b7e20
leaq -0xcefae(%rip), %rdx    # 0xe8a30
xorl %eax, %eax
movl %eax, %ecx
callq 0x1b6f40
movq %rax, 0x80(%rsp)
movl $0x10, %edi
callq 0x80990
movq %rax, 0x70(%rsp)
movl $0x0, 0x2c(%rsp)
cmpl $0xc8, 0x2c(%rsp)
jge 0x1b7b7c
movslq 0x2c(%rsp), %rax
movq %rax, 0x18(%rsp)
callq 0x127e80
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, %eax
movl $0x3c, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, 0x20(%rsp)
movq 0x70(%rsp), %rdi
leaq 0x18(%rsp), %rsi
movl $0x10, %edx
callq 0x81100
movl $0x10, %edi
leaq 0x3a914b(%rip), %rsi    # 0x560ba4
movl $0x11c, %edx            # imm = 0x11C
callq 0xe80f0
movq %rax, 0x10(%rsp)
movq 0x18(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x20(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x8(%rax)
movq 0x80(%rsp), %rdi
movq 0x10(%rsp), %rsi
callq 0x1b7030
movslq 0x2c(%rsp), %rax
cmpq $0x1e, %rax
jae 0x1b7b09
jmp 0x1b7aa2
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7b05
movq 0x80(%rsp), %rdi
callq 0x1b7240
movslq 0x2c(%rsp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
je 0x1b7b03
movq 0x90(%rsp), %rdi
leaq 0x377b24(%rip), %rsi    # 0x52f5fa
leaq 0x3a9131(%rip), %rdx    # 0x560c0e
leaq 0x3a90db(%rip), %rcx    # 0x560bbf
leaq 0x3a90b9(%rip), %r8     # 0x560ba4
movl $0x121, %r9d            # imm = 0x121
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7b05
jmp 0x1b7b07
jmp 0x1b7b6a
jmp 0x1b7b0b
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7b66
movq 0x80(%rsp), %rdi
callq 0x1b7240
cmpq $0x1e, %rax
je 0x1b7b64
movq 0x90(%rsp), %rdi
leaq 0x377ac3(%rip), %rsi    # 0x52f5fa
leaq 0x3a916e(%rip), %rdx    # 0x560cac
leaq 0x3a907a(%rip), %rcx    # 0x560bbf
leaq 0x3a9058(%rip), %r8     # 0x560ba4
movl $0x123, %r9d            # imm = 0x123
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7b66
jmp 0x1b7b68
jmp 0x1b7b6a
jmp 0x1b7b6c
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x1b7a06
movq 0x70(%rsp), %rdi
leaq 0x298(%rip), %rsi       # 0x1b7e20
xorl %eax, %eax
movl %eax, %edx
callq 0x816b0
movq 0x70(%rsp), %rdi
callq 0x80f40
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7bf6
movq 0x80(%rsp), %rdi
callq 0x1b7240
cmpq $0x1e, %rax
je 0x1b7bf4
movq 0x90(%rsp), %rdi
leaq 0x377a33(%rip), %rsi    # 0x52f5fa
leaq 0x3a90de(%rip), %rdx    # 0x560cac
leaq 0x3a8fea(%rip), %rcx    # 0x560bbf
leaq 0x3a8fc8(%rip), %r8     # 0x560ba4
movl $0x128, %r9d            # imm = 0x128
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7bf6
jmp 0x1b7bf8
movq 0x80(%rsp), %rdi
callq 0x1b7260
movq %rax, 0x78(%rsp)
movl $0x0, 0x2c(%rsp)
movq 0x78(%rsp), %rdi
callq 0x1b7300
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
je 0x1b7d72
movq 0x70(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rsp)
movslq %eax, %rsi
callq 0x80b60
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7c9c
cmpq $0x0, 0x58(%rsp)
jne 0x1b7c9a
movq 0x90(%rsp), %rdi
leaq 0x37798d(%rip), %rsi    # 0x52f5fa
leaq 0x3a905c(%rip), %rdx    # 0x560cd0
leaq 0x3a8f44(%rip), %rcx    # 0x560bbf
leaq 0x3a8f22(%rip), %r8     # 0x560ba4
movl $0x131, %r9d            # imm = 0x131
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7c9c
jmp 0x1b7c9e
jmp 0x1b7ca0
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7cfa
movq 0x58(%rsp), %rax
movq (%rax), %rax
movq 0x8(%rsp), %rcx
cmpq (%rcx), %rax
je 0x1b7cf8
movq 0x90(%rsp), %rdi
leaq 0x37792f(%rip), %rsi    # 0x52f5fa
leaq 0x3a900c(%rip), %rdx    # 0x560cde
leaq 0x3a8ee6(%rip), %rcx    # 0x560bbf
leaq 0x3a8ec4(%rip), %r8     # 0x560ba4
movl $0x132, %r9d            # imm = 0x132
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7cfa
jmp 0x1b7cfc
jmp 0x1b7cfe
cmpl $0x0, 0x8c(%rsp)
jne 0x1b7d5a
movq 0x58(%rsp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rsp), %rcx
cmpq 0x8(%rcx), %rax
je 0x1b7d58
movq 0x90(%rsp), %rdi
leaq 0x3778cf(%rip), %rsi    # 0x52f5fa
leaq 0x3a8fc1(%rip), %rdx    # 0x560cf3
leaq 0x3a8e86(%rip), %rcx    # 0x560bbf
leaq 0x3a8e64(%rip), %r8     # 0x560ba4
movl $0x133, %r9d            # imm = 0x133
movb $0x0, %al
callq 0xd88c0
movl $0xffffffff, 0x8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x1b7d5a
jmp 0x1b7d5c
jmp 0x1b7d5e
movq 0x78(%rsp), %rdi
callq 0x1b7300
movq %rax, 0x58(%rsp)
jmp 0x1b7c21
movq 0x78(%rsp), %rdi
callq 0x1b7460
movq 0x70(%rsp), %rdi
callq 0x81f80
movq 0x80(%rsp), %rdi
callq 0x1b73c0
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x1b79bc
movl 0x8c(%rsp), %eax
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)