// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]lyndon-array/external/sacak-lyndon.c
// Function: induceSAl0
void induceSAl0(int_t *SA,
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the head of each bucket.
  getBuckets_k(s, bkt, n, K, false, cs);

  bkt[0]++; // skip the virtual sentinel.
  for(i=0; i<n; i++)
    if(SA[i]>0) {
      j=SA[i]-1;
      if(chr(j)>=chr(j+1)) {
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]++;
        if(!suffix && i>0) SA[i]=0;
      }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl 0x10(%rbp), %eax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movl %r9d, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movl 0x10(%rbp), %r9d
xorl %r8d, %r8d
callq 0x85e0
movq -0x18(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x89a7
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x8997
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x8887
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
jmp 0x8896
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x88bb
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
jmp 0x88cf
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movl -0x38(%rbp), %ecx
cmpl %ecx, %eax
jl 0x8995
movl -0x2c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x890d
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x50(%rbp)
jmp 0x891c
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movl -0x4c(%rbp), %edx
movq -0x40(%rbp), %rcx
movl -0x50(%rbp), %esi
movslq %esi, %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
movslq 0x10(%rbp), %rax
cmpq $0x4, %rax
jne 0x8956
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x5c(%rbp)
jmp 0x8965
movq -0x10(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x5c(%rbp)
movq -0x58(%rbp), %rax
movl -0x5c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
cmpl $0x0, -0x24(%rbp)
jne 0x8993
cmpl $0x0, -0x28(%rbp)
jle 0x8993
movq -0x8(%rbp), %rax
movslq -0x28(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x8995
jmp 0x8997
jmp 0x8999
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x883e
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)