// File: /workspace/github_c_makefile_star2_O0/nh13[P]ksw/src/parasail/contrib/sais-lite-lcp/sais.c
// Function: induceSA
static void induceSA(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 i, j;
  sais_index_type bb;
  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)];
  SA[bb++] = ((0 < j) && (chr(j - 1) < c1)) ? ~j : j;
  for(i = 0; i < n; ++i) {
    j = SA[i], SA[i] = ~j;
    if(0 < j) {
      --j;
      assert(chr(j) >= chr(j + 1));
      if((c0 = chr(j)) != c1) { B[c1] = bb; bb = B[c1 = c0]; }
      assert(i < bb);
      SA[bb] = ((0 < j) && (chr(j - 1) < c1)) ? ~j : j;
      ++bb;
    }
  }
  /* 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])) {
      --j;
      assert(chr(j) <= chr(j + 1));
      if((c0 = chr(j)) != c1) { B[c1] = bb; bb = B[c1 = c0]; }
      assert(bb <= i);
      SA[--bb] = ((j == 0) || (chr(j - 1) > c1)) ? ~j : j;
    } else {
      SA[i] = ~j;
    }
  }
}

// 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 0x2caad7
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, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cab14
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x4c(%rbp)
jmp 0x2cab23
movq -0x8(%rbp), %rax
movslq -0x30(%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, -0x34(%rbp)
xorl %eax, %eax
cmpl -0x30(%rbp), %eax
jge 0x2cab83
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cab5c
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
jmp 0x2cab70
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2cab83
movl -0x30(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x2cab89
movl -0x30(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x34(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x2cad6c
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %edx
xorl $-0x1, %edx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
xorl %eax, %eax
cmpl -0x30(%rbp), %eax
jge 0x2cad5c
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cac01
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
jmp 0x2cac10
movq -0x8(%rbp), %rax
movslq -0x30(%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 0x2cac35
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
jmp 0x2cac49
movq -0x8(%rbp), %rax
movl -0x30(%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 0x2cac55
jmp 0x2cac74
leaq 0xae50c3(%rip), %rdi    # 0xdafd1f
leaq 0xae4f78(%rip), %rsi    # 0xdafbdb
movl $0x116, %edx            # imm = 0x116
leaq 0xae5254(%rip), %rcx    # 0xdafec3
callq 0x2af1a0
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cac8e
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x64(%rbp)
jmp 0x2cac9d
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl -0x3c(%rbp), %eax
je 0x2cacc9
movl -0x34(%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, -0x34(%rbp)
movl -0x2c(%rbp), %eax
cmpl -0x34(%rbp), %eax
jge 0x2cacd3
jmp 0x2cacf2
leaq 0xae5104(%rip), %rdi    # 0xdafdde
leaq 0xae4efa(%rip), %rsi    # 0xdafbdb
movl $0x118, %edx            # imm = 0x118
leaq 0xae51d6(%rip), %rcx    # 0xdafec3
callq 0x2af1a0
xorl %eax, %eax
cmpl -0x30(%rbp), %eax
jge 0x2cad3f
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cad18
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x68(%rbp)
jmp 0x2cad2c
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x2cad3f
movl -0x30(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x2cad45
movl -0x30(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x34(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x2cad5e
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2caba8
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x2cad8d
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, -0x2c(%rbp)
movq -0x20(%rbp), %rax
movl $0x0, -0x3c(%rbp)
movl (%rax), %eax
movl %eax, -0x34(%rbp)
xorl %eax, %eax
cmpl -0x2c(%rbp), %eax
jg 0x2caf86
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %ecx
movl %ecx, -0x30(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
jge 0x2caf65
movl -0x30(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x30(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cae01
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
jmp 0x2cae10
movq -0x8(%rbp), %rax
movslq -0x30(%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 0x2cae35
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x78(%rbp)
jmp 0x2cae49
movq -0x8(%rbp), %rax
movl -0x30(%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 0x2cae55
jmp 0x2cae74
leaq 0xae4ee5(%rip), %rdi    # 0xdafd41
leaq 0xae4d78(%rip), %rsi    # 0xdafbdb
movl $0x123, %edx            # imm = 0x123
leaq 0xae5054(%rip), %rcx    # 0xdafec3
callq 0x2af1a0
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2cae8e
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x7c(%rbp)
jmp 0x2cae9d
movq -0x8(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x7c(%rbp)
movl -0x7c(%rbp), %eax
movl %eax, -0x38(%rbp)
cmpl -0x3c(%rbp), %eax
je 0x2caec9
movl -0x34(%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, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jg 0x2caed3
jmp 0x2caef2
leaq 0xae4fc9(%rip), %rdi    # 0xdafea3
leaq 0xae4cfa(%rip), %rsi    # 0xdafbdb
movl $0x125, %edx            # imm = 0x125
leaq 0xae4fd6(%rip), %rcx    # 0xdafec3
callq 0x2af1a0
cmpl $0x0, -0x30(%rbp)
je 0x2caf33
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x2caf17
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x80(%rbp)
jmp 0x2caf2b
movq -0x8(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x80(%rbp)
movl -0x80(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jle 0x2caf41
movl -0x30(%rbp), %eax
xorl $-0x1, %eax
movl %eax, -0x84(%rbp)
jmp 0x2caf4a
movl -0x30(%rbp), %eax
movl %eax, -0x84(%rbp)
movl -0x84(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $-0x1, %ecx
movl %ecx, -0x34(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2caf76
movl -0x30(%rbp), %edx
xorl $-0x1, %edx
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x2caf78
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2cadbb
addq $0x90, %rsp
popq %rbp
retq
nop