// File: 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
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movq -0x20(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movl $0x3, %ecx
cqto
idivq %rcx
movl %eax, -0x40(%rbp)
movq $0x0, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl $0x0, 0x4(%rax,%rcx,4)
movq -0x10(%rbp), %rax
movq -0x20(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x20(%rbp), %rax
jge 0xe1ae
movq -0x48(%rbp), %rax
movl $0x3, %ecx
cqto
idivq %rcx
cmpq $0x0, %rdx
je 0xe19e
movq -0x68(%rbp), %rdi
movq -0x48(%rbp), %rax
movl %eax, -0x6c(%rbp)
addq $0x40, %rdi
movq -0x60(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
callq 0x8590
movl -0x6c(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xe1a0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xe158
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x8, %rax
movq %rax, -0xa8(%rbp)
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x68(%rbp), %rdi
movq %rax, -0xa0(%rbp)
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0xa8(%rbp), %rsi
movq -0xa0(%rbp), %rdx
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movq -0x60(%rbp), %r8
movl -0x24(%rbp), %r9d
callq 0x10470
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x98(%rbp)
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x68(%rbp), %rdi
movq %rax, -0x90(%rbp)
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x98(%rbp), %rsi
movq -0x90(%rbp), %rdx
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movq -0x60(%rbp), %r8
movl -0x24(%rbp), %r9d
callq 0x10470
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x88(%rbp)
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x68(%rbp), %rdi
movq %rax, -0x80(%rbp)
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x68(%rbp), %rdi
movq %rax, %rcx
movq -0x60(%rbp), %r8
movl -0x24(%rbp), %r9d
callq 0x10470
movq -0x68(%rbp), %rdi
movq $0x1, -0x58(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, -0x70(%rbp)
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0xe30a
xorl %eax, %eax
movl %eax, -0xac(%rbp)
jmp 0xe313
movl -0x40(%rbp), %eax
movl %eax, -0xac(%rbp)
movq -0x78(%rbp), %rax
movl -0x70(%rbp), %ecx
movl -0xac(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movl $0x0, (%rax,%rcx,4)
movq $0x1, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xe461
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xc0(%rbp)
addq $0x58, %rdi
movq -0x48(%rbp), %rsi
subq $0x1, %rsi
callq 0x8590
movq -0x68(%rbp), %rdi
movslq (%rax), %rax
movq %rax, -0xb8(%rbp)
addq $0x58, %rdi
movq -0x48(%rbp), %rsi
callq 0x8590
movq -0x68(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
movslq (%rax), %rcx
callq 0x10650
cmpl $0x0, %eax
je 0xe3ad
movq -0x58(%rbp), %rax
subq $0x1, %rax
movq %rax, -0xc8(%rbp)
jmp 0xe3c3
movq -0x58(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0xc8(%rbp)
movq -0x68(%rbp), %rdi
movq -0xc8(%rbp), %rax
movl %eax, -0xdc(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0xd8(%rbp)
addq $0x58, %rdi
movq -0x48(%rbp), %rsi
callq 0x8590
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %eax, -0xcc(%rbp)
addq $0x58, %rdi
movq -0x48(%rbp), %rsi
callq 0x8590
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0xe426
xorl %eax, %eax
movl %eax, -0xe0(%rbp)
jmp 0xe42f
movl -0x40(%rbp), %eax
movl %eax, -0xe0(%rbp)
movq -0xd8(%rbp), %rax
movl -0xdc(%rbp), %edx
movl -0xcc(%rbp), %ecx
movl -0xe0(%rbp), %esi
addl %esi, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xe334
movq -0x58(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xe489
movq -0x68(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rax
movl %eax, %r8d
callq 0xe0c0
jmp 0xe4c4
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xe4c2
movq -0x48(%rbp), %rax
movl %eax, %edx
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
movq -0x48(%rbp), %rsi
movslq (%rcx,%rsi,4), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xe491
jmp 0xe4c4
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xe52b
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x40(%rbp), %eax
jge 0xe51b
movq -0x68(%rbp), %rdi
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
imull $0x3, (%rax,%rcx,4), %eax
movl %eax, -0xe4(%rbp)
addq $0x58, %rdi
movl -0x3c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x3c(%rbp)
movslq %eax, %rsi
callq 0x8590
movl -0xe4(%rbp), %ecx
movl %ecx, (%rax)
jmp 0xe51d
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xe4cc
movq -0x20(%rbp), %rax
movl $0x3, %ecx
cqto
idivq %rcx
cmpq $0x1, %rdx
jne 0xe570
movq -0x68(%rbp), %rdi
movq -0x20(%rbp), %rax
subq $0x1, %rax
movl %eax, -0xe8(%rbp)
addq $0x58, %rdi
movl -0x3c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x3c(%rbp)
movslq %eax, %rsi
callq 0x8590
movl -0xe8(%rbp), %ecx
movl %ecx, (%rax)
movq -0x68(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0xf8(%rbp)
addq $0x58, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x68(%rbp), %rdi
movq %rax, -0xf0(%rbp)
addq $0x40, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x8590
movq -0x68(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
movq %rax, %rcx
movslq -0x3c(%rbp), %r8
movl -0x24(%rbp), %r9d
callq 0x10470
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xe686
movq -0x68(%rbp), %rax
movq -0x48(%rbp), %rcx
movl %ecx, -0x104(%rbp)
addq $0x70, %rax
movq %rax, -0x100(%rbp)
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
cmpl -0x40(%rbp), %eax
jge 0xe61c
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
imull $0x3, (%rax,%rcx,4), %eax
addl $0x1, %eax
movl %eax, -0x108(%rbp)
jmp 0xe636
movq -0x38(%rbp), %rax
movq -0x48(%rbp), %rcx
movl (%rax,%rcx,4), %eax
subl -0x40(%rbp), %eax
imull $0x3, %eax, %eax
addl $0x2, %eax
movl %eax, -0x108(%rbp)
movq -0x68(%rbp), %rdi
movl -0x108(%rbp), %eax
movl %eax, -0x10c(%rbp)
addq $0x58, %rdi
movq -0x48(%rbp), %rsi
callq 0x8590
movq -0x100(%rbp), %rdi
movq %rax, %rcx
movl -0x10c(%rbp), %eax
movl %eax, (%rcx)
movslq %eax, %rsi
callq 0x8590
movl -0x104(%rbp), %ecx
movl %ecx, (%rax)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0xe5ce
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x48(%rbp), %rcx
movslq -0x3c(%rbp), %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x10d(%rbp)
jge 0xe6c4
movq -0x50(%rbp), %rax
cmpq -0x60(%rbp), %rax
setl %al
movb %al, -0x10d(%rbp)
movb -0x10d(%rbp), %al
testb $0x1, %al
jne 0xe6d3
jmp 0xe7bc
movq -0x68(%rbp), %rdi
addq $0x58, %rdi
movq -0x50(%rbp), %rsi
callq 0x8590
movq -0x68(%rbp), %rdi
movl (%rax), %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, -0x124(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x120(%rbp)
addq $0x40, %rdi
movq -0x48(%rbp), %rsi
callq 0x8590
movq -0x68(%rbp), %rdi
movslq (%rax), %rax
movq %rax, -0x118(%rbp)
addq $0x58, %rdi
movq -0x50(%rbp), %rsi
callq 0x8590
movq -0x68(%rbp), %rdi
movl -0x124(%rbp), %esi
movq -0x120(%rbp), %rdx
movq -0x118(%rbp), %rcx
movslq (%rax), %r8
callq 0x106d0
cmpl $0x0, %eax
je 0xe776
movq -0x68(%rbp), %rdi
addq $0x40, %rdi
movq -0x48(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
callq 0x8590
movl (%rax), %eax
movl %eax, -0x128(%rbp)
jmp 0xe79a
movq -0x68(%rbp), %rdi
addq $0x58, %rdi
movq -0x50(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
callq 0x8590
movl (%rax), %eax
movl %eax, -0x128(%rbp)
movl -0x128(%rbp), %edx
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xe69e
jmp 0xe7be
movq -0x48(%rbp), %rax
movslq -0x3c(%rbp), %rcx
cmpq %rcx, %rax
jge 0xe802
movq -0x68(%rbp), %rdi
addq $0x40, %rdi
movq -0x48(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
callq 0x8590
movl (%rax), %edx
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xe7be
jmp 0xe804
movq -0x50(%rbp), %rax
cmpq -0x60(%rbp), %rax
jge 0xe845
movq -0x68(%rbp), %rdi
addq $0x58, %rdi
movq -0x50(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
callq 0x8590
movl (%rax), %edx
movq -0x18(%rbp), %rax
movq -0x58(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xe804
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop