// File: /workspace/github_cpp_makefile_star2_O3/shangjingbo1226[P]MACFP/src/methods/../utils/suffix_array.h
// Function: SuffixArray::SuffixArray(std::vector<int, std::allocator<int>> const&)
SuffixArray(const vector<int> &str) : s(str) {
        n = s.size();
        m = 0;
        for (int i = 0; i < n; ++ i) {
            ++ s[i];
            m = max(m, s[i] + 1);
        }
        s.push_back(0);
        ++ n;

        s.resize(n * 3, 0);
        sa.resize(n * 3, 0);
        wa.resize(n, 0);
        wb.resize(n, 0);
        wv.resize(n, 0);
        wss.resize(n, 0);

        dc3(&s[0], &sa[0], n, m);

        wa.clear(); wa.shrink_to_fit();
        wb.clear(); wb.shrink_to_fit();
        wv.clear(); wv.shrink_to_fit();
        wss.clear(); wss.shrink_to_fit();

        sa.resize(n); sa.shrink_to_fit();

        rank.resize(n);
        height.resize(n);
        for (long long i = 0; i < n; ++ i) {
            rank[sa[i]] = i;
        }
        for (long long i = 0, j, k = 0; i < n; height[rank[i ++]] = k) {
            if (rank[i] == 0) {
                continue;
            }
            for (k ? -- k : 0, j = sa[rank[i] - 1]; s[i + k] == s[j + k]; ++ k);
        }

        segment_tree.resize(n * 2 + 5, 0);
        build_tree(0, n - 1);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
addq $0x10, %rdi
movq %rdi, 0x8(%rsp)
callq 0x5858
leaq 0x28(%rbx), %r15
movl $0xc0, %edx
movq %r15, %rdi
xorl %esi, %esi
callq 0x2110
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rsi
movq %rsi, %rax
subq %rcx, %rax
sarq $0x2, %rax
movq %rax, (%rbx)
movl $0x0, 0x8(%rbx)
testq %rax, %rax
jle 0x6353
xorl %edx, %edx
movl (%rcx,%rdx,4), %edi
leal 0x1(%rdi), %r8d
movl %r8d, (%rcx,%rdx,4)
addl $0x2, %edi
movl 0x8(%rbx), %r8d
cmpl %edi, %r8d
cmovgl %r8d, %edi
movl %edi, 0x8(%rbx)
incq %rdx
cmpq %rdx, %rax
jne 0x632f
leaq 0x40(%rbx), %r12
leaq 0x58(%rbx), %r14
leaq 0x70(%rbx), %r13
leaq 0x88(%rbx), %rbp
leaq 0xa0(%rbx), %rcx
movq %rcx, 0x10(%rsp)
leaq 0xb8(%rbx), %rcx
movq %rcx, 0x18(%rsp)
leaq 0xd0(%rbx), %rcx
movq %rcx, 0x20(%rsp)
movl $0x0, (%rsp)
cmpq 0x20(%rbx), %rsi
movq %r12, 0x30(%rsp)
movq %rbp, 0x28(%rsp)
je 0x63b1
movl $0x0, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rbx)
jmp 0x63c1
movq %rsp, %rdx
movq 0x8(%rsp), %rdi
callq 0x7016
movq (%rbx), %rax
incq %rax
movq %rax, (%rbx)
leaq (%rax,%rax,2), %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq 0x8(%rsp), %rdi
callq 0x6a68
movq (%rbx), %rax
leaq (%rax,%rax,2), %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq %r15, %rdi
callq 0x6a68
movq (%rbx), %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq %r12, %rdi
callq 0x6a68
movq (%rbx), %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq %r14, %rdi
callq 0x6a68
movq (%rbx), %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq %r13, %rdi
callq 0x6a68
movq (%rbx), %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq %rbp, %rdi
callq 0x6a68
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %rdx
movq (%rbx), %rcx
movl 0x8(%rbx), %r8d
movq %rbx, %rdi
callq 0x6a9c
movq 0x40(%rbx), %rax
cmpq %rax, 0x48(%rbx)
je 0x646b
movq %rax, 0x48(%rbx)
cmpq %rax, 0x50(%rbx)
je 0x6479
movq %r12, %rdi
callq 0x780c
movq 0x58(%rbx), %rax
cmpq %rax, 0x60(%rbx)
je 0x6487
movq %rax, 0x60(%rbx)
cmpq %rax, 0x68(%rbx)
je 0x6495
movq %r14, %rdi
callq 0x780c
movq 0x70(%rbx), %rax
cmpq %rax, 0x78(%rbx)
je 0x64a3
movq %rax, 0x78(%rbx)
cmpq %rax, 0x80(%rbx)
je 0x64b4
movq %r13, %rdi
callq 0x780c
movq 0x88(%rbx), %rax
cmpq %rax, 0x90(%rbx)
je 0x64cb
movq %rax, 0x90(%rbx)
cmpq %rax, 0x98(%rbx)
je 0x64dc
movq %rbp, %rdi
callq 0x780c
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x6ec6
movq 0x38(%rbx), %rax
cmpq 0x30(%rbx), %rax
je 0x64f9
movq %r15, %rdi
callq 0x780c
movq (%rbx), %rsi
movq 0x10(%rsp), %rdi
callq 0x6ef8
movq (%rbx), %rsi
movq 0x18(%rsp), %rdi
callq 0x6ef8
movq (%rbx), %r10
testq %r10, %r10
jle 0x65b3
movq (%r15), %rax
movq 0x10(%rsp), %rcx
movq (%rcx), %rcx
xorl %edx, %edx
movslq (%rax,%rdx,4), %rsi
movq %rdx, (%rcx,%rsi,8)
incq %rdx
movq (%rbx), %r10
cmpq %r10, %rdx
jl 0x652c
testq %r10, %r10
jle 0x65b3
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%r15), %rcx
movq 0x8(%rsp), %rdx
movq (%rdx), %rdx
movq 0x18(%rsp), %rsi
movq (%rsi), %rsi
xorl %ebp, %ebp
movq %rdx, %rdi
xorl %r9d, %r9d
movq (%rax,%r9,8), %r10
testq %r10, %r10
je 0x65a0
movslq -0x4(%rcx,%r10,4), %r8
leaq (%rdx,%r8,4), %r11
cmpq $0x1, %rbp
movl $0x1, %r8d
cmovbq %rbp, %r8
notq %r8
addq %rbp, %r8
movl 0x4(%rdi,%r8,4), %r12d
leaq 0x1(%r8), %rbp
cmpl 0x4(%r11,%r8,4), %r12d
movq %rbp, %r8
je 0x658d
incq %r9
movq %rbp, (%rsi,%r10,8)
movq (%rbx), %r10
addq $0x4, %rdi
cmpq %r10, %r9
jl 0x6567
leaq 0x5(,%r10,2), %rsi
movq %rsp, %rdx
movq $0x0, (%rdx)
movq 0x20(%rsp), %rdi
callq 0x6f2a
movq (%rbx), %rdx
decq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x6f5e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x65fe
jmp 0x65fe
jmp 0x65fe
jmp 0x65fe
jmp 0x65fe
jmp 0x65fe
jmp 0x65fe
jmp 0x65fe
movq %rax, %r12
movq 0x20(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x661d
movq 0xe0(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x18(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6639
movq 0xc8(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x10(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6655
movq 0xb0(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x28(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6671
movq 0x98(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq (%r13), %rdi
testq %rdi, %rdi
je 0x6689
movq 0x80(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq (%r14), %rdi
testq %rdi, %rdi
je 0x669d
movq 0x68(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x30(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x66b6
movq 0x50(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq (%r15), %rdi
testq %rdi, %rdi
je 0x66ca
movq 0x38(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq 0x8(%rsp), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x66e3
movq 0x20(%rbx), %rsi
subq %rdi, %rsi
callq 0x21f0
movq %r12, %rdi
callq 0x2330
nop