// File: /workspace/github_c_makefile_star2_O0/fukunagatsu[P]RIblast/sais.c
// Function: LMSpostproc1
static
sais_index_type
LMSpostproc1(const void *T, sais_index_type *SA,
             sais_index_type n, sais_index_type m, int cs) {
  sais_index_type i, j, p, q, plen, qlen, name;
  sais_index_type c0, c1;
  sais_bool_type diff;

  /* compact all the sorted substrings into the first m items of SA
      2*m must be not larger than n (proveable) */
  assert(0 < n);
  for(i = 0; (p = SA[i]) < 0; ++i) { SA[i] = ~p; assert((i + 1) < n); }
  if(i < m) {
    for(j = i, ++i;; ++i) {
      assert(i < n);
      if((p = SA[i]) < 0) {
        SA[j++] = ~p; SA[i] = 0;
        if(j == m) { break; }
      }
    }
  }

  /* store the length of all substrings */
  i = n - 1; j = n - 1; c0 = chr(n - 1);
  do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) >= c1));
  for(; 0 <= i;) {
    do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) <= c1));
    if(0 <= i) {
      SA[m + ((i + 1) >> 1)] = j - i; j = i + 1;
      do { c1 = c0; } while((0 <= --i) && ((c0 = chr(i)) >= c1));
    }
  }

  /* find the lexicographic names of all substrings */
  for(i = 0, name = 0, q = n, qlen = 0; i < m; ++i) {
    p = SA[i], plen = SA[m + (p >> 1)], diff = 1;
    if((plen == qlen) && ((q + plen) < n)) {
      for(j = 0; (j < plen) && (chr(p + j) == chr(q + j)); ++j) { }
      if(j == plen) { diff = 0; }
    }
    if(diff != 0) { ++name, q = p, qlen = plen; }
    SA[m + (p >> 1)] = name;
  }

  return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
xorl %eax, %eax
cmpl -0x14(%rbp), %eax
jge 0x36f93
jmp 0x36fb2
leaq 0x1f0b(%rip), %rdi      # 0x38ea5
leaq 0x1ddb(%rip), %rsi      # 0x38d7c
movl $0x72, %edx
leaq 0x1f72(%rip), %rcx      # 0x38f1f
callq 0x31c0
movl $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
jge 0x37016
movl -0x28(%rbp), %edx
xorl $-0x1, %edx
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
cmpl -0x14(%rbp), %eax
jge 0x36fea
jmp 0x37009
leaq 0x1edc(%rip), %rdi      # 0x38ecd
leaq 0x1d84(%rip), %rsi      # 0x38d7c
movl $0x73, %edx
leaq 0x1f1b(%rip), %rcx      # 0x38f1f
callq 0x31c0
jmp 0x3700b
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x36fb9
movl -0x20(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x370b2
movl -0x20(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x3703b
jmp 0x3705a
leaq 0x1e97(%rip), %rdi      # 0x38ed9
leaq 0x1d33(%rip), %rsi      # 0x38d7c
movl $0x76, %edx
leaq 0x1eca(%rip), %rcx      # 0x38f1f
callq 0x31c0
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, %eax
jge 0x370a3
movl -0x28(%rbp), %edx
xorl $-0x1, %edx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x24(%rbp)
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x24(%rbp), %eax
cmpl -0x18(%rbp), %eax
jne 0x370a1
jmp 0x370b0
jmp 0x370a3
jmp 0x370a5
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x37031
jmp 0x370b2
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x24(%rbp)
movslq -0x1c(%rbp), %rax
cmpq $0x4, %rax
jne 0x370e3
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x48(%rbp)
jmp 0x370f7
movq -0x8(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x20(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x20(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x49(%rbp)
jg 0x3714f
movslq -0x1c(%rbp), %rax
cmpq $0x4, %rax
jne 0x37131
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
jmp 0x37140
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl -0x40(%rbp), %eax
setge %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x370fd
jmp 0x37158
xorl %eax, %eax
cmpl -0x20(%rbp), %eax
jg 0x3724f
jmp 0x37165
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x20(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x20(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x51(%rbp)
jg 0x371b7
movslq -0x1c(%rbp), %rax
cmpq $0x4, %rax
jne 0x37199
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x58(%rbp)
jmp 0x371a8
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl -0x40(%rbp), %eax
setle %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x37165
xorl %eax, %eax
cmpl -0x20(%rbp), %eax
jg 0x3724a
movl -0x24(%rbp), %edx
subl -0x20(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl -0x20(%rbp), %esi
addl $0x1, %esi
sarl %esi
addl %esi, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x20(%rbp), %edx
addl $-0x1, %edx
movl %edx, -0x20(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl %edx, %ecx
movb %al, -0x59(%rbp)
jg 0x37241
movslq -0x1c(%rbp), %rax
cmpq $0x4, %rax
jne 0x37223
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x60(%rbp)
jmp 0x37232
movq -0x8(%rbp), %rax
movslq -0x20(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl -0x40(%rbp), %eax
setge %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
testb $0x1, %al
jne 0x371ef
jmp 0x3724a
jmp 0x37158
movl $0x0, -0x20(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x373b5
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl -0x28(%rbp), %edx
sarl %edx
addl %edx, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movl $0x1, -0x44(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x34(%rbp), %eax
jne 0x37375
movl -0x2c(%rbp), %eax
addl -0x30(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x37375
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %ecx
xorl %eax, %eax
cmpl -0x30(%rbp), %ecx
movb %al, -0x61(%rbp)
jge 0x3734b
movslq -0x1c(%rbp), %rax
cmpq $0x4, %rax
jne 0x372f0
movq -0x8(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x68(%rbp)
jmp 0x37304
movq -0x8(%rbp), %rax
movl -0x28(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x68(%rbp)
movl -0x68(%rbp), %eax
movl %eax, -0x6c(%rbp)
movslq -0x1c(%rbp), %rax
cmpq $0x4, %rax
jne 0x37329
movq -0x8(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
jmp 0x3733d
movq -0x8(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl -0x24(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x70(%rbp)
movl -0x6c(%rbp), %eax
movl -0x70(%rbp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x37354
jmp 0x37364
jmp 0x37356
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x372c4
movl -0x24(%rbp), %eax
cmpl -0x30(%rbp), %eax
jne 0x37373
movl $0x0, -0x44(%rbp)
jmp 0x37375
cmpl $0x0, -0x44(%rbp)
je 0x37390
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
movl -0x28(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl -0x28(%rbp), %esi
sarl %esi
addl %esi, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3726a
movl -0x38(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nop