// File: /workspace/github_c_makefile_star2_O2/genometools[P]genometools/src/core/range.c
// Function: gt_range_unit_test
int gt_range_unit_test(GtError *err)
{
  static GtRange ranges_in[] = {  { 620432, 620536 }, { 620432, 620536 },
                                { 620957, 621056 }, { 620957, 621056 },
                                { 625234, 625253 }, { 625500, 625655 },
                                { 625533, 625655 }, { 625533, 625655 },
                                { 627618, 627729 }, { 627618, 627729 },
                                { 627618, 627729 }, { 662083, 662194 },
                                { 662083, 662194 }, { 662083, 662194 },
                                { 663032, 663166 }, { 663032, 663166 },
                                { 663032, 663166 }, { 664782, 664906 },
                                { 664782, 664906 }, { 664782, 664906 },
                                { 665748, 665823 }, { 665748, 665823 },
                                { 665748, 665823 }, { 666825, 666881 },
                                { 666825, 666881 }, { 667797, 667954 },
                                { 667845, 667954 }, { 667845, 667954 },
                                { 679175, 679280 }, { 679175, 679280 },
                                { 679175, 679280 }, { 680427, 680540 },
                                { 680427, 680540 }, { 680427, 680540 },
                                { 684144, 684293 }, { 684144, 684293 },
                                { 684144, 684293 }, { 724903, 724985 },
                                { 724903, 724985 }, { 727099, 727325 },
                                { 727099, 727325 }, { 732544, 732821 },
                                { 732544, 732821 }, { 750016, 750280 },
                                { 750016, 750280 }, { 769508, 769734 },
                                { 769508, 769734 } },
               ranges_out[] = { { 620432, 620536 }, { 620957, 621056 },
                                { 625234, 625253 }, { 625500, 625655 },
                                { 625533, 625655 }, { 627618, 627729 },
                                { 662083, 662194 }, { 663032, 663166 },
                                { 664782, 664906 }, { 665748, 665823 },
                                { 666825, 666881 }, { 667797, 667954 },
                                { 667845, 667954 }, { 679175, 679280 },
                                { 680427, 680540 }, { 684144, 684293 },
                                { 724903, 724985 }, { 727099, 727325 },
                                { 732544, 732821 }, { 750016, 750280 },
                                { 769508, 769734 }};
  GtUword counts[] = { 2, 2, 1, 1, 2, 3, 3, 3, 3, 3, 2, 1, 2, 3, 3, 3, 2,
                             2, 2, 2, 2 };
  GtArray *ranges, *tmp_ranges, *ctr;
  GtUword i;
  int had_err = 0;
  gt_error_check(err);

  gt_ensure(sizeof (ranges_out) / sizeof (ranges_out[0]) ==
                  sizeof (counts)     / sizeof (counts[0]));

  /* test gt_ranges_uniq() */
  ranges = gt_array_new(sizeof (GtRange));
  tmp_ranges = gt_array_new(sizeof (GtRange));
  for (i = 0;
       i < sizeof (ranges_in) / sizeof (ranges_in[0]) && !had_err;
       i++)
    gt_array_add(ranges, ranges_in[i]);
  gt_ranges_uniq(tmp_ranges, ranges);
  gt_ensure(gt_array_size(ranges) ==
                  sizeof (ranges_in) / sizeof (ranges_in[0]));
  gt_ensure(gt_array_size(tmp_ranges) ==
                  sizeof (ranges_out) / sizeof (ranges_out[0]));
  for (i = 0; i < gt_array_size(tmp_ranges) && !had_err; i++) {
    gt_ensure(ranges_out[i].start ==
                    (*(GtRange*) gt_array_get(tmp_ranges, i)).start);
    gt_ensure(ranges_out[i].end ==
                    (*(GtRange*) gt_array_get(tmp_ranges, i)).end);
  }

  /* test gt_ranges_uniq_in_place() */
  gt_array_reset(tmp_ranges);
  gt_array_add_array(tmp_ranges, ranges);
  gt_ranges_uniq_in_place(tmp_ranges);
  for (i = 0; i < gt_array_size(tmp_ranges) && !had_err; i++) {
    gt_ensure(ranges_out[i].start ==
                    (*(GtRange*) gt_array_get(tmp_ranges, i)).start);
    gt_ensure(ranges_out[i].end ==
                    (*(GtRange*) gt_array_get(tmp_ranges, i)).end);
  }

  /* test gt_ranges_uniq_count() */
  gt_array_reset(tmp_ranges);
  ctr = gt_ranges_uniq_count(tmp_ranges, ranges);
  gt_ensure(gt_array_size(tmp_ranges) == gt_array_size(ctr));
  gt_ensure(
            gt_array_size(ctr) == sizeof (counts) / sizeof (counts[0]));
  for (i = 0; i < gt_array_size(ctr) && !had_err; i++) {
    gt_ensure(counts[i] == *(GtUword*) gt_array_get(ctr, i));
    gt_ensure(ranges_out[i].start ==
                    (*(GtRange*) gt_array_get(tmp_ranges, i)).start);
    gt_ensure(ranges_out[i].end ==
                    (*(GtRange*) gt_array_get(tmp_ranges, i)).end);
  }
  gt_array_delete(ctr);

  /* test gt_ranges_uniq_in_place_count() */
  ctr = gt_ranges_uniq_in_place_count(ranges);
  gt_ensure(gt_array_size(ranges) == gt_array_size(ctr));
  gt_ensure(
            gt_array_size(ctr) == sizeof (counts) / sizeof (counts[0]));
  for (i = 0; i < gt_array_size(ctr) && !had_err; i++) {
    gt_ensure(counts[i] == *(GtUword*) gt_array_get(ctr, i));
    gt_ensure(
           ranges_out[i].start == (*(GtRange*)
                                             gt_array_get(ranges, i)).start);
    gt_ensure(
           ranges_out[i].end == (*(GtRange*) gt_array_get(ranges, i)).end);
  }
  gt_array_delete(ctr);

  /* test gt_range_reorder() */
  if (!had_err) {
    GtRange range = { 1, 100 };
    range = gt_range_reorder(range);
    gt_ensure(range.start == 1 && range.end == 100);
    range.start = 100;
    range.end = 1;
    range = gt_range_reorder(range);
    gt_ensure(range.start == 1 && range.end == 100);
  }

  /* free */
  gt_array_delete(ranges);
  gt_array_delete(tmp_ranges);
  return had_err;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x5d3e9
movq %rbx, %rdi
callq 0xc103
testb %al, %al
jne 0x5d9f0
movq %rbx, (%rsp)
pushq $0x10
popq %r14
movq %r14, %rdi
callq 0x4b380
movq %rax, %r13
movq %r14, %rdi
callq 0x4b380
movq %rax, 0x8(%rsp)
xorl %ebx, %ebx
leaq 0xd133e(%rip), %r12     # 0x12e750
cmpq $0x2f0, %rbx            # imm = 0x2F0
je 0x5d430
leaq (%r12,%rbx), %rsi
movq %r13, %rdi
movq %r14, %rdx
callq 0x4b801
addq $0x10, %rbx
jmp 0x5d412
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x5da28
movq %r13, %rdi
callq 0x4b988
pushq $-0x1
popq %r15
cmpq $0x2f, %rax
movq %r13, 0x10(%rsp)
jne 0x5d48f
movq 0x8(%rsp), %rdi
callq 0x4b988
xorl %r14d, %r14d
cmpq $0x15, %rax
je 0x5d4bf
leaq 0x6eceb(%rip), %rsi     # 0xcc159
leaq 0x7e470(%rip), %rdx     # 0xdb8e5
leaq 0x7e412(%rip), %rcx     # 0xdb88e
leaq 0x7e303(%rip), %r8      # 0xdb786
movq (%rsp), %rdi
movl $0xf6, %r9d
jmp 0x5d4b5
leaq 0x6ecc3(%rip), %rsi     # 0xcc159
leaq 0x7e404(%rip), %rdx     # 0xdb8a1
leaq 0x7e3ea(%rip), %rcx     # 0xdb88e
leaq 0x7e2db(%rip), %r8      # 0xdb786
movq (%rsp), %rdi
movl $0xf4, %r9d
xorl %eax, %eax
callq 0xc007
movl %r15d, %r14d
leaq 0x7e952(%rip), %r13     # 0xdbe18
leaq 0x7e2b9(%rip), %rbp     # 0xdb786
xorl %r12d, %r12d
movq 0x8(%rsp), %rdi
callq 0x4b988
testl %r14d, %r14d
jne 0x5d578
cmpq %rax, %r12
jae 0x5d578
movq -0x8(%r13), %rbx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x4b48e
cmpq (%rax), %rbx
jne 0x5d540
movq (%r13), %rbx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x4b48e
xorl %r14d, %r14d
cmpq 0x8(%rax), %rbx
je 0x5d56c
movq (%rsp), %rdi
leaq 0x6ec32(%rip), %rsi     # 0xcc159
leaq 0x7e448(%rip), %rdx     # 0xdb976
leaq 0x7e359(%rip), %rcx     # 0xdb88e
movq %rbp, %r8
movl $0xfb, %r9d
jmp 0x5d562
movq (%rsp), %rdi
leaq 0x6ec0e(%rip), %rsi     # 0xcc159
leaq 0x7e3dd(%rip), %rdx     # 0xdb92f
leaq 0x7e335(%rip), %rcx     # 0xdb88e
movq %rbp, %r8
movl $0xf9, %r9d
xorl %eax, %eax
callq 0xc007
movl %r15d, %r14d
incq %r12
addq $0x10, %r13
jmp 0x5d4d0
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4ba50
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x4b903
movq %rbx, %rdi
callq 0x5da72
leaq 0x7e877(%rip), %r13     # 0xdbe18
leaq 0x6ebb1(%rip), %r15     # 0xcc159
pushq $-0x1
popq %rbp
xorl %r12d, %r12d
movq 0x8(%rsp), %rdi
callq 0x4b988
testl %r14d, %r14d
jne 0x5d656
cmpq %rax, %r12
jae 0x5d656
movq -0x8(%r13), %rbx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x4b48e
cmpq (%rax), %rbx
jne 0x5d61e
movq (%r13), %rbx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x4b48e
xorl %r14d, %r14d
cmpq 0x8(%rax), %rbx
je 0x5d64a
movq (%rsp), %rdi
movq %r15, %rsi
leaq 0x7e36e(%rip), %rdx     # 0xdb976
leaq 0x7e27f(%rip), %rcx     # 0xdb88e
leaq 0x7e170(%rip), %r8      # 0xdb786
movl $0x106, %r9d            # imm = 0x106
jmp 0x5d640
movq (%rsp), %rdi
movq %r15, %rsi
leaq 0x7e303(%rip), %rdx     # 0xdb92f
leaq 0x7e25b(%rip), %rcx     # 0xdb88e
leaq 0x7e14c(%rip), %r8      # 0xdb786
movl $0x104, %r9d            # imm = 0x104
xorl %eax, %eax
callq 0xc007
movl %ebp, %r14d
incq %r12
addq $0x10, %r13
jmp 0x5d5ae
movq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4ba50
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x5dab7
movq %rax, %r15
pushq $-0x1
popq %rbx
testl %r14d, %r14d
jne 0x5d701
movq 0x8(%rsp), %rdi
callq 0x4b988
movq %rax, %r14
movq %r15, %rdi
callq 0x4b988
cmpq %rax, %r14
jne 0x5d6d1
movq %r15, %rdi
callq 0x4b988
xorl %ebx, %ebx
cmpq $0x15, %rax
je 0x5d701
leaq 0x6eaa9(%rip), %rsi     # 0xcc159
leaq 0x7e332(%rip), %rdx     # 0xdb9e9
leaq 0x7e1d0(%rip), %rcx     # 0xdb88e
leaq 0x7e0c1(%rip), %r8      # 0xdb786
movq (%rsp), %rdi
movl $0x10e, %r9d            # imm = 0x10E
jmp 0x5d6f7
leaq 0x6ea81(%rip), %rsi     # 0xcc159
leaq 0x7e2da(%rip), %rdx     # 0xdb9b9
leaq 0x7e1a8(%rip), %rcx     # 0xdb88e
leaq 0x7e099(%rip), %r8      # 0xdb786
movq (%rsp), %rdi
movl $0x10c, %r9d            # imm = 0x10C
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %rbx
xorl %ebp, %ebp
xorl %r13d, %r13d
movq (%rsp), %r14
movq %r15, %rdi
callq 0x4b988
testl %ebx, %ebx
jne 0x5d803
cmpq %rax, %r13
jae 0x5d803
leaq 0x7e836(%rip), %rax     # 0xdbf60
movq (%rbp,%rax), %rbx
movq %r15, %rdi
movq %r13, %rsi
callq 0x4b48e
cmpq (%rax), %rbx
jne 0x5d7a1
leaq 0x7e6ca(%rip), %r12     # 0xdbe10
movq (%r12,%rbp,2), %rbx
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x4b48e
cmpq (%rax), %rbx
jne 0x5d7c8
movq 0x8(%r12,%rbp,2), %r14
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x4b48e
xorl %ebx, %ebx
cmpq 0x8(%rax), %r14
movq (%rsp), %r14
je 0x5d7f7
movq %r14, %rdi
leaq 0x6e9d5(%rip), %rsi     # 0xcc159
leaq 0x7e1eb(%rip), %rdx     # 0xdb976
leaq 0x7e0fc(%rip), %rcx     # 0xdb88e
leaq 0x7dfed(%rip), %r8      # 0xdb786
movl $0x114, %r9d            # imm = 0x114
jmp 0x5d7ed
movq %r14, %rdi
leaq 0x6e9ae(%rip), %rsi     # 0xcc159
leaq 0x7e272(%rip), %rdx     # 0xdba24
leaq 0x7e0d5(%rip), %rcx     # 0xdb88e
leaq 0x7dfc6(%rip), %r8      # 0xdb786
movl $0x110, %r9d            # imm = 0x110
jmp 0x5d7ed
movq %r14, %rdi
leaq 0x6e987(%rip), %rsi     # 0xcc159
leaq 0x7e156(%rip), %rdx     # 0xdb92f
leaq 0x7e0ae(%rip), %rcx     # 0xdb88e
leaq 0x7df9f(%rip), %r8      # 0xdb786
movl $0x112, %r9d            # imm = 0x112
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %rbx
incq %r13
addq $0x8, %rbp
jmp 0x5d70a
movq %r15, %rdi
callq 0x4c19d
movq 0x10(%rsp), %r13
movq %r13, %rdi
callq 0x5db02
movq %rax, %r12
pushq $-0x1
popq %r14
testl %ebx, %ebx
leaq 0x7e5e8(%rip), %rbx     # 0xdbe10
jne 0x5d8b0
movq %r13, %rdi
callq 0x4b988
movq %rax, %r14
movq %r12, %rdi
callq 0x4b988
cmpq %rax, %r14
jne 0x5d87f
movq %r12, %rdi
callq 0x4b988
xorl %r14d, %r14d
cmpq $0x15, %rax
je 0x5d8b0
leaq 0x6e8fb(%rip), %rsi     # 0xcc159
leaq 0x7e184(%rip), %rdx     # 0xdb9e9
leaq 0x7e022(%rip), %rcx     # 0xdb88e
leaq 0x7df13(%rip), %r8      # 0xdb786
movq (%rsp), %rdi
movl $0x11c, %r9d            # imm = 0x11C
jmp 0x5d8a5
leaq 0x6e8d3(%rip), %rsi     # 0xcc159
leaq 0x7e1c5(%rip), %rdx     # 0xdba52
leaq 0x7dffa(%rip), %rcx     # 0xdb88e
leaq 0x7deeb(%rip), %r8      # 0xdb786
movq (%rsp), %rdi
movl $0x11a, %r9d            # imm = 0x11A
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %r14
xorl %ebp, %ebp
xorl %r13d, %r13d
movq 0x10(%rsp), %r15
movq %r12, %rdi
callq 0x4b988
testl %r14d, %r14d
jne 0x5d9bc
cmpq %rax, %r13
jae 0x5d9bc
leaq 0x7e685(%rip), %rax     # 0xdbf60
movq (%rbp,%rax), %r14
movq %r12, %rdi
movq %r13, %rsi
callq 0x4b48e
cmpq (%rax), %r14
jne 0x5d957
movq (%rbx,%rbp,2), %r14
movq %r15, %rdi
movq %r13, %rsi
callq 0x4b48e
cmpq (%rax), %r14
jne 0x5d97f
leaq 0x7e505(%rip), %rax     # 0xdbe10
movq 0x8(%rax,%rbp,2), %rbx
movq %r15, %rdi
movq %r13, %rsi
callq 0x4b48e
xorl %r14d, %r14d
cmpq 0x8(%rax), %rbx
leaq 0x7e4e7(%rip), %rbx     # 0xdbe10
je 0x5d9b0
movq (%rsp), %rdi
leaq 0x6e81f(%rip), %rsi     # 0xcc159
leaq 0x7e180(%rip), %rdx     # 0xdbac1
leaq 0x7df46(%rip), %rcx     # 0xdb88e
leaq 0x7de37(%rip), %r8      # 0xdb786
movl $0x123, %r9d            # imm = 0x123
jmp 0x5d9a5
movq (%rsp), %rdi
leaq 0x6e7f7(%rip), %rsi     # 0xcc159
leaq 0x7e0bb(%rip), %rdx     # 0xdba24
leaq 0x7df1e(%rip), %rcx     # 0xdb88e
leaq 0x7de0f(%rip), %r8      # 0xdb786
movl $0x11e, %r9d            # imm = 0x11E
jmp 0x5d9a5
movq (%rsp), %rdi
leaq 0x6e7cf(%rip), %rsi     # 0xcc159
leaq 0x7e0ed(%rip), %rdx     # 0xdba7e
leaq 0x7def6(%rip), %rcx     # 0xdb88e
leaq 0x7dde7(%rip), %r8      # 0xdb786
movl $0x121, %r9d            # imm = 0x121
xorl %eax, %eax
callq 0xc007
pushq $-0x1
popq %r14
incq %r13
addq $0x8, %rbp
jmp 0x5d8ba
movq %r12, %rdi
callq 0x4c19d
xorl %ebx, %ebx
negl %r14d
sbbl %ebx, %ebx
movq 0x10(%rsp), %rdi
callq 0x4c19d
movq 0x8(%rsp), %rdi
callq 0x4c19d
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd05c1(%rip), %rax     # 0x12dfb8
movq (%rax), %rdi
leaq 0x6c665(%rip), %rsi     # 0xca066
leaq 0x6cc51(%rip), %rdx     # 0xca659
leaq 0x7de7f(%rip), %rcx     # 0xdb88e
leaq 0x7dd70(%rip), %r8      # 0xdb786
movl $0xe6, %r9d
xorl %eax, %eax
callq 0xb8c0
callq 0xb300