// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/match/radixsort_str.c
// Function: gt_radixsort_str_insertionsort
static void gt_radixsort_str_insertionsort(GtRadixsortstringinfo *rsi,
                                           GtUword *suffixes,
                                           GtUword subbucketleft,
                                           GtUword width,
                                           GtUword depth,
                                           GtLcpvalues *lcpvalues,
                                           GtUword sortmaxdepth)
{
  GtUword pm, pl, u, v, lcpvalue;

  for (pm = 1UL; pm < width; pm++)
  {
    for (pl = pm; pl > 0; pl--)
    {
      gt_radixsort_str_bucketnum_t codeslcp, unk = 0, vnk = 0;
      int uvcmp = 0;

      u = suffixes[pl-1];
      v = suffixes[pl];
      for (lcpvalue = depth;
           (sortmaxdepth == 0 || lcpvalue <= sortmaxdepth) && uvcmp == 0;
           /* Nothing */)
      {
        unk = gt_radixsort_str_get_code(rsi->twobitencoding, u, lcpvalue,
                                        rsi->equallengthplus1,
                                        rsi->realtotallength);
        vnk = gt_radixsort_str_get_code(rsi->twobitencoding, v, lcpvalue,
                                        rsi->equallengthplus1,
                                        rsi->realtotallength);
        codeslcp = gt_radixsort_str_codeslcp(rsi, unk, vnk);
        lcpvalue += codeslcp;
        if (unk == vnk)
        {
          if (!GT_RADIXSORT_STR_HAS_OVERFLOW(unk))
          {
            if (!GT_RADIXSORT_STR_HAS_OVERFLOW(vnk))
            {
              uvcmp = 0;
            } else
            {
              uvcmp = -1;
            }
          } else
          {
            if (!GT_RADIXSORT_STR_HAS_OVERFLOW(vnk))
            {
              uvcmp = 1;
            } else
            {
              uvcmp = (u < v) ? -1 : 1;
            }
          }
        } else
        {
          if (unk < vnk)
          {
            uvcmp = -1;
          } else
          {
            uvcmp = 1;
          }
        }
        gt_assert((uvcmp == 0 && codeslcp == GT_RADIXSORT_STR_KMERSIZE) ||
                   (uvcmp != 0 && codeslcp < GT_RADIXSORT_STR_KMERSIZE));
      }
      if (lcpvalues != NULL)
      {
        if (pl < pm && uvcmp > 0)
        {
          gt_lcptab_update(lcpvalues,subbucketleft,pl+1,
                           gt_lcptab_getvalue(lcpvalues,subbucketleft,pl));
        }
        gt_lcptab_update(lcpvalues,subbucketleft,pl,
                         sortmaxdepth == 0 ? lcpvalue
                                           : GT_MIN(lcpvalue,sortmaxdepth));
      }
      if (uvcmp < 0)
      {
        break;
      }
      suffixes[pl-1] = v;
      suffixes[pl] = u;
    }
  }
}

