// File: davidsun[P]TinyCompiler/LRAnalytics.cpp
// Function: LRAnalytics::genStates() const
vector <ItemSet> LRAnalytics::genStates() const{
    vector <ItemSet> ret;
    ret.push_back(_rules);
    int cur = 0;
    while (cur < ret.size()){
        for (int i = 0; i < _letters.size(); i ++){
            const ItemSet &p = ret[cur]; 
            ItemSet newSet = p.advance(_letters[i], _rules);
            int j;
            for (j = 0; j < ret.size(); j ++)
                if (newSet == ret[j]) break; 
            if (newSet.getItems().size() > 0 && j == ret.size()) ret.push_back(newSet);
        }
        cur ++;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x88(%rbp)
movq %rdi, %rax
movq %rax, -0x80(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movb $0x0, -0x11(%rbp)
callq 0x9630
movq -0x78(%rbp), %rsi
addq $0x20, %rsi
leaq -0x30(%rbp), %rdi
callq 0x4010
jmp 0x7f55
movq -0x88(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x9650
jmp 0x7f67
leaq -0x30(%rbp), %rdi
callq 0x4960
movl $0x0, -0x40(%rbp)
movq -0x88(%rbp), %rdi
movslq -0x40(%rbp), %rax
movq %rax, -0x90(%rbp)
callq 0x9680
movq %rax, %rcx
movq -0x90(%rbp), %rax
cmpq %rcx, %rax
jae 0x8153
movl $0x0, -0x44(%rbp)
movq -0x78(%rbp), %rdi
movslq -0x44(%rbp), %rax
movq %rax, -0x98(%rbp)
callq 0x31e0
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0x8145
movq -0x88(%rbp), %rdi
movslq -0x40(%rbp), %rsi
callq 0x96b0
movq -0x78(%rbp), %rdi
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0xa0(%rbp)
movslq -0x44(%rbp), %rsi
callq 0x3300
movq -0x78(%rbp), %rcx
movq -0xa0(%rbp), %rsi
movsbl (%rax), %edx
addq $0x20, %rcx
leaq -0x68(%rbp), %rdi
callq 0x4070
jmp 0x8018
movl $0x0, -0x6c(%rbp)
movq -0x88(%rbp), %rdi
movslq -0x6c(%rbp), %rax
movq %rax, -0xa8(%rbp)
callq 0x9680
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x80d0
movq -0x88(%rbp), %rdi
movslq -0x6c(%rbp), %rsi
callq 0x96b0
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
callq 0x4410
movb %al, -0xa9(%rbp)
jmp 0x806d
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x8079
jmp 0x80c0
jmp 0x80d0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x8176
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x4960
jmp 0x8176
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x4960
jmp 0x8176
jmp 0x80c2
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x801f
leaq -0x68(%rbp), %rdi
callq 0x4400
movq %rax, -0xb8(%rbp)
jmp 0x80e2
movq -0xb8(%rbp), %rdi
callq 0x48f0
cmpq $0x0, %rax
jbe 0x812e
movq -0x88(%rbp), %rdi
movslq -0x6c(%rbp), %rax
movq %rax, -0xc0(%rbp)
callq 0x9680
movq %rax, %rcx
movq -0xc0(%rbp), %rax
cmpq %rcx, %rax
jne 0x812e
movq -0x88(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x96d0
jmp 0x812c
jmp 0x812e
leaq -0x68(%rbp), %rdi
callq 0x4960
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x7fa8
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7f77
movb $0x1, -0x11(%rbp)
testb $0x1, -0x11(%rbp)
jne 0x8169
movq -0x88(%rbp), %rdi
callq 0x9740
movq -0x80(%rbp), %rax
addq $0xc0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x9740
movq -0x38(%rbp), %rdi
callq 0x3480
nopl (%rax,%rax)