// File: /workspace/github_cpp_makefile_star2_O2/davidsun[P]TinyCompiler/LRAnalytics.cpp
// Function: LRAnalytics::genTable[abi:cxx11]() const
vector <vector <string> > LRAnalytics::genTable() const{
    vector <ItemSet> states = genStates();
    vector <vector <string> > ret;
    ret.push_back(vector <string>());
    const string &str = getTerminals() + getNonTerminals();
    for (int i = 0; i < str.size(); i ++) ret[0].push_back(string() + str[i]);
    for (int i = 0; i < states.size(); i ++){
        vector <string> newJump;
        for (int j = 0; j < str.size(); j ++){
            ItemSet newSet = states[i].advance(str[j], _rules);
            if (newSet.getItems().size() > 0){
                for (int k = 0; k < states.size(); k ++){
                    if (states[k] == newSet){
                        newJump.push_back("s" + Utils::toString(k));
                        break;
                    }
                }
            }  else {
                newJump.push_back("");
            }
        }
        ret.push_back(newJump);
    }
    for (int i = 0; i < states.size(); i ++){
        const vector <Item> &items = states[i].getItems();
        int found = 0;
        for (int j = 0; j < items.size(); j ++){
            if (items[j].position != items[j].right_side.length()) continue;
            for (int k = 0; k < _rules.size(); k ++){
                if (items[j].left_side == _rules[k].left_side && items[j].right_side == _rules[k].right_side){
                    found ++;
                    if (k == 0){
                        for (int l = 0; l < ret[i + 1].size(); l ++)
                            if (str[l] == INPUT_END_LETTER) ret[i + 1][l] = "acc";
                    }  else {
                        /*
                         * Notice here, here r is added to all items in this row for convenience, but not to FOLLOW(state) in normal cases.
                         */
                        int t_size = getTerminals().size();
                        for (int l = 0; l < t_size; l ++) 
                            if (ret[i + 1][l] == "") ret[i + 1][l] = "r" + Utils::toString(k);
                    }
                }
            }
        }
        if (found > 1) fprintf(stderr, "WARNING: wrong grammar!\n");
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3b9e
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
andq $0x0, 0x10(%rbx)
leaq 0x70(%rsp), %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movq %rbx, 0x8(%rsp)
movq %rbx, %rdi
callq 0x510c
leaq 0x70(%rsp), %rdi
callq 0x48d0
leaq 0x90(%rsp), %rdi
movq %r14, %rsi
callq 0x3d90
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x3cfc
movq %r14, 0x20(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x30(%rsp), %rdx
callq 0x48f1
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x20f0
leaq 0x90(%rsp), %r15
movq %r15, %rdi
callq 0x20f0
leaq 0x40(%rsp), %rbx
xorl %r13d, %r13d
cmpq %r13, 0x78(%rsp)
jbe 0x3f2c
movq %rbx, 0x30(%rsp)
andq $0x0, 0x38(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %r12
movb $0x0, 0x40(%rsp)
movq 0x70(%rsp), %rax
movsbl (%rax,%r13), %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x36a2
movq %r12, %rdi
movq %r15, %rsi
callq 0x531e
movq %r15, %rdi
callq 0x20f0
movq %r14, %rdi
callq 0x20f0
incq %r13
jmp 0x3ed8
movq 0x20(%rsp), %rax
addq $0x20, %rax
movq %rax, 0x18(%rsp)
xorl %r8d, %r8d
leaq 0xe0(%rsp), %r15
leaq 0x90(%rsp), %r13
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rcx
movq %rcx, %rax
subq %rdi, %rax
cqto
pushq $0x18
popq %rsi
idivq %rsi
cmpq %r8, %rax
jbe 0x40a9
andq $0x0, 0xc0(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xb0(%rsp)
movq %r8, 0x28(%rsp)
imulq $0x18, %r8, %rbp
xorl %r14d, %r14d
cmpq %r14, 0x78(%rsp)
jbe 0x407f
movq 0x50(%rsp), %rsi
addq %rbp, %rsi
movq 0x70(%rsp), %rax
movsbl (%rax,%r14), %edx
movq %r15, %rdi
movq 0x18(%rsp), %rcx
callq 0x2856
movq %r15, %rdi
callq 0x2a5e
movq 0x8(%rax), %rcx
cmpq (%rax), %rcx
je 0x4004
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rax
subq %rdi, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x406f
addq %rbx, %rdi
movq %r15, %rsi
callq 0x2a62
testb %al, %al
jne 0x402d
incq %r12
addq $0x18, %rbx
jmp 0x3fce
movq %r13, %rdi
leaq 0x9248(%rip), %rsi      # 0xd256
leaq 0x30(%rsp), %rdx
callq 0x25ae
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
callq 0x531e
movq %r13, %rdi
jmp 0x406a
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x2536
movq %r13, %rdi
leaq 0x927c(%rip), %rsi      # 0xd2c3
movq %rbx, %rdx
callq 0x4958
leaq 0xb0(%rsp), %rdi
movq %r13, %rsi
callq 0x531e
movq %r13, %rdi
callq 0x20f0
movq %rbx, %rdi
callq 0x20f0
movq %r15, %rdi
callq 0x2cd2
incq %r14
jmp 0x3f8e
movq 0x8(%rsp), %rdi
leaq 0xb0(%rsp), %rbx
movq %rbx, %rsi
callq 0x497c
movq %rbx, %rdi
callq 0x48d0
movq 0x28(%rsp), %r8
incq %r8
jmp 0x3f4d
pushq $0x30
popq %r15
leaq 0x901f(%rip), %r13      # 0xd0d3
movq $0x0, 0x18(%rsp)
movq 0x20(%rsp), %rbx
subq %rdi, %rcx
movq %rcx, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
movq 0x18(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x431f
movq %rcx, %rax
imulq $0x18, %rcx, %rcx
movq %rcx, 0x28(%rsp)
addq %rcx, %rdi
movq %rax, %r14
callq 0x2a5e
movq %rax, 0x68(%rsp)
incq %r14
movq %r14, 0x18(%rsp)
xorl %esi, %esi
movl $0x0, 0x14(%rsp)
movq 0x68(%rsp), %rax
movq (%rax), %rcx
movq 0x8(%rax), %rax
subq %rcx, %rax
cqto
idivq %r15
cmpq %rsi, %rax
jbe 0x42eb
imulq $0x30, %rsi, %rdx
movslq 0x28(%rcx,%rdx), %rax
cmpq %rax, 0x10(%rcx,%rdx)
jne 0x42e3
movq %rdx, 0xd8(%rsp)
movq %rsi, 0xd0(%rsp)
xorl %r12d, %r12d
movq 0x20(%rbx), %rsi
movq 0x28(%rbx), %rax
subq %rsi, %rax
cqto
idivq %r15
cmpq %r12, %rax
jbe 0x42db
movq 0x68(%rsp), %rax
movq (%rax), %rdi
movq 0xd8(%rsp), %rdx
movb (%rdi,%rdx), %cl
imulq $0x30, %r12, %rax
cmpb (%rsi,%rax), %cl
jne 0x42d3
addq %rdx, %rdi
addq %rax, %rsi
addq $0x8, %rdi
addq $0x8, %rsi
callq 0x274e
testb %al, %al
je 0x42d3
movl 0x14(%rsp), %ebp
incl %ebp
testq %r12, %r12
movl %ebp, 0x14(%rsp)
je 0x4282
leaq 0x90(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3d90
movl 0x98(%rsp), %r15d
movq %r14, %rdi
callq 0x20f0
testl %r15d, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
shlq $0x5, %r15
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x4270
movq 0x8(%rsp), %rax
movq (%rax), %rax
imulq $0x18, 0x18(%rsp), %r13
movq (%rax,%r13), %rdi
addq %rbx, %rdi
leaq 0x9049(%rip), %rsi      # 0xd256
callq 0x36c4
testb %al, %al
je 0x4267
leaq 0x30(%rsp), %rbp
movq %rbp, %rdi
movl %r12d, %esi
callq 0x2536
leaq 0x90(%rsp), %r14
movq %r14, %rdi
leaq 0x8e9f(%rip), %rsi      # 0xd0d7
movq %rbp, %rdx
callq 0x4958
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq (%rax,%r13), %rdi
addq %rbx, %rdi
movq %r14, %rsi
callq 0x2220
movq %r14, %rdi
callq 0x20f0
movq %rbp, %rdi
callq 0x20f0
addq $0x20, %rbx
jmp 0x41ec
movq 0x20(%rsp), %rbx
pushq $0x30
popq %r15
leaq 0x8e53(%rip), %r13      # 0xd0d3
jmp 0x42d3
xorl %ebx, %ebx
xorl %r15d, %r15d
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq 0x28(%rsp), %rcx
movq 0x18(%rax,%rcx), %rdi
movq 0x20(%rax,%rcx), %rax
subq %rdi, %rax
sarq $0x5, %rax
cmpq %r15, %rax
jbe 0x42ca
movq 0x70(%rsp), %rax
cmpb $0x24, (%rax,%r15)
jne 0x42c1
addq %rbx, %rdi
movq %r13, %rsi
callq 0x2370
incq %r15
addq $0x20, %rbx
jmp 0x4287
movq 0x20(%rsp), %rbx
pushq $0x30
popq %r15
incq %r12
jmp 0x4150
movq 0xd0(%rsp), %rsi
incq %rsi
jmp 0x410c
cmpl $0x1, 0x14(%rsp)
jg 0x4301
movq 0x50(%rsp), %rdi
movq 0x58(%rsp), %rcx
jmp 0x40c2
movq 0xfcd8(%rip), %rax      # 0x13fe0
movq (%rax), %rcx
leaq 0x8dc7(%rip), %rdi      # 0xd0d9
pushq $0x18
popq %rsi
pushq $0x1
popq %rdx
callq 0x2380
jmp 0x42f2
leaq 0x70(%rsp), %rdi
callq 0x20f0
leaq 0x50(%rsp), %rdi
callq 0x48ae
movq 0x8(%rsp), %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x20f0
jmp 0x435c
movq %rax, %r14
leaq 0x90(%rsp), %rdi
jmp 0x440e
movq %rax, %r14
jmp 0x4413
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x48d0
jmp 0x4413
jmp 0x43f7
jmp 0x43cd
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x20f0
jmp 0x43ff
jmp 0x43fc
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x20f0
jmp 0x43b0
movq %rax, %r14
leaq 0x30(%rsp), %rdi
jmp 0x43c4
jmp 0x43d6
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x20f0
jmp 0x43d9
jmp 0x43d6
movq %rax, %r14
jmp 0x43e6
jmp 0x43d6
jmp 0x43f7
movq %rax, %r14
leaq 0xe0(%rsp), %rdi
callq 0x2cd2
leaq 0xb0(%rsp), %rdi
callq 0x48d0
jmp 0x4409
jmp 0x43f7
movq %rax, %r14
jmp 0x4409
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x20f0
leaq 0x70(%rsp), %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
callq 0x49a8
leaq 0x50(%rsp), %rdi
callq 0x48ae
movq %r14, %rdi
callq 0x2330
nop