// Assembly:
subq $0xa8, %rsp
movq 0xb0(%rsp), %rax
movq %rdi, 0xa0(%rsp)
movq %rsi, 0x98(%rsp)
movq %rdx, 0x90(%rsp)
movq %rcx, 0x88(%rsp)
movq %r8, 0x80(%rsp)
movq %r9, 0x78(%rsp)
movq $0x1, 0x70(%rsp)
movq 0x70(%rsp), %rax
cmpq 0x88(%rsp), %rax
jae 0x4d5c8d
movq 0x70(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x68(%rsp)
jbe 0x4d5c78
movw $0x0, 0x4c(%rsp)
movw $0x0, 0x4a(%rsp)
movl $0x0, 0x44(%rsp)
movq 0x98(%rsp), %rax
movq 0x68(%rsp), %rcx
subq $0x1, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x60(%rsp)
movq 0x98(%rsp), %rax
movq 0x68(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x58(%rsp)
movq 0x80(%rsp), %rax
movq %rax, 0x50(%rsp)
cmpq $0x0, 0xb0(%rsp)
je 0x4d5961
movq 0x50(%rsp), %rcx
xorl %eax, %eax
cmpq 0xb0(%rsp), %rcx
movb %al, 0x43(%rsp)
ja 0x4d596d
cmpl $0x0, 0x44(%rsp)
sete %al
movb %al, 0x43(%rsp)
movb 0x43(%rsp), %al
testb $0x1, %al
jne 0x4d597a
jmp 0x4d5b3a
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
movq 0x60(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0xa0(%rsp), %rax
movq 0x18(%rax), %r8
callq 0x4d5370
movw %ax, 0x4c(%rsp)
movq 0xa0(%rsp), %rax
movq (%rax), %rdi
movq 0x58(%rsp), %rsi
movq 0x50(%rsp), %rdx
movq 0xa0(%rsp), %rax
movq 0x10(%rax), %rcx
movq 0xa0(%rsp), %rax
movq 0x18(%rax), %r8
callq 0x4d5370
movw %ax, 0x4a(%rsp)
movq 0xa0(%rsp), %rdi
movw 0x4c(%rsp), %ax
movzwl %ax, %esi
movzwl 0x4a(%rsp), %edx
callq 0x4d5620
movw %ax, 0x4e(%rsp)
movzwl 0x4e(%rsp), %eax
addq 0x50(%rsp), %rax
movq %rax, 0x50(%rsp)
movzwl 0x4c(%rsp), %eax
movzwl 0x4a(%rsp), %ecx
cmpl %ecx, %eax
jne 0x4d5ab3
movzwl 0x4c(%rsp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x4d5a6e
movzwl 0x4c(%rsp), %eax
cmpl $0x400, %eax            # imm = 0x400
je 0x4d5a6e
movzwl 0x4a(%rsp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x4d5a64
movzwl 0x4a(%rsp), %eax
cmpl $0x400, %eax            # imm = 0x400
je 0x4d5a64
movl $0x0, 0x44(%rsp)
jmp 0x4d5a6c
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x4d5ab1
movzwl 0x4a(%rsp), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x4d5a91
movzwl 0x4a(%rsp), %eax
cmpl $0x400, %eax            # imm = 0x400
je 0x4d5a91
movl $0x1, 0x44(%rsp)
jmp 0x4d5aaf
movq 0x60(%rsp), %rdx
movq 0x58(%rsp), %rsi
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rsi, %rdx
cmovbl %ecx, %eax
movl %eax, 0x44(%rsp)
jmp 0x4d5ab1
jmp 0x4d5ad5
movzwl 0x4c(%rsp), %eax
movzwl 0x4a(%rsp), %ecx
cmpl %ecx, %eax
jge 0x4d5acb
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0x4d5ad3
movl $0x1, 0x44(%rsp)
jmp 0x4d5ad5
jmp 0x4d5ad7
cmpl $0x0, 0x44(%rsp)
jne 0x4d5ae9
movzwl 0x4e(%rsp), %eax
cmpq $0x4, %rax
je 0x4d5b33
cmpl $0x0, 0x44(%rsp)
je 0x4d5afb
movzwl 0x4e(%rsp), %eax
cmpq $0x4, %rax
jb 0x4d5b33
movq 0x16649e(%rip), %rax    # 0x63bfa0
movq (%rax), %rdi
leaq 0x40507(%rip), %rsi     # 0x516013
leaq 0xe452c(%rip), %rdx     # 0x5ba03f
leaq 0xe4593(%rip), %rcx     # 0x5ba0ad
leaq 0xe437c(%rip), %r8      # 0x5b9e9d
movl $0x149, %r9d            # imm = 0x149
movb $0x0, %al
callq 0x199f0
callq 0x19370
jmp 0x4d5b35
jmp 0x4d5941
cmpq $0x0, 0x78(%rsp)
je 0x4d5c2c
movq 0x68(%rsp), %rax
cmpq 0x70(%rsp), %rax
jae 0x4d5bac
cmpl $0x0, 0x44(%rsp)
jle 0x4d5bac
movq 0x78(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x68(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x78(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x68(%rsp), %rdx
callq 0x4d5d60
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
movq %rax, %rcx
callq 0x4d5710
movq 0x78(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x20(%rsp)
cmpq $0x0, 0xb0(%rsp)
jne 0x4d5be4
movq 0x50(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x4d5c13
movq 0x50(%rsp), %rax
cmpq 0xb0(%rsp), %rax
jae 0x4d5bfe
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
jmp 0x4d5c0a
movq 0xb0(%rsp), %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdx
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rcx
callq 0x4d5710
cmpl $0x0, 0x44(%rsp)
jge 0x4d5c35
jmp 0x4d5c78
movq 0x58(%rsp), %rdx
movq 0x98(%rsp), %rax
movq 0x68(%rsp), %rcx
subq $0x1, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x60(%rsp), %rdx
movq 0x98(%rsp), %rax
movq 0x68(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x68(%rsp), %rax
addq $-0x1, %rax
movq %rax, 0x68(%rsp)
jmp 0x4d58e2
jmp 0x4d5c7a
movq 0x70(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x70(%rsp)
jmp 0x4d58c5
addq $0xa8, %rsp
retq
nopw %cs:(%rax,%rax)