// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/rdj-contfinder.c
// Function: gt_contfinder_insertion_sort
static inline void gt_contfinder_insertion_sort(
    const GtContfinder contfinder, GtContfinderBucketInfo bucket)
{
  size_t i, j;
  gt_contfinder_seqnum_t u, v, container;
  int uvcmp;

  gt_assert(bucket.nofseqs > (gt_contfinder_seqnum_t)1);

  for (i = (size_t)1; i < bucket.nofseqs; i++)
  {
    gt_contfinder_seqnum_t ucorrected;
    size_t ulen = 0;
    u = GT_READJOINER_CONTFINDER_GET_SEQNUM(bucket.seqnums,
        i + bucket.seqnums_offset);
    ucorrected = u;
    if (ucorrected >= contfinder.nofseqs)
      ucorrected = (contfinder.nofseqs << 1) - 1 - ucorrected;
    if (contfinder.len == 0)
    {
      ulen = (ucorrected > 0) ? contfinder.seppos[ucorrected] -
        contfinder.seppos[ucorrected - 1] : contfinder.seppos[ucorrected] + 1;
    }
    for (j = i; j > 0; j--)
    {
      size_t len = contfinder.len;
      size_t pos;
      size_t vlen = 0;
      gt_contfinder_seqnum_t vcorrected;
      GtContfinderKmercodeWithOverflow unk = {0, 0}, vnk = {0, 0};
      v = GT_READJOINER_CONTFINDER_GET_SEQNUM(bucket.seqnums, j - 1 +
          bucket.seqnums_offset);
      vcorrected = v;
      if (vcorrected >= contfinder.nofseqs)
        vcorrected = (contfinder.nofseqs << 1) - 1 - vcorrected;
      if (len == 0)
      {
        vlen = (vcorrected > 0) ? contfinder.seppos[vcorrected] -
          contfinder.seppos[vcorrected - 1] : contfinder.seppos[vcorrected] + 1;
        len = GT_MIN(ulen, vlen);
      }
      for (pos = bucket.depth, uvcmp = 0; uvcmp == 0 && pos < len;
          pos += GT_CONTFINDER_KMERSIZE)
      {
        unk = gt_contfinder_get_code(contfinder.twobitencoding, u,
            pos, contfinder.nofseqs, contfinder.len,
            contfinder.seppos);
        vnk = gt_contfinder_get_code(contfinder.twobitencoding, v,
            pos, contfinder.nofseqs, contfinder.len,
            contfinder.seppos);
        uvcmp = (int)vnk.code - (int)unk.code;
      }
      if (ulen > vlen)
      {
        unsigned short shift = (unsigned short)
          ((vnk.overflow - unk.overflow) << 1);
        uvcmp = (int)(vnk.code >> shift) - (int)(unk.code >> shift);
        if (uvcmp == 0)
        {
          /* v is contained in u */
          GT_SETIBIT(contfinder.contained, vcorrected);
          break;
        }
      }
      else if (ulen < vlen)
      {
        unsigned short shift = (unsigned short)
          ((unk.overflow - vnk.overflow) << 1);
        uvcmp = (int)(vnk.code >> shift) - (int)(unk.code >> shift);
        if (uvcmp == 0)
        {
          /* u is contained in v */
          GT_SETIBIT(contfinder.contained, ucorrected);
          break;
        }
      }
      if (uvcmp < 0)
      {
        break;
      }
      if (uvcmp == 0)
      {
        if (ucorrected > vcorrected)
        {
          GT_SETIBIT(contfinder.contained, ucorrected);
          break;
        }
      }
      GT_READJOINER_CONTFINDER_SET_SEQNUM(bucket.seqnums,
          j + bucket.seqnums_offset, v);
    }
    GT_READJOINER_CONTFINDER_SET_SEQNUM(bucket.seqnums,
        j + bucket.seqnums_offset, u);
  }

  container = GT_READJOINER_CONTFINDER_GET_SEQNUM(bucket.seqnums,
        bucket.seqnums_offset);
  if (container >= contfinder.nofseqs)
    container = (contfinder.nofseqs << 1) - 1 - container;
  for (i = (size_t)1; i < bucket.nofseqs; i++)
  {
    u = GT_READJOINER_CONTFINDER_GET_SEQNUM(bucket.seqnums,
        i + bucket.seqnums_offset);
    if (u >= contfinder.nofseqs)
      u = (contfinder.nofseqs << 1) - 1 - u;
    if (GT_ISIBITSET(contfinder.contained, u))
    {
      GT_CONTFINDER_CONTAINS(&contfinder, container, u);
    }
    else
    {
      container = u;
    }
  }
}

