// File: 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
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x78(%rbp)
addq $0x10, %rdi
movq %rdi, -0xc0(%rbp)
movq -0x10(%rbp), %rsi
callq 0x87e0
movq -0x78(%rbp), %rdi
addq $0x28, %rdi
movq %rdi, -0xb8(%rbp)
callq 0xb5a0
movq -0x78(%rbp), %rdi
addq $0x40, %rdi
movq %rdi, -0xb0(%rbp)
callq 0xb5a0
movq -0x78(%rbp), %rdi
addq $0x58, %rdi
movq %rdi, -0xa8(%rbp)
callq 0xb5a0
movq -0x78(%rbp), %rdi
addq $0x70, %rdi
movq %rdi, -0xa0(%rbp)
callq 0xb5a0
movq -0x78(%rbp), %rdi
addq $0x88, %rdi
movq %rdi, -0x98(%rbp)
callq 0xb5a0
movq -0x78(%rbp), %rdi
addq $0xa0, %rdi
movq %rdi, -0x90(%rbp)
callq 0xdfa0
movq -0x78(%rbp), %rdi
addq $0xb8, %rdi
movq %rdi, -0x88(%rbp)
callq 0xdfa0
movq -0x78(%rbp), %rdi
addq $0xd0, %rdi
movq %rdi, -0x80(%rbp)
callq 0xdfa0
movq -0x78(%rbp), %rdi
addq $0x10, %rdi
callq 0xdfc0
movq %rax, %rcx
movq -0x78(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, 0x8(%rax)
movl $0x0, -0x14(%rbp)
movq -0x78(%rbp), %rcx
movslq -0x14(%rbp), %rax
cmpq (%rcx), %rax
jge 0xbad0
movq -0x78(%rbp), %rdi
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x8590
movq -0x78(%rbp), %rdi
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0xc8(%rbp)
addq $0x10, %rdi
movslq -0x14(%rbp), %rsi
callq 0x8590
movq -0xc8(%rbp), %rdi
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x8be0
movq %rax, %rcx
movq -0x78(%rbp), %rax
movl (%rcx), %ecx
movl %ecx, 0x8(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xba5d
movq -0x78(%rbp), %rdi
addq $0x10, %rdi
movl $0x0, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0xdfe0
jmp 0xbaea
movq -0x78(%rbp), %rax
movq (%rax), %rcx
incq %rcx
movq %rcx, (%rax)
movq %rax, %rdi
addq $0x10, %rdi
movq (%rax), %rax
leaq (%rax,%rax,2), %rsi
movl $0x0, -0x30(%rbp)
leaq -0x30(%rbp), %rdx
callq 0xe010
jmp 0xbb17
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0x28, %rdi
movq (%rax), %rax
leaq (%rax,%rax,2), %rsi
movl $0x0, -0x34(%rbp)
leaq -0x34(%rbp), %rdx
callq 0xe010
jmp 0xbb3b
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0x40, %rdi
movq (%rax), %rsi
movl $0x0, -0x38(%rbp)
leaq -0x38(%rbp), %rdx
callq 0xe010
jmp 0xbb5b
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0x58, %rdi
movq (%rax), %rsi
movl $0x0, -0x3c(%rbp)
leaq -0x3c(%rbp), %rdx
callq 0xe010
jmp 0xbb7b
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0x70, %rdi
movq (%rax), %rsi
movl $0x0, -0x40(%rbp)
leaq -0x40(%rbp), %rdx
callq 0xe010
jmp 0xbb9b
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0x88, %rdi
movq (%rax), %rsi
movl $0x0, -0x44(%rbp)
leaq -0x44(%rbp), %rdx
callq 0xe010
jmp 0xbbbe
movq -0x78(%rbp), %rdi
addq $0x10, %rdi
xorl %eax, %eax
movl %eax, %esi
movq %rsi, -0xd8(%rbp)
callq 0x8590
movq -0xd8(%rbp), %rsi
movq -0x78(%rbp), %rdi
movq %rax, -0xd0(%rbp)
addq $0x28, %rdi
callq 0x8590
movq -0x78(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq %rax, %rdx
movq (%rdi), %rcx
movl 0x8(%rdi), %r8d
callq 0xe0c0
jmp 0xbc0d
movq -0x78(%rbp), %rdi
addq $0x40, %rdi
movq %rdi, -0xe0(%rbp)
callq 0xe850
movq -0xe0(%rbp), %rdi
callq 0xe870
jmp 0xbc2f
movq -0x78(%rbp), %rdi
addq $0x58, %rdi
movq %rdi, -0xe8(%rbp)
callq 0xe850
movq -0xe8(%rbp), %rdi
callq 0xe870
jmp 0xbc51
movq -0x78(%rbp), %rdi
addq $0x70, %rdi
movq %rdi, -0xf0(%rbp)
callq 0xe850
movq -0xf0(%rbp), %rdi
callq 0xe870
jmp 0xbc73
movq -0x78(%rbp), %rdi
addq $0x88, %rdi
movq %rdi, -0xf8(%rbp)
callq 0xe850
movq -0xf8(%rbp), %rdi
callq 0xe870
jmp 0xbc98
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0x28, %rdi
movq (%rax), %rsi
callq 0xe890
jmp 0xbcad
movq -0x78(%rbp), %rdi
addq $0x28, %rdi
callq 0xe870
jmp 0xbcbc
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0xa0, %rdi
movq (%rax), %rsi
callq 0xe920
jmp 0xbcd4
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0xb8, %rdi
movq (%rax), %rsi
callq 0xe920
jmp 0xbcec
movq $0x0, -0x50(%rbp)
movq -0x78(%rbp), %rcx
movq -0x50(%rbp), %rax
cmpq (%rcx), %rax
jge 0xbdd2
movq -0x78(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x100(%rbp)
movq %rdi, %rax
addq $0xa0, %rax
movq %rax, -0x108(%rbp)
addq $0x28, %rdi
movq -0x50(%rbp), %rsi
callq 0x8590
movq -0x108(%rbp), %rdi
movslq (%rax), %rsi
callq 0x8570
movq -0x100(%rbp), %rcx
movq %rcx, (%rax)
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
jmp 0xbcf4
movq -0x80(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0xebc0
movq -0x88(%rbp), %rdi
callq 0xebc0
movq -0x90(%rbp), %rdi
callq 0xebc0
movq -0x98(%rbp), %rdi
callq 0x8640
movq -0xa0(%rbp), %rdi
callq 0x8640
movq -0xa8(%rbp), %rdi
callq 0x8640
movq -0xb0(%rbp), %rdi
callq 0x8640
movq -0xb8(%rbp), %rdi
callq 0x8640
movq -0xc0(%rbp), %rdi
callq 0x8640
jmp 0xbf55
movq $0x0, -0x58(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x78(%rbp), %rcx
movq -0x58(%rbp), %rax
cmpq (%rcx), %rax
jge 0xbf0e
movq -0x78(%rbp), %rdi
addq $0xa0, %rdi
movq -0x58(%rbp), %rsi
callq 0x8570
cmpq $0x0, (%rax)
jne 0xbe12
jmp 0xbeb6
cmpq $0x0, -0x68(%rbp)
je 0xbe27
movq -0x68(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0xbe29
jmp 0xbe29
movq -0x78(%rbp), %rdi
movq %rdi, %rax
addq $0x28, %rax
movq %rax, -0x110(%rbp)
addq $0xa0, %rdi
movq -0x58(%rbp), %rsi
callq 0x8570
movq -0x110(%rbp), %rdi
movq (%rax), %rsi
subq $0x1, %rsi
callq 0x8590
movslq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x78(%rbp), %rdi
addq $0x10, %rdi
movq -0x58(%rbp), %rsi
addq -0x68(%rbp), %rsi
callq 0x8590
movq -0x78(%rbp), %rdi
movl (%rax), %eax
movl %eax, -0x114(%rbp)
addq $0x10, %rdi
movq -0x60(%rbp), %rsi
addq -0x68(%rbp), %rsi
callq 0x8590
movq %rax, %rcx
movl -0x114(%rbp), %eax
cmpl (%rcx), %eax
jne 0xbeb4
jmp 0xbea6
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0xbe65
jmp 0xbeb6
movq -0x78(%rbp), %rdi
movq -0x68(%rbp), %rax
movq %rax, -0x120(%rbp)
movq %rdi, %rax
addq $0xb8, %rax
movq %rax, -0x128(%rbp)
addq $0xa0, %rdi
movq -0x58(%rbp), %rsi
movq %rsi, %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
callq 0x8570
movq -0x128(%rbp), %rdi
movq (%rax), %rsi
callq 0x8570
movq -0x120(%rbp), %rcx
movq %rcx, (%rax)
jmp 0xbde2
movq -0x78(%rbp), %rax
movq %rax, %rdi
addq $0xd0, %rdi
movq (%rax), %rax
leaq 0x5(%rax,%rax), %rsi
movq $0x0, -0x70(%rbp)
leaq -0x70(%rbp), %rdx
callq 0xe9b0
jmp 0xbf37
movq -0x78(%rbp), %rdi
movq (%rdi), %rdx
decq %rdx
xorl %eax, %eax
movl %eax, %esi
callq 0xea60
jmp 0xbf4c
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x3420
nop