// File: /workspace/github_c_makefile_star2_O0/felipelouza[P]lyndon-array/external/sacak-lyndon.c
// Function: induceSAs0_LA_9n
void induceSAs0_LA_9n(int_t *SA, int_t *LA, 
  int_t *s, int_t *bkt,
  int_t n, unsigned int K, int_t suffix, int cs) {
  int_t i, j;

  // find the end of each bucket.
  getBuckets_k(s, bkt, n, K, true, cs);

  for(i=n-1; i>0; i--){

    #if DEBUG
	    printf("\n\n");
	    printf("LA (%d)\n",SA[i]);
      for(j=0; j<n; j++)
	    	printf("%" PRIdN "\t", LA[j]);
	    printf("\n\n");
    #endif

		j=SA[i];
		int_t next, prev;

    if(SA[i]>0) {

      if(LA[j-1]<j) prev=LA[j-1];
      else prev=j-1;
	    next=LA[j];

		  LA[next-1]=prev;
      if(prev>=0) LA[prev]=next;

      j=SA[i]-1;
      if(chr(j)<=chr(j+1) && bkt[chr(j)]<i) { //Inducing S-type
        SA[bkt[chr(j)]]=j;
        bkt[chr(j)]--;
        if(!suffix) SA[i]=0;
      }
    }
    else{
      prev=j-1;
	    next=LA[j];
		  LA[next-1]=prev;
    }
	}

  #if DEBUG
	  printf("\n\n");
	  printf("LA (%d)\n",SA[i]);
    for(j=0; j<n; j++)
	  	printf("%" PRIdN "\t", LA[j]);
	  printf("\n\n");
  #endif 

	LA[n-1]=n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl 0x18(%rbp), %eax
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), %rdi
movq -0x20(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
movl 0x18(%rbp), %r9d
movl $0x1, %r8d
callq 0x85e0
movl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x2c(%rbp)
jle 0x95d7
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
jle 0x959d
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x30(%rbp), %eax
jge 0x93e3
movq -0x10(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
jmp 0x93ec
movl -0x30(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
cmpl $0x0, -0x38(%rbp)
jl 0x9421
movl -0x34(%rbp), %edx
movq -0x10(%rbp), %rax
movslq -0x38(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
movl %eax, -0x30(%rbp)
movslq 0x18(%rbp), %rax
cmpq $0x4, %rax
jne 0x944c
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x3c(%rbp)
jmp 0x945b
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x40(%rbp)
movslq 0x18(%rbp), %rax
cmpq $0x4, %rax
jne 0x9480
movq -0x18(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x44(%rbp)
jmp 0x9494
movq -0x18(%rbp), %rax
movl -0x30(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
movl -0x40(%rbp), %eax
movl -0x44(%rbp), %ecx
cmpl %ecx, %eax
jg 0x959b
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movslq 0x18(%rbp), %rax
cmpq $0x4, %rax
jne 0x94c4
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x54(%rbp)
jmp 0x94d3
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
movq -0x50(%rbp), %rax
movl -0x54(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x2c(%rbp), %eax
jge 0x959b
movl -0x30(%rbp), %eax
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movslq 0x18(%rbp), %rax
cmpq $0x4, %rax
jne 0x9519
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
jmp 0x9528
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x70(%rbp)
movq -0x68(%rbp), %rax
movl -0x6c(%rbp), %edx
movq -0x60(%rbp), %rcx
movl -0x70(%rbp), %esi
movslq %esi, %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x20(%rbp), %rax
movq %rax, -0x78(%rbp)
movslq 0x18(%rbp), %rax
cmpq $0x4, %rax
jne 0x9562
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x7c(%rbp)
jmp 0x9571
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x7c(%rbp)
movq -0x78(%rbp), %rax
movl -0x7c(%rbp), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
movl %edx, (%rax,%rcx,4)
cmpl $0x0, 0x10(%rbp)
jne 0x9599
movq -0x8(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
jmp 0x959b
jmp 0x95c7
movl -0x30(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movslq -0x30(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movl -0x38(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x34(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x95c9
movl -0x2c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x938f
movl -0x24(%rbp), %edx
movq -0x10(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)