// Assembly:
subq $0x88, %rsp
leaq 0xe0(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0x90(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x20(%rsp), %rax
cmpl $0x1, 0x10(%rax)
ja 0x27bdb4
movq 0x3c021d(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x29a286(%rip), %rsi    # 0x516013
leaq 0x303e3b(%rip), %rdx    # 0x57fbcf
leaq 0x303e5f(%rip), %rcx    # 0x57fbfa
leaq 0x303ca0(%rip), %r8     # 0x57fa42
movl $0x111, %r9d            # imm = 0x111
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27bdb6
movq $0x1, 0x80(%rsp)
movq 0x20(%rsp), %rcx
movq 0x80(%rsp), %rax
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x27c219
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rsi
movq $0x0, 0x58(%rsp)
movq (%rsi), %rax
movq 0x80(%rsp), %rdx
addq 0x8(%rsi), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
movl %eax, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0xc(%rcx), %eax
jb 0x27be2a
movq 0x28(%rsp), %rax
movl 0xc(%rax), %eax
shll %eax
subl $0x1, %eax
subl 0x64(%rsp), %eax
movl %eax, 0x64(%rsp)
movq 0x28(%rsp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x27be8a
cmpl $0x0, 0x64(%rsp)
jbe 0x27be66
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
movl 0x64(%rsp), %edx
movq (%rax,%rdx,8), %rax
movq 0x20(%rcx), %rcx
movl 0x64(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
subq (%rcx,%rdx,8), %rax
movq %rax, 0x18(%rsp)
jmp 0x27be80
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x64(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x78(%rsp)
cmpq $0x0, 0x78(%rsp)
jbe 0x27c1e8
movq 0x28(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x50(%rsp)
movq $0x0, 0x40(%rsp)
leaq 0x3a(%rsp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x19360
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x19360
movq 0x20(%rsp), %rsi
movq 0x28(%rsp), %rcx
movq (%rsi), %rax
movq 0x78(%rsp), %rdx
subq $0x1, %rdx
addq 0x8(%rsi), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, 0x70(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
cmpl 0xc(%rcx), %eax
jb 0x27bf23
movq 0x28(%rsp), %rax
movl 0xc(%rax), %eax
shll %eax
subl $0x1, %eax
subl 0x3c(%rsp), %eax
movl %eax, 0x3c(%rsp)
cmpq $0x0, 0x50(%rsp)
jne 0x27bfaf
cmpl $0x0, 0x3c(%rsp)
jbe 0x27bf5f
movq 0x28(%rsp), %rcx
movq 0x20(%rcx), %rax
movl 0x3c(%rsp), %edx
movq (%rax,%rdx,8), %rax
movq 0x20(%rcx), %rcx
movl 0x3c(%rsp), %edx
subl $0x1, %edx
movl %edx, %edx
subq (%rcx,%rdx,8), %rax
movq %rax, 0x10(%rsp)
jmp 0x27bf79
movq 0x28(%rsp), %rax
movq 0x20(%rax), %rax
movl 0x3c(%rsp), %ecx
movq (%rax,%rcx,8), %rax
addq $0x1, %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x58(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x27bf9b
movq 0x58(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x27bfa5
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x20(%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x48(%rsp)
movl $0x0, 0x68(%rsp)
xorl %eax, %eax
cmpl $0x0, 0x68(%rsp)
movb %al, 0x7(%rsp)
jne 0x27bfe3
movq 0x48(%rsp), %rax
cmpq 0x50(%rsp), %rax
setb %al
movb %al, 0x7(%rsp)
movb 0x7(%rsp), %al
testb $0x1, %al
jne 0x27bff0
jmp 0x27c076
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movl 0x74(%rsp), %esi
movq 0x48(%rsp), %rdx
movl 0xc(%rax), %ecx
movq 0x18(%rax), %r8
movq 0x20(%rax), %r9
callq 0x27b6e0
movw %ax, %cx
movq 0x28(%rsp), %rax
movw %cx, 0x36(%rsp)
movw 0x36(%rsp), %cx
movw %cx, 0x3a(%rsp)
movq (%rax), %rdi
movl 0x70(%rsp), %esi
movq 0x48(%rsp), %rdx
movl 0xc(%rax), %ecx
movq 0x18(%rax), %r8
movq 0x20(%rax), %r9
callq 0x27b6e0
movw %ax, 0x34(%rsp)
movw 0x34(%rsp), %ax
movw %ax, 0x38(%rsp)
movzbl 0x38(%rsp), %eax
movzbl 0x3a(%rsp), %ecx
subl %ecx, %eax
movl %eax, 0x68(%rsp)
movq 0x48(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x48(%rsp)
jmp 0x27bfc5
movq 0x58(%rsp), %rax
cmpq 0x40(%rsp), %rax
jbe 0x27c0f3
movzbl 0x39(%rsp), %eax
movzbl 0x3b(%rsp), %ecx
subl %ecx, %eax
shll %eax
movw %ax, 0x32(%rsp)
movzbl 0x38(%rsp), %eax
movzwl 0x32(%rsp), %ecx
sarl %cl, %eax
movzbl 0x3a(%rsp), %edx
movzwl 0x32(%rsp), %ecx
sarl %cl, %edx
movl %edx, %ecx
subl %ecx, %eax
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x27c0f1
movq 0x28(%rsp), %rax
movl 0x3c(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x10(%rax), %rax
movl 0x3c(%rsp), %ecx
shrl $0x6, %ecx
movl %ecx, %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x27c1e8
jmp 0x27c16f
movq 0x58(%rsp), %rax
cmpq 0x40(%rsp), %rax
jae 0x27c16d
movzbl 0x3b(%rsp), %eax
movzbl 0x39(%rsp), %ecx
subl %ecx, %eax
shll %eax
movw %ax, 0x30(%rsp)
movzbl 0x38(%rsp), %eax
movzwl 0x30(%rsp), %ecx
sarl %cl, %eax
movzbl 0x3a(%rsp), %edx
movzwl 0x30(%rsp), %ecx
sarl %cl, %edx
movl %edx, %ecx
subl %ecx, %eax
movl %eax, 0x68(%rsp)
cmpl $0x0, 0x68(%rsp)
jne 0x27c16b
movq 0x28(%rsp), %rax
movl 0x64(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x10(%rax), %rax
movl 0x64(%rsp), %ecx
shrl $0x6, %ecx
movl %ecx, %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x27c1e8
jmp 0x27c16d
jmp 0x27c16f
cmpl $0x0, 0x68(%rsp)
jge 0x27c178
jmp 0x27c1e8
cmpl $0x0, 0x68(%rsp)
jne 0x27c1bd
movl 0x64(%rsp), %eax
cmpl 0x3c(%rsp), %eax
jbe 0x27c1bb
movq 0x28(%rsp), %rax
movl 0x64(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq 0x10(%rax), %rax
movl 0x64(%rsp), %ecx
shrl $0x6, %ecx
movl %ecx, %ecx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
jmp 0x27c1e8
jmp 0x27c1bd
movq 0x20(%rsp), %rsi
movl 0x70(%rsp), %edx
movq (%rsi), %rax
movq 0x78(%rsp), %rcx
addq 0x8(%rsi), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x78(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x78(%rsp)
jmp 0x27be97
movq 0x20(%rsp), %rsi
movl 0x74(%rsp), %edx
movq (%rsi), %rax
movq 0x78(%rsp), %rcx
addq 0x8(%rsi), %rcx
movl %edx, (%rax,%rcx,4)
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x27bdc2
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rdx
movq (%rdx), %rax
movq 0x8(%rdx), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, 0x6c(%rsp)
movl 0x6c(%rsp), %eax
cmpl 0xc(%rcx), %eax
jb 0x27c24f
movq 0x28(%rsp), %rax
movl 0xc(%rax), %eax
shll %eax
subl $0x1, %eax
subl 0x6c(%rsp), %eax
movl %eax, 0x6c(%rsp)
movq $0x1, 0x80(%rsp)
movq 0x20(%rsp), %rcx
movq 0x80(%rsp), %rax
movl 0x10(%rcx), %ecx
cmpq %rcx, %rax
jae 0x27c420
movq 0x28(%rsp), %rcx
movq 0x20(%rsp), %rsi
movq (%rsi), %rax
movq 0x80(%rsp), %rdx
addq 0x8(%rsi), %rdx
movl (%rax,%rdx,4), %eax
movl %eax, 0x74(%rsp)
movl 0x74(%rsp), %eax
cmpl 0xc(%rcx), %eax
jb 0x27c2b2
movq 0x28(%rsp), %rax
movl 0xc(%rax), %eax
shll %eax
subl $0x1, %eax
subl 0x74(%rsp), %eax
movl %eax, 0x74(%rsp)
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x74(%rsp), %ecx
shrl $0x6, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl 0x74(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x27c3fd
movq 0x28(%rsp), %rax
movl 0x74(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
shrq %cl, %rsi
movq 0x10(%rax), %rcx
movl 0x74(%rsp), %edx
shrl $0x6, %edx
movl %edx, %edx
orq (%rcx,%rdx,8), %rsi
movq %rsi, (%rcx,%rdx,8)
cmpq $0x0, 0x40(%rax)
je 0x27c3fb
jmp 0x27c32b
movq 0x28(%rsp), %rax
movq 0x10(%rax), %rax
movl 0x6c(%rsp), %ecx
shrl $0x6, %ecx
movl %ecx, %ecx
movq (%rax,%rcx,8), %rax
movl 0x6c(%rsp), %ecx
andl $0x3f, %ecx
movl %ecx, %ecx
movabsq $-0x8000000000000000, %rdx # imm = 0x8000000000000000
shrq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x27c39b
movq 0x3bfc36(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x299c9f(%rip), %rsi    # 0x516013
leaq 0x303821(%rip), %rdx    # 0x57fb9c
leaq 0x303878(%rip), %rcx    # 0x57fbfa
leaq 0x3036b9(%rip), %r8     # 0x57fa42
movl $0x175, %r9d            # imm = 0x175
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x27c39d
movq 0x28(%rsp), %rcx
movq 0x40(%rcx), %rax
movl 0x6c(%rsp), %edx
movzbl (%rax,%rdx), %eax
movq 0x40(%rcx), %rcx
movl 0x74(%rsp), %edx
movzbl (%rcx,%rdx), %edx
movl $0xff, %ecx
subl %edx, %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x27c3ea
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rcx
movl 0x74(%rsp), %edx
movzbl (%rcx,%rdx), %esi
movq 0x40(%rax), %rax
movl 0x6c(%rsp), %ecx
movzbl (%rax,%rcx), %edx
addl %esi, %edx
movb %dl, (%rax,%rcx)
movq 0x28(%rsp), %rax
movq 0x40(%rax), %rax
movl 0x74(%rsp), %ecx
movb $0x0, (%rax,%rcx)
jmp 0x27c405
movl 0x74(%rsp), %eax
movl %eax, 0x6c(%rsp)
jmp 0x27c407
movq 0x80(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x80(%rsp)
jmp 0x27c25b
addq $0x88, %rsp
retq
nopl (%rax,%rax)