// File: 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
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x258(%rbp)
movq %rdi, %rax
movq %rax, -0x268(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x260(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x7f10
movq -0x258(%rbp), %rdi
movb $0x0, -0x29(%rbp)
callq 0x97a0
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
leaq -0x50(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x97f0
movq -0x258(%rbp), %rdi
movq -0x250(%rbp), %rsi
callq 0x97c0
jmp 0x843c
leaq -0x50(%rbp), %rdi
callq 0x9810
movq -0x260(%rbp), %rsi
leaq -0xa8(%rbp), %rdi
callq 0x82b0
jmp 0x845a
movq -0x260(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0x8190
jmp 0x846f
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0xc8(%rbp), %rdx
callq 0x9870
jmp 0x848b
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xa8(%rbp), %rdi
callq 0x31a0
leaq -0x88(%rbp), %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0xcc(%rbp)
movslq -0xcc(%rbp), %rax
movq %rax, -0x270(%rbp)
movq -0x68(%rbp), %rdi
callq 0x31e0
movq %rax, %rcx
movq -0x270(%rbp), %rax
cmpq %rcx, %rax
jae 0x860e
movq -0x258(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x9940
movq %rax, -0x280(%rbp)
leaq -0x110(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x33a0
movq -0x68(%rbp), %rdi
movslq -0xcc(%rbp), %rsi
callq 0x3300
movq -0x278(%rbp), %rsi
movsbl (%rax), %edx
leaq -0xf0(%rbp), %rdi
callq 0x6d70
jmp 0x8534
movq -0x280(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x9960
jmp 0x8549
leaq -0xf0(%rbp), %rdi
callq 0x31a0
leaq -0x110(%rbp), %rdi
callq 0x31a0
movl -0xcc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xcc(%rbp)
jmp 0x84b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x9810
jmp 0x8dee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8dee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x85c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x31a0
leaq -0xa8(%rbp), %rdi
callq 0x31a0
jmp 0x8dee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x85fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0xf0(%rbp), %rdi
callq 0x31a0
leaq -0x110(%rbp), %rdi
callq 0x31a0
jmp 0x8dbb
movl $0x0, -0x114(%rbp)
movslq -0x114(%rbp), %rax
movq %rax, -0x288(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x9680
movq %rax, %rcx
movq -0x288(%rbp), %rax
cmpq %rcx, %rax
jae 0x893a
leaq -0x130(%rbp), %rdi
callq 0x97f0
movl $0x0, -0x134(%rbp)
movslq -0x134(%rbp), %rax
movq %rax, -0x290(%rbp)
movq -0x68(%rbp), %rdi
callq 0x31e0
movq %rax, %rcx
movq -0x290(%rbp), %rax
cmpq %rcx, %rax
jae 0x88f4
movslq -0x114(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x96b0
movq %rax, -0x298(%rbp)
movq -0x68(%rbp), %rdi
movslq -0x134(%rbp), %rsi
callq 0x3300
movq -0x260(%rbp), %rcx
movq -0x298(%rbp), %rsi
movsbl (%rax), %edx
addq $0x20, %rcx
leaq -0x150(%rbp), %rdi
callq 0x4070
jmp 0x86cc
leaq -0x150(%rbp), %rdi
callq 0x4400
movq %rax, -0x2a0(%rbp)
jmp 0x86e1
movq -0x2a0(%rbp), %rdi
callq 0x48f0
cmpq $0x0, %rax
jbe 0x8834
movl $0x0, -0x154(%rbp)
movslq -0x154(%rbp), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x9680
movq %rax, %rcx
movq -0x2a8(%rbp), %rax
cmpq %rcx, %rax
jae 0x882f
movslq -0x154(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x96b0
movq %rax, %rdi
leaq -0x150(%rbp), %rsi
callq 0x4410
movb %al, -0x2a9(%rbp)
jmp 0x8752
movb -0x2a9(%rbp), %al
testb $0x1, %al
jne 0x8761
jmp 0x8819
movl -0x154(%rbp), %esi
leaq -0x198(%rbp), %rdi
callq 0x3750
jmp 0x8775
leaq 0x1ccff(%rip), %rsi     # 0x2547b
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rdx
callq 0x9990
jmp 0x8791
leaq -0x130(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x9960
jmp 0x87a6
leaq -0x178(%rbp), %rdi
callq 0x31a0
leaq -0x198(%rbp), %rdi
callq 0x31a0
jmp 0x882f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8929
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x88e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8808
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x31a0
leaq -0x198(%rbp), %rdi
callq 0x31a0
jmp 0x88e6
jmp 0x881b
movl -0x154(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x154(%rbp)
jmp 0x8701
jmp 0x88c6
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x3490
movq -0x2b8(%rbp), %rdx
leaq 0x1cbb9(%rip), %rsi     # 0x2540e
leaq -0x1b8(%rbp), %rdi
callq 0x3870
jmp 0x8863
leaq -0x130(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x9960
jmp 0x8878
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x1b9(%rbp), %rdi
callq 0x32e0
jmp 0x88c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x88b8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x31a0
leaq -0x1b9(%rbp), %rdi
callq 0x32e0
jmp 0x88e6
leaq -0x150(%rbp), %rdi
callq 0x4960
movl -0x134(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x134(%rbp)
jmp 0x8658
leaq -0x150(%rbp), %rdi
callq 0x4960
jmp 0x8929
movq -0x258(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0x99e0
jmp 0x8909
leaq -0x130(%rbp), %rdi
callq 0x9810
movl -0x114(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x114(%rbp)
jmp 0x8618
leaq -0x130(%rbp), %rdi
callq 0x9810
jmp 0x8dbb
movl $0x0, -0x1c0(%rbp)
movslq -0x1c0(%rbp), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x9680
movq %rax, %rcx
movq -0x2c0(%rbp), %rax
cmpq %rcx, %rax
jae 0x8da3
movslq -0x1c0(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x96b0
movq %rax, %rdi
callq 0x4400
movq %rax, -0x2c8(%rbp)
jmp 0x898f
movq -0x2c8(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movl $0x0, -0x1cc(%rbp)
movl $0x0, -0x1d0(%rbp)
movslq -0x1d0(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movq -0x1c8(%rbp), %rdi
callq 0x48f0
movq %rax, %rcx
movq -0x2d0(%rbp), %rax
cmpq %rcx, %rax
jae 0x8d6c
movq -0x1c8(%rbp), %rdi
movslq -0x1d0(%rbp), %rsi
callq 0x4920
movslq 0x28(%rax), %rax
movq %rax, -0x2d8(%rbp)
movq -0x1c8(%rbp), %rdi
movslq -0x1d0(%rbp), %rsi
callq 0x4920
movq %rax, %rdi
addq $0x8, %rdi
callq 0x33d0
movq %rax, %rcx
movq -0x2d8(%rbp), %rax
cmpq %rcx, %rax
je 0x8a40
jmp 0x8d58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x8dbb
movl $0x0, -0x1d4(%rbp)
movq -0x260(%rbp), %rdi
movslq -0x1d4(%rbp), %rax
movq %rax, -0x2e0(%rbp)
addq $0x20, %rdi
callq 0x48f0
movq %rax, %rcx
movq -0x2e0(%rbp), %rax
cmpq %rcx, %rax
jae 0x8d56
movq -0x1c8(%rbp), %rdi
movslq -0x1d0(%rbp), %rsi
callq 0x4920
movq -0x260(%rbp), %rdi
movsbl (%rax), %eax
movl %eax, -0x2e4(%rbp)
addq $0x20, %rdi
movslq -0x1d4(%rbp), %rsi
callq 0x4920
movq %rax, %rcx
movl -0x2e4(%rbp), %eax
movsbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0x8d40
movq -0x1c8(%rbp), %rdi
movslq -0x1d0(%rbp), %rsi
callq 0x4920
movq -0x260(%rbp), %rdi
addq $0x8, %rax
movq %rax, -0x2f0(%rbp)
addq $0x20, %rdi
movslq -0x1d4(%rbp), %rsi
callq 0x4920
movq -0x2f0(%rbp), %rdi
movq %rax, %rsi
addq $0x8, %rsi
callq 0x3d70
testb $0x1, %al
jne 0x8b13
jmp 0x8d40
movl -0x1cc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1cc(%rbp)
cmpl $0x0, -0x1d4(%rbp)
jne 0x8be2
movl $0x0, -0x1d8(%rbp)
movq -0x258(%rbp), %rdi
movslq -0x1d8(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movl -0x1c0(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x9940
movq %rax, %rdi
callq 0x9a50
movq %rax, %rcx
movq -0x2f8(%rbp), %rax
cmpq %rcx, %rax
jae 0x8bdd
movq -0x68(%rbp), %rdi
movslq -0x1d8(%rbp), %rsi
callq 0x3300
movsbl (%rax), %eax
cmpl $0x24, %eax
jne 0x8bc7
movq -0x258(%rbp), %rdi
movl -0x1c0(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x9940
movq %rax, %rdi
movslq -0x1d8(%rbp), %rsi
callq 0x9a70
movq %rax, %rdi
leaq 0x1c6d8(%rip), %rsi     # 0x25296
callq 0x3390
jmp 0x8bc5
jmp 0x8bc7
jmp 0x8bc9
movl -0x1d8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d8(%rbp)
jmp 0x8b39
jmp 0x8d3e
movq -0x260(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x82b0
jmp 0x8bf7
leaq -0x200(%rbp), %rdi
callq 0x31e0
movl %eax, -0x2fc(%rbp)
leaq -0x200(%rbp), %rdi
callq 0x31a0
movl -0x2fc(%rbp), %eax
movl %eax, -0x1dc(%rbp)
movl $0x0, -0x204(%rbp)
movl -0x204(%rbp), %eax
cmpl -0x1dc(%rbp), %eax
jge 0x8d3c
movq -0x258(%rbp), %rdi
movl -0x1c0(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x9940
movq %rax, %rdi
movslq -0x204(%rbp), %rsi
callq 0x9a70
movq %rax, %rdi
leaq 0x1c7a1(%rip), %rsi     # 0x2540e
callq 0x6de0
movb %al, -0x2fd(%rbp)
jmp 0x8c7a
movb -0x2fd(%rbp), %al
testb $0x1, %al
jne 0x8c89
jmp 0x8d26
movl -0x1d4(%rbp), %esi
leaq -0x248(%rbp), %rdi
callq 0x3750
jmp 0x8c9d
leaq 0x1c5f6(%rip), %rsi     # 0x2529a
leaq -0x228(%rbp), %rdi
leaq -0x248(%rbp), %rdx
callq 0x9990
jmp 0x8cb9
movq -0x258(%rbp), %rdi
movl -0x1c0(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x9940
movq %rax, %rdi
movslq -0x204(%rbp), %rsi
callq 0x9a70
movq %rax, %rdi
leaq -0x228(%rbp), %rsi
callq 0x3330
leaq -0x228(%rbp), %rdi
callq 0x31a0
leaq -0x248(%rbp), %rdi
callq 0x31a0
jmp 0x8d26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x31a0
jmp 0x8dbb
jmp 0x8d28
movl -0x204(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x204(%rbp)
jmp 0x8c2b
jmp 0x8d3e
jmp 0x8d40
jmp 0x8d42
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x8a4a
jmp 0x8d58
movl -0x1d0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d0(%rbp)
jmp 0x89b1
cmpl $0x1, -0x1cc(%rbp)
jle 0x8d8d
movq 0x2d264(%rip), %rax     # 0x35fe0
movq (%rax), %rdi
leaq 0x1c516(%rip), %rsi     # 0x2529c
movb $0x0, %al
callq 0x33b0
jmp 0x8d8f
movl -0x1c0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c0(%rbp)
jmp 0x8944
movb $0x1, -0x29(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31a0
testb $0x1, -0x29(%rbp)
jne 0x8dd5
jmp 0x8dc9
leaq -0x88(%rbp), %rdi
callq 0x31a0
jmp 0x8dee
movq -0x258(%rbp), %rdi
callq 0x9a90
leaq -0x28(%rbp), %rdi
callq 0x9740
movq -0x268(%rbp), %rax
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
movq -0x258(%rbp), %rdi
callq 0x9a90
leaq -0x28(%rbp), %rdi
callq 0x9740
movq -0x58(%rbp), %rdi
callq 0x3480
nopl (%rax)