// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/is.c
// Function: induceSA
static void induceSA(const unsigned char *T, int64_t *SA, int64_t *C, int64_t *B, int64_t n, int64_t k, int64_t cs)
{
	int64_t *b, i, j;
	int64_t  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;
	b = SA + B[c1 = chr(j)];
	*b++ = ((0 < j) && (chr(j - 1) < c1)) ? ~j : j;
	for (i = 0; i < n; ++i) {
		j = SA[i], SA[i] = ~j;
		if (0 < j) {
			--j;
			if ((c0 = chr(j)) != c1) {
				B[c1] = b - SA;
				b = SA + B[c1 = c0];
			}
			*b++ = ((0 < j) && (chr(j - 1) < c1)) ? ~j : 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, b = SA + B[c1 = 0]; 0 <= i; --i) {
		if (0 < (j = SA[i])) {
			--j;
			if ((c0 = chr(j)) != c1) {
				B[c1] = b - SA;
				b = SA + B[c1 = c0];
			}
			*--b = ((j == 0) || (chr(j - 1) > c1)) ? ~j : j;
		} else SA[i] = ~j;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %rbp
movq %rsi, %r15
movq %rdi, %r12
movq 0x50(%rsp), %r9
cmpq %rcx, %rdx
jne 0x55ad
testq %r13, %r13
jle 0x5588
leaq (,%r13,8), %rdx
movq %rbp, %rdi
xorl %esi, %esi
callq 0x3140
movq 0x50(%rsp), %r9
testq %rbx, %rbx
jle 0x55ad
xorl %eax, %eax
cmpq $0x8, %r9
jne 0x559b
movq (%r12,%rax,8), %rcx
jmp 0x55a0
movzbl (%r12,%rax), %ecx
incq (%rbp,%rcx,8)
incq %rax
cmpq %rax, %rbx
jne 0x558f
testq %r13, %r13
jle 0x55cd
xorl %ecx, %ecx
xorl %eax, %eax
movq (%rbp,%rax,8), %rdx
addq %rcx, %rdx
movq %rcx, (%r14,%rax,8)
incq %rax
movq %rdx, %rcx
cmpq %rax, %r13
jne 0x55b6
leaq -0x1(%rbx), %rdx
cmpq $0x8, %r9
jne 0x55f1
movq -0x8(%r12,%rbx,8), %rcx
movq (%r14,%rcx,8), %rax
leaq (%r15,%rax,8), %rax
cmpq $0x1, %rbx
jle 0x5627
movq -0x10(%r12,%rbx,8), %rsi
jmp 0x560b
movzbl -0x1(%r12,%rbx), %ecx
movq (%r14,%rcx,8), %rax
leaq (%r15,%rax,8), %rax
cmpq $0x1, %rbx
jle 0x5627
movzbl -0x2(%r12,%rbx), %esi
movq %rbx, %rdi
negq %rdi
cmpq %rcx, %rsi
cmovlq %rdi, %rdx
movq %rdx, (%rax)
leaq -0x2(%r12), %r10
leaq -0x10(%r12), %r11
jmp 0x563d
movq %rdx, (%rax)
leaq -0x2(%r12), %r10
leaq -0x10(%r12), %r11
testq %rbx, %rbx
jle 0x57da
addq $0x8, %rax
xorl %edx, %edx
movq (%r15,%rdx,8), %rsi
movq %rsi, %rdi
notq %rdi
movq %rdi, (%r15,%rdx,8)
testq %rsi, %rsi
jle 0x56ba
leaq -0x1(%rsi), %rdi
cmpq $0x8, %r9
jne 0x5667
movq -0x8(%r12,%rsi,8), %r8
jmp 0x566c
movzbl (%r12,%rdi), %r8d
cmpq %rcx, %r8
jne 0x5676
movq %rcx, %r8
jmp 0x5689
subq %r15, %rax
sarq $0x3, %rax
movq %rax, (%r14,%rcx,8)
movq (%r14,%r8,8), %rax
leaq (%r15,%rax,8), %rax
cmpq $0x1, %rsi
jne 0x5693
xorl %edi, %edi
jmp 0x56b0
cmpq $0x8, %r9
jne 0x56a0
movq -0x10(%r12,%rsi,8), %rcx
jmp 0x56a6
movzbl -0x2(%r12,%rsi), %ecx
negq %rsi
cmpq %r8, %rcx
cmovlq %rsi, %rdi
movq %rdi, (%rax)
addq $0x8, %rax
movq %r8, %rcx
incq %rdx
cmpq %rdx, %rbx
jne 0x5643
movb $0x1, %dl
cmpq %r14, %rbp
jne 0x5725
testq %r13, %r13
jle 0x5701
movl %edx, 0x4(%rsp)
leaq (,%r13,8), %rdx
movq %rbp, %rdi
xorl %esi, %esi
movq %r10, 0x10(%rsp)
movq %r11, 0x8(%rsp)
callq 0x3140
movl 0x4(%rsp), %edx
movq 0x8(%rsp), %r11
movq 0x10(%rsp), %r10
movq 0x50(%rsp), %r9
testb %dl, %dl
je 0x5725
xorl %eax, %eax
cmpq $0x8, %r9
jne 0x5713
movq (%r12,%rax,8), %rcx
jmp 0x5718
movzbl (%r12,%rax), %ecx
incq (%rbp,%rcx,8)
incq %rax
cmpq %rax, %rbx
jne 0x5707
testq %r13, %r13
jle 0x573f
xorl %eax, %eax
xorl %ecx, %ecx
addq (%rbp,%rcx,8), %rax
movq %rax, (%r14,%rcx,8)
incq %rcx
cmpq %rcx, %r13
jne 0x572e
testb %dl, %dl
je 0x57cb
movq (%r14), %rax
leaq (%r15,%rax,8), %rax
xorl %edx, %edx
movq -0x8(%r15,%rbx,8), %rcx
testq %rcx, %rcx
jle 0x576b
leaq -0x1(%rcx), %rsi
cmpq $0x8, %r9
jne 0x5775
movq -0x8(%r12,%rcx,8), %rdi
jmp 0x577a
notq %rcx
movq %rcx, -0x8(%r15,%rbx,8)
jmp 0x57c3
movzbl (%r12,%rsi), %edi
cmpq %rdx, %rdi
jne 0x5784
movq %rdx, %rdi
jmp 0x5797
subq %r15, %rax
sarq $0x3, %rax
movq %rax, (%r14,%rdx,8)
movq (%r14,%rdi,8), %rax
leaq (%r15,%rax,8), %rax
testq %rsi, %rsi
je 0x57b2
cmpq $0x8, %r9
jne 0x57a8
movq (%r11,%rcx,8), %rdx
jmp 0x57ad
movzbl (%r10,%rcx), %edx
cmpq %rdi, %rdx
jle 0x57b8
negq %rcx
movq %rcx, %rsi
movq %rsi, -0x8(%rax)
addq $-0x8, %rax
movq %rdi, %rdx
decq %rbx
testq %rbx, %rbx
jg 0x5750
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edx, %edx
jmp 0x56c4
nopl (%rax)