// File: /workspace/github_cpp_makefile_star2_O2/shangjingbo1226[P]MACFP/src/methods/../utils/suffix_array.h
// Function: SuffixArray::dc3(int*, int*, long long, int)
void dc3(int *r, int *sa, long long n, int m) {
        int *rn = r + n, *san = sa + n, ta = 0, tb = (n + 1) / 3;
        long long i, j, p, tbc = 0;
        r[n] = r[n + 1] = 0;
        for (i = 0; i < n; ++ i) {
            if (i % 3 != 0) {
                wa[tbc ++]=i;
            }
        }
        sort(r+2, &wa[0], &wb[0], tbc, m);
        sort(r+1, &wb[0], &wa[0], tbc, m);
        sort(r, &wa[0], &wb[0], tbc, m);
        for(p = 1, rn[F(wb[0])] = 0, i = 1; i < tbc; ++ i) {
            rn[F(wb[i])] = c0(r, wb[i - 1], wb[i]) ? p - 1 : p ++;
        }
        if (p < tbc) {
            dc3(rn, san, tbc, p);
        } else {
            for (i = 0; i < tbc; ++ i) {
                san[rn[i]] = i;
            }
        }
        for (i = 0; i < tbc; ++ i) {
            if (san[i] < tb) {
                wb[ta ++] = san[i] * 3;
            }
        }
        if (n % 3 == 1) {
            wb[ta ++]=n - 1;
        }
        sort(r, &wb[0], &wa[0], ta, m);
        for (i = 0; i < tbc; ++ i) {
            wv[wb[i] = G(san[i])] = i;
        }
        for (i = 0, j = 0, p = 0; i < ta && j < tbc; ++ p) {
            sa[p] = c12(wb[j] % 3, r, wa[i], wb[j]) ? wa[i ++] : wb[j++];
        }
        for (; i < ta; ++ p) {
            sa[p] = wa[i ++];
        }
        for (; j < tbc; ++ p) {
            sa[p] = wb[j ++];
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r8d, %ebp
movq %rdx, %rbx
movq %rsi, 0x18(%rsp)
leaq (%rsi,%rcx,4), %rsi
leaq 0x1(%rcx), %rax
pushq $0x3
popq %r10
cqto
idivq %r10
movq %rax, %r13
andl $0x0, 0x4(%rsi)
movq %rdi, %r15
movq %rsi, (%rsp)
andl $0x0, (%rsi)
movq 0x40(%rdi), %r9
xorl %esi, %esi
testq %rcx, %rcx
movl $0x0, %edi
movq %rcx, 0x8(%rsp)
cmovgq %rcx, %rdi
xorl %r14d, %r14d
movq %rsi, %rax
xorl %edx, %edx
divq %r10
cmpq %rsi, %rdi
je 0x5cb5
leaq (%rax,%rax,2), %rax
cmpq %rsi, %rax
je 0x5cb0
movl %esi, (%r9,%r14,4)
incq %r14
incq %rsi
jmp 0x5c93
movq 0x18(%rsp), %r12
leaq 0x8(%r12), %rsi
movq 0x58(%r15), %rcx
movq %r15, %rdi
movq %r9, %rdx
movq %r14, %r8
movl %ebp, %r9d
callq 0x6462
leaq 0x4(%r12), %rsi
movq 0x40(%r15), %rcx
movq 0x58(%r15), %rdx
movq %r15, %rdi
movq %r14, %r8
movl %ebp, %r9d
callq 0x6462
movq 0x40(%r15), %rdx
movq 0x58(%r15), %rcx
movq %r15, %rdi
movq %r12, %rsi
movq %r14, 0x20(%rsp)
movq %r14, %r8
movl %ebp, 0x14(%rsp)
movl %ebp, %r9d
callq 0x6462
movq 0x58(%r15), %rax
movl (%rax), %eax
pushq $0x3
popq %rcx
cltd
idivl %ecx
xorl %r14d, %r14d
cmpl $0x1, %edx
movl %r13d, %ecx
cmovel %r14d, %ecx
addl %eax, %ecx
movslq %ecx, %rax
movq (%rsp), %rcx
andl $0x0, (%rcx,%rax,4)
pushq $0x1
popq %r12
movq %r12, %rbp
movq 0x20(%rsp), %rcx
cmpq %rcx, %r12
jge 0x5da0
movq 0x58(%r15), %rax
movslq -0x4(%rax,%r12,4), %rdx
movslq (%rax,%r12,4), %rcx
movq %r15, %rdi
movq 0x18(%rsp), %rsi
callq 0x652a
xorl %esi, %esi
xorl %ecx, %ecx
testl %eax, %eax
setne %sil
sete %cl
movq 0x58(%r15), %rax
movl (%rax,%r12,4), %eax
cltd
pushq $0x3
popq %rdi
idivl %edi
addq %rbp, %rcx
subl %esi, %ebp
cmpl $0x1, %edx
movl %r13d, %edx
cmovel %r14d, %edx
addl %eax, %edx
movslq %edx, %rax
movq (%rsp), %rdx
movl %ebp, (%rdx,%rax,4)
incq %r12
movq %rcx, %rbp
jmp 0x5d3e
movq 0x8(%rsp), %r8
leaq (%rbx,%r8,4), %r12
cmpq %rcx, %rbp
jge 0x5f60
movq %r15, %rdi
movq (%rsp), %rsi
movq %r12, %rdx
movl %ebp, %r8d
callq 0x5c3e
movq 0x8(%rsp), %r8
movq 0x20(%rsp), %rax
xorl %r14d, %r14d
testq %rax, %rax
cmovgq %rax, %r14
movl 0x14(%rsp), %r9d
pushq $0x3
popq %r10
movq 0x58(%r15), %rax
xorl %esi, %esi
xorl %edx, %edx
movslq %esi, %rcx
cmpq %rdx, %r14
je 0x5e08
movl (%r12,%rdx,4), %edi
cmpl %r13d, %edi
jge 0x5e03
leal (%rdi,%rdi,2), %edi
leal 0x1(%rcx), %esi
movl %edi, (%rax,%rcx,4)
incq %rdx
jmp 0x5de9
movq %r8, %rax
cqto
idivq %r10
movq %rdx, %rax
movq 0x58(%r15), %rdx
cmpq $0x1, %rax
jne 0x5e27
decl %r8d
leal 0x1(%rcx), %esi
movl %r8d, (%rdx,%rcx,4)
movq 0x40(%r15), %rcx
movslq %esi, %rbp
movq %r15, %rdi
movq 0x18(%rsp), %rsi
movq %rbp, %r8
callq 0x6462
movq 0x58(%r15), %rax
movq 0x70(%r15), %rcx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rsi, %r14
je 0x5e7e
movl (%r12,%rsi,4), %edi
xorl %r8d, %r8d
cmpl %r13d, %edi
setl %r8b
movl %r13d, %r9d
cmovll %edx, %r9d
subl %r9d, %edi
leal (%rdi,%rdi,2), %edi
subl %r8d, %edi
addl $0x2, %edi
movl %edi, (%rax,%rsi,4)
movslq %edi, %rdi
movl %esi, (%rcx,%rdi,4)
incq %rsi
jmp 0x5e4a
movq %r15, 0x8(%rsp)
movq %rbx, (%rsp)
xorl %r12d, %r12d
xorl %r14d, %r14d
movq 0x8(%rsp), %rbx
cmpq %rbp, %r12
movq 0x20(%rsp), %rdx
jge 0x5f11
cmpq %rdx, %r14
jge 0x5f11
movq 0x40(%rbx), %rcx
movq 0x58(%rbx), %rax
leaq (,%r14,4), %r13
movslq (%rax,%r14,4), %r8
movl %r8d, %eax
cltd
pushq $0x3
popq %rsi
idivl %esi
movq %rbp, %r15
leaq (,%r12,4), %rbp
movslq (%rcx,%r12,4), %rcx
movq %rbx, %rdi
movl %edx, %esi
movq 0x18(%rsp), %rdx
callq 0x654c
addq 0x40(%rbx), %rbp
addq 0x58(%rbx), %r13
xorl %ecx, %ecx
xorl %edx, %edx
testl %eax, %eax
sete %cl
setne %dl
cmovneq %rbp, %r13
movq %r15, %rbp
addq %rdx, %r12
addq %rcx, %r14
movl (%r13), %eax
movq (%rsp), %rcx
movl %eax, (%rcx)
addq $0x4, %rcx
movq %rcx, (%rsp)
jmp 0x5e92
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rax
movq (%rsp), %r15
cmpq %rbp, %r12
jge 0x5f33
movl (%rax,%r12,4), %ecx
incq %r12
movl %ecx, (%r15)
addq $0x4, %r15
jmp 0x5f1e
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rax
cmpq %rdx, %r14
jge 0x5f51
movl (%rax,%r14,4), %ecx
incq %r14
movl %ecx, (%r15)
addq $0x4, %r15
jmp 0x5f3c
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
testq %rcx, %rcx
movl $0x0, %r14d
cmovgq %rcx, %r14
movl 0x14(%rsp), %r9d
pushq $0x3
popq %r10
cmpq %rax, %r14
je 0x5de1
movq (%rsp), %rcx
movslq (%rcx,%rax,4), %rcx
movl %eax, (%r12,%rcx,4)
incq %rax
jmp 0x5f78