// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/ltr/ltrharvest_stream.c
// Function: gt_removeoverlapswithlowersimilarity
static void gt_removeoverlapswithlowersimilarity(GtArrayLTRboundaries
                                                            *arrayLTRboundaries,
                                                 bool nooverlapallowed)
{
  GtUword i;
  LTRboundaries *boundaries,
                *oldboundaries,
                *maxsimboundaries = NULL;
  GtRange refrng;
  gt_assert(arrayLTRboundaries != NULL);

  if (arrayLTRboundaries->spaceLTRboundaries == NULL)
    return;
  gt_assert(arrayLTRboundaries->spaceLTRboundaries != NULL);

  maxsimboundaries = oldboundaries = arrayLTRboundaries->spaceLTRboundaries;
  refrng.start = oldboundaries->leftLTR_5;
  refrng.end = oldboundaries->rightLTR_3;
  for (i = 1UL; i < arrayLTRboundaries->nextfreeLTRboundaries; i++) {
    boundaries = arrayLTRboundaries->spaceLTRboundaries + i;
    if (boundaries->skipped)
      continue;
    if (ltrboundaries_overlap(&refrng, boundaries)) {
      /* due to sortedness of the array, the left border shouldn't change... */
      gt_assert(refrng.start <= boundaries->leftLTR_5);
      /* ...so only update the right border */
      refrng.end = GT_MAX(boundaries->rightLTR_3, refrng.end);
      if (nooverlapallowed) {
        oldboundaries->skipped = true;
        boundaries->skipped = true;
      } else {
        if (gt_double_smaller_double(maxsimboundaries->similarity,
                                     boundaries->similarity)) {
          maxsimboundaries->skipped = true;
          maxsimboundaries = boundaries;
        } else {
          boundaries->skipped = true;
        }
      }
    } else {
      /* no more overlapping with cluster, reset */
      oldboundaries = boundaries;
      refrng.start = boundaries->leftLTR_5;
      refrng.end = boundaries->rightLTR_3;
      maxsimboundaries = boundaries;
    }
  }
}

// Assembly:
subq $0x48, %rsp
movb %sil, %al
movq %rdi, 0x40(%rsp)
andb $0x1, %al
movb %al, 0x3f(%rsp)
movq $0x0, 0x18(%rsp)
cmpq $0x0, 0x40(%rsp)
jne 0x3102db
movq 0x32bcf6(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x205d5f(%rip), %rsi    # 0x516013
leaq 0x284326(%rip), %rdx    # 0x5945e1
leaq 0x28433a(%rip), %rcx    # 0x5945fc
leaq 0x283fb9(%rip), %r8     # 0x594282
movl $0x4b4, %r9d            # imm = 0x4B4
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x3102dd
movq 0x40(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x3102ed
jmp 0x3104db
jmp 0x3102ef
movq 0x40(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x310332
movq 0x32bc9f(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x205d08(%rip), %rsi    # 0x516013
leaq 0x28430f(%rip), %rdx    # 0x594621
leaq 0x2842e3(%rip), %rcx    # 0x5945fc
leaq 0x283f62(%rip), %r8     # 0x594282
movl $0x4b8, %r9d            # imm = 0x4B8
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x310334
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x20(%rsp)
movq %rax, 0x18(%rsp)
movq 0x20(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movq $0x1, 0x30(%rsp)
movq 0x30(%rsp), %rax
movq 0x40(%rsp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x3104db
movq 0x40(%rsp), %rax
movq (%rax), %rax
imulq $0x48, 0x30(%rsp), %rcx
addq %rcx, %rax
movq %rax, 0x28(%rsp)
movq 0x28(%rsp), %rax
testb $0x1, 0x3c(%rax)
je 0x3103a5
jmp 0x3104c8
movq 0x28(%rsp), %rsi
leaq 0x8(%rsp), %rdi
callq 0x3131e0
testb $0x1, %al
jne 0x3103bd
jmp 0x310496
jmp 0x3103bf
movq 0x8(%rsp), %rax
movq 0x28(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jbe 0x310407
movq 0x32bbca(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x205c33(%rip), %rsi    # 0x516013
leaq 0x284269(%rip), %rdx    # 0x594650
leaq 0x28420e(%rip), %rcx    # 0x5945fc
leaq 0x283e8d(%rip), %r8     # 0x594282
movl $0x4c3, %r9d            # imm = 0x4C3
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x310409
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
cmpq 0x10(%rsp), %rax
jbe 0x310428
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, (%rsp)
jmp 0x310431
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x10(%rsp)
testb $0x1, 0x3f(%rsp)
je 0x310455
movq 0x20(%rsp), %rax
movb $0x1, 0x3c(%rax)
movq 0x28(%rsp), %rax
movb $0x1, 0x3c(%rax)
jmp 0x310494
movq 0x18(%rsp), %rax
movsd 0x40(%rax), %xmm0
movq 0x28(%rsp), %rax
movsd 0x40(%rax), %xmm1
callq 0xec2f0
testb $0x1, %al
jne 0x310474
jmp 0x310489
movq 0x18(%rsp), %rax
movb $0x1, 0x3c(%rax)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x310492
movq 0x28(%rsp), %rax
movb $0x1, 0x3c(%rax)
jmp 0x310494
jmp 0x3104c6
movq 0x28(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
jmp 0x3104c8
movq 0x30(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x30(%rsp)
jmp 0x31036b
addq $0x48, %rsp
retq