// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/contrib/sais-lite-lcp/sais.c
// Function: LMSsort1
static
void
LMSsort1(const void *T, sais_index_type *SA,
         sais_index_type *C, sais_index_type *B,
         sais_index_type n, sais_index_type k, int cs) {
  sais_index_type bb, i, j;
  sais_index_type c0, c1;

  /* compute SAl */
  if(C == B) { getCounts(T, C, n, k, cs); }
  getBuckets(C, B, k, 0); /* find starts of buckets */
  j = n - 1;
  bb = B[c1 = chr(j)];
  --j;
  SA[bb++] = (chr(j) < c1) ? ~j : j;
  for(i = 0; i < n; ++i) {
    if(0 < (j = SA[i])) {
      assert(chr(j) >= chr(j + 1));
      if((c0 = chr(j)) != c1) { B[c1] = bb; bb = B[c1 = c0]; }
      assert(i < bb);
      --j;
      SA[bb] = (chr(j) < c1) ? ~j : j;
      ++bb;
      SA[i] = 0;
    } else if(j < 0) {
      SA[i] = ~j;
    }
  }
  /* compute SAs */
  if(C == B) { getCounts(T, C, n, k, cs); }
  getBuckets(C, B, k, 1); /* find ends of buckets */
  for(i = n - 1, bb = B[c1 = 0]; 0 <= i; --i) {
    if(0 < (j = SA[i])) {
      assert(chr(j) <= chr(j + 1));
      if((c0 = chr(j)) != c1) { B[c1] = bb; bb = B[c1 = c0]; }
      assert((bb) <= i);
      --j;
      SA[--bb] = (chr(j) > c1) ? ~(j + 1) : j;
      SA[i] = 0;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movl %r9d, -0x28(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x2c90e7
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0x2c85e0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x28(%rbp), %edx
xorl %ecx, %ecx
callq 0x2c8680
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x34(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c9124
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
jmp 0x2c9133
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4c(%rbp)
movq -0x48(%rbp), %rax
movl -0x4c(%rbp), %ecx
movl %ecx, -0x3c(%rbp)
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c9169
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
jmp 0x2c9178
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2c918b
movl -0x34(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2c9191
movl -0x34(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x2c(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2c937b
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, -0x34(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jge 0x2c9352
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c91ee
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
jmp 0x2c91fd
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x5c(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c9222
movq -0x8(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
jmp 0x2c9236
movq -0x8(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x60(%rbp)
movl -0x5c(%rbp), %eax
movl -0x60(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2c9242
jmp 0x2c9261
leaq 0xae6ad6(%rip), %rdi    # 0xdafd1f
leaq 0xae698b(%rip), %rsi    # 0xdafbdb
movl $0x5b, %edx
leaq 0xae6b42(%rip), %rcx    # 0xdafd9e
callq 0x2af1a0
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c927b
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
jmp 0x2c928a
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl -0x3c(%rbp), %eax
je 0x2c92b6
movl -0x2c(%rbp), %edx
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, -0x3c(%rbp)
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x2c92c0
jmp 0x2c92df
leaq 0xae6b17(%rip), %rdi    # 0xdafdde
leaq 0xae690d(%rip), %rsi    # 0xdafbdb
movl $0x5d, %edx
leaq 0xae6ac4(%rip), %rcx    # 0xdafd9e
callq 0x2af1a0
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c9302
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x68(%rbp)
jmp 0x2c9311
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2c9324
movl -0x34(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x2c932a
movl -0x34(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2c936b
cmpl $0x0, -0x34(%rbp)
jge 0x2c9369
movl -0x34(%rbp), %edx
xorl $-0x1, %edx
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2c936b
jmp 0x2c936d
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2c91b0
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x2c939c
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
movl 0x10(%rbp), %r8d
callq 0x2c85e0
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x28(%rbp), %edx
movl $0x1, %ecx
callq 0x2c8680
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, -0x3c(%rbp)
movl (%rax), %eax
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
cmpl -0x30(%rbp), %eax
jg 0x2c9584
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, -0x34(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jge 0x2c9574
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c9407
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
jmp 0x2c9416
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %eax
movl %eax, -0x74(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c943b
movq -0x8(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x78(%rbp)
jmp 0x2c944f
movq -0x8(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x78(%rbp)
movl -0x74(%rbp), %eax
movl -0x78(%rbp), %ecx
cmpl %ecx, %eax
jg 0x2c945b
jmp 0x2c947a
leaq 0xae68df(%rip), %rdi    # 0xdafd41
leaq 0xae6772(%rip), %rsi    # 0xdafbdb
movl $0x6b, %edx
leaq 0xae6929(%rip), %rcx    # 0xdafd9e
callq 0x2af1a0
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c9494
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x7c(%rbp)
jmp 0x2c94a3
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl -0x3c(%rbp), %eax
je 0x2c94cf
movl -0x2c(%rbp), %edx
movq -0x20(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movl -0x38(%rbp), %ecx
movl %ecx, -0x3c(%rbp)
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x30(%rbp), %eax
jg 0x2c94d9
jmp 0x2c94f8
leaq 0xae6905(%rip), %rdi    # 0xdafde5
leaq 0xae66f4(%rip), %rsi    # 0xdafbdb
movl $0x6d, %edx
leaq 0xae68ab(%rip), %rcx    # 0xdafd9e
callq 0x2af1a0
movl -0x34(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x34(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2c951b
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x80(%rbp)
jmp 0x2c952a
movq -0x8(%rbp), %rax
movslq -0x34(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jle 0x2c9543
movl -0x34(%rbp), %eax
addl $0x1, %eax
xorl $-0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x2c954c
movl -0x34(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x2c(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x2c9576
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2c93ca
addq $0x90, %rsp
popq %rbp
retq
nopl (%rax)