// File: /workspace/github_cpp_makefile_star2_O3/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, %r13d
movq %rdx, 0x20(%rsp)
movq %rsi, %r12
leaq (%rsi,%rcx,4), %rbp
leaq 0x1(%rcx), %rax
movabsq $0x5555555555555556, %rdx # imm = 0x5555555555555556
imulq %rdx
movq %rdx, %rbx
shrq $0x3f, %rbx
addl %edx, %ebx
xorl %r14d, %r14d
movl %r14d, 0x4(%rbp)
movl %r14d, (%rbp)
movq 0x40(%rdi), %r8
xorl %r15d, %r15d
testq %rcx, %rcx
jle 0x6b17
movabsq $-0x5555555555555555, %r10 # imm = 0xAAAAAAAAAAAAAAAB
xorl %esi, %esi
movq %rsi, %rax
mulq %r10
shrq %rdx
leaq (%rdx,%rdx,2), %rax
cmpq %rsi, %rax
je 0x6b0f
movl %esi, (%r8,%r15,4)
incq %r15
incq %rsi
cmpq %rsi, %rcx
jne 0x6af6
movq %rcx, 0x18(%rsp)
leaq 0x8(%r12), %rsi
movq 0x58(%rdi), %rcx
movq %r8, %rdx
movq %r15, %r8
movl %r13d, %r9d
movq %rdi, 0x8(%rsp)
callq 0x76d6
leaq 0x4(%r12), %rsi
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rcx
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rdx
movq 0x8(%rsp), %rdi
movq %r15, %r8
movl %r13d, %r9d
callq 0x76d6
movq 0x8(%rsp), %rax
movq 0x40(%rax), %rdx
movq 0x8(%rsp), %rax
movq 0x58(%rax), %rcx
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %r15, %r8
movl %r13d, 0x14(%rsp)
movl %r13d, %r9d
callq 0x76d6
movq 0x8(%rsp), %rdi
movq 0x58(%rdi), %r13
movslq (%r13), %rax
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %edx
subl %edx, %eax
cmpl $0x1, %eax
cmovnel %ebx, %r14d
addl %ecx, %r14d
movslq %r14d, %rax
movl $0x0, (%rbp,%rax,4)
movl $0x1, %r8d
cmpq $0x2, %r15
jl 0x6c5d
movl $0x1, %edx
xorl %eax, %eax
movl $0x1, %ecx
movslq -0x4(%r13,%rcx,4), %r8
movslq (%r13,%rcx,4), %rsi
movl (%r12,%r8,4), %r10d
movb $0x1, %r11b
cmpl (%r12,%rsi,4), %r10d
jne 0x6c11
movl 0x4(%r12,%r8,4), %r10d
cmpl 0x4(%r12,%rsi,4), %r10d
jne 0x6c11
movl 0x8(%r12,%r8,4), %r8d
cmpl 0x8(%r12,%rsi,4), %r8d
setne %r11b
movzbl %r11b, %r10d
leaq (%rdx,%r10), %r8
xorb $0x1, %r10b
movzbl %r10b, %r10d
subl %r10d, %edx
imulq $0x55555556, %rsi, %r11 # imm = 0x55555556
movq %r11, %r10
shrq $0x3f, %r10
shrq $0x20, %r11
addl %r10d, %r11d
leal (%r11,%r11,2), %r10d
subl %r10d, %esi
cmpl $0x1, %esi
movl %ebx, %esi
cmovel %eax, %esi
addl %r11d, %esi
movslq %esi, %rsi
movl %edx, (%rbp,%rsi,4)
incq %rcx
movq %r8, %rdx
cmpq %rcx, %r15
jne 0x6be0
movq 0x20(%rsp), %rax
movq 0x18(%rsp), %rsi
leaq (%rax,%rsi,4), %r14
cmpq %r15, %r8
jge 0x6c9d
movq %rbp, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x6a9c
movq 0x18(%rsp), %rsi
movq 0x8(%rsp), %rdi
movq 0x58(%rdi), %r13
movl 0x14(%rsp), %r9d
movabsq $0x5555555555555556, %r8 # imm = 0x5555555555555556
jmp 0x6cc4
testq %r15, %r15
movl 0x14(%rsp), %r9d
jle 0x6cf7
xorl %eax, %eax
movabsq $0x5555555555555556, %r8 # imm = 0x5555555555555556
movslq (%rbp,%rax,4), %rcx
movl %eax, (%r14,%rcx,4)
incq %rax
cmpq %rax, %r15
jne 0x6cb3
testq %r15, %r15
setg %r10b
jle 0x6cf0
xorl %eax, %eax
xorl %ebp, %ebp
movl (%r14,%rax,4), %ecx
cmpl %ebx, %ecx
jge 0x6ce6
leal (%rcx,%rcx,2), %ecx
movslq %ebp, %rdx
incl %ebp
movl %ecx, (%r13,%rdx,4)
incq %rax
cmpq %rax, %r15
jne 0x6cd1
jmp 0x6d06
xorl %r10d, %r10d
xorl %ebp, %ebp
jmp 0x6d06
xorl %r10d, %r10d
xorl %ebp, %ebp
movabsq $0x5555555555555556, %r8 # imm = 0x5555555555555556
movq %rsi, %rax
imulq %r8
movq %rdx, %rax
shrq $0x3f, %rax
addq %rdx, %rax
leaq (%rax,%rax,2), %rax
movq %rsi, %rcx
subq %rax, %rcx
cmpq $0x1, %rcx
movl %r10d, 0x14(%rsp)
jne 0x6d37
decl %esi
movslq %ebp, %rax
incl %ebp
movl %esi, (%r13,%rax,4)
movq 0x40(%rdi), %rcx
movslq %ebp, %r8
movq %r12, %rsi
movq %r13, %rdx
movq %r8, 0x18(%rsp)
movq %rdi, %r13
callq 0x76d6
xorl %ecx, %ecx
movl 0x14(%rsp), %r11d
testb %r11b, %r11b
je 0x6e3f
movq 0x58(%r13), %rax
movq 0x70(%r13), %rdx
xorl %esi, %esi
movq %r13, %rdi
movl (%r14,%rsi,4), %r10d
xorl %r8d, %r8d
cmpl %ebx, %r10d
setl %r8b
movl %ebx, %r9d
cmovll %ecx, %r9d
subl %r9d, %r10d
leal (%r10,%r10,2), %r9d
subl %r8d, %r9d
addl $0x2, %r9d
movl %r9d, (%rax,%rsi,4)
movslq %r9d, %r8
movl %esi, (%rdx,%r8,4)
incq %rsi
cmpq %rsi, %r15
jne 0x6d6e
testl %ebp, %ebp
setle %al
xorb $0x1, %r11b
orb %al, %r11b
movq 0x20(%rsp), %r13
jne 0x6e4d
movq 0x40(%rdi), %rax
movq 0x58(%rdi), %rsi
xorl %ebx, %ebx
xorl %edx, %edx
xorl %ecx, %ecx
movq %rcx, %rbp
movq %rdx, %r14
movslq (%rsi,%rdx,4), %r8
imulq $0x55555556, %r8, %rcx  # imm = 0x55555556
movq %rcx, %rdx
shrq $0x3f, %rdx
shrq $0x20, %rcx
addl %edx, %ecx
leal (%rcx,%rcx,2), %ecx
movl %r8d, %esi
subl %ecx, %esi
movslq (%rax,%rbp,4), %rcx
movq %r12, %rdx
callq 0x77ba
movq 0x8(%rsp), %rdi
xorl %edx, %edx
xorl %ecx, %ecx
testl %eax, %eax
sete %dl
setne %cl
movq 0x40(%rdi), %rax
movq 0x58(%rdi), %rsi
leaq (%rax,%rbp,4), %r9
leaq (%rsi,%r14,4), %r8
cmovneq %r9, %r8
addq %rbp, %rcx
addq %r14, %rdx
movl (%r8), %r8d
movl %r8d, (%r13,%rbx,4)
incq %rbx
cmpq 0x18(%rsp), %rcx
jge 0x6e53
cmpq %r15, %rdx
jl 0x6dc9
jmp 0x6e53
xorl %edx, %edx
xorl %ebx, %ebx
movq %r13, %rdi
movq 0x20(%rsp), %r13
jmp 0x6e53
xorl %ecx, %ecx
xorl %edx, %edx
xorl %ebx, %ebx
movq 0x18(%rsp), %r10
movq %r10, %rax
subq %rcx, %rax
jle 0x6e8f
addq %rbx, %r10
subq %rcx, %r10
leaq (,%rbx,4), %rsi
addq %r13, %rsi
shlq $0x2, %rcx
addq 0x40(%rdi), %rcx
xorl %r9d, %r9d
movl (%rcx,%r9,4), %r8d
movl %r8d, (%rsi,%r9,4)
incq %r9
cmpq %r9, %rax
jne 0x6e7c
movq %r10, %rbx
subq %rdx, %r15
jle 0x6eb7
leaq (,%rbx,4), %rax
addq %r13, %rax
shlq $0x2, %rdx
addq 0x58(%rdi), %rdx
xorl %ecx, %ecx
movl (%rdx,%rcx,4), %esi
movl %esi, (%rax,%rcx,4)
incq %rcx
cmpq %rcx, %r15
jne 0x6ea9
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq