// File: kiven-li[P]xbytes/xbytes.cpp
// Function: xbytes::xbytes::dump_lr_state()
void xbytes::dump_lr_state()
{
	std::cout << "==============LR STATE============" << std::endl;
	for(int i = 0; i < states.size(); ++i)
	{
		lr_state* ls = states[i];
		std::cout << "STATE " << i << ":" << std::endl;
		for(int j = 0; j < ls->terms.size(); ++j)
		{
			rule* r = ls->terms[j]->r;
			int dot = ls->terms[j]->dot;
			string forwards = "";
			for(int m = 0; m < ls->terms[j]->forwards.size(); ++m)
			{
				forwards += ls->terms[j]->forwards[m]->name + ",";
			}
			std::cout << "	" << r->left->name << " -> ";
			int m = 0;
			for(m = 0; m < r->rights.size(); ++m)
			{
				if(m == dot) std::cout << "*";
				std::cout << " " << r->rights[m]->name; 
			}
			if(m == dot) std::cout << "*";
			std::cout << "	[" << forwards << "]" << std::endl;
		}
		std::cout << std::endl;
		for(goto_map::iterator it = ls->gotomap.begin(); it != ls->gotomap.end(); ++it)
		{
			std::cout << "	" << it->first->name << " GOTO " << it->second << std::endl;
		}
		std::cout << std::endl;		
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq 0x19807(%rip), %rdi     # 0x23fd8
leaq 0xeed7(%rip), %rsi      # 0x196af
callq 0x32e0
movq %rax, %rdi
movq 0x197e1(%rip), %rsi     # 0x23fc8
callq 0x3320
movl $0x0, -0xc(%rbp)
movq -0xa8(%rbp), %rdi
movslq -0xc(%rbp), %rax
movq %rax, -0xb0(%rbp)
addq $0x38, %rdi
callq 0xc550
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0xacc0
movq -0xa8(%rbp), %rdi
addq $0x38, %rdi
movslq -0xc(%rbp), %rsi
callq 0xc570
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq 0x19795(%rip), %rdi     # 0x23fd8
leaq 0xee88(%rip), %rsi      # 0x196d2
callq 0x32e0
movq %rax, %rdi
movl -0xc(%rbp), %esi
callq 0x34d0
movq %rax, %rdi
leaq 0xe923(%rip), %rsi      # 0x19187
callq 0x32e0
movq %rax, %rdi
movq 0x19755(%rip), %rsi     # 0x23fc8
callq 0x3320
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
callq 0xc590
movq %rax, %rcx
movq -0xb8(%rbp), %rax
cmpq %rcx, %rax
jae 0xabbe
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xc5b0
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xc5b0
movq (%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x2c(%rbp)
leaq -0x51(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0x34f0
movq -0xc0(%rbp), %rdx
leaq 0xed43(%rip), %rsi      # 0x19640
leaq -0x50(%rbp), %rdi
callq 0x3830
jmp 0xa908
leaq -0x51(%rbp), %rdi
callq 0x3340
movl $0x0, -0x68(%rbp)
movslq -0x68(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xc5b0
movq (%rax), %rdi
addq $0x10, %rdi
callq 0xc4d0
movq %rax, %rcx
movq -0xc8(%rbp), %rax
cmpq %rcx, %rax
jae 0xaa04
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xc5b0
movq (%rax), %rdi
addq $0x10, %rdi
movslq -0x68(%rbp), %rsi
callq 0xc4f0
movq (%rax), %rsi
addq $0x8, %rsi
leaq 0xee85(%rip), %rdx      # 0x19807
leaq -0x88(%rbp), %rdi
callq 0xd610
jmp 0xa990
leaq -0x50(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x33c0
jmp 0xa9a2
leaq -0x88(%rbp), %rdi
callq 0x31b0
movl -0x68(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x68(%rbp)
jmp 0xa918
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x51(%rbp), %rdi
callq 0x3340
jmp 0xacc9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
jmp 0xabb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x60(%rbp)
movl %eax, -0x64(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x31b0
jmp 0xabb0
movq 0x195cd(%rip), %rdi     # 0x23fd8
leaq 0xec2d(%rip), %rsi      # 0x1963f
callq 0x32e0
movq %rax, -0xd0(%rbp)
jmp 0xaa20
movq -0xd0(%rbp), %rdi
movq -0x28(%rbp), %rax
movq 0x8(%rax), %rsi
addq $0x8, %rsi
callq 0x3290
movq %rax, -0xd8(%rbp)
jmp 0xaa41
movq -0xd8(%rbp), %rdi
leaq 0xec8a(%rip), %rsi      # 0x196d9
callq 0x32e0
jmp 0xaa56
movl $0x0, -0x8c(%rbp)
movl $0x0, -0x8c(%rbp)
movslq -0x8c(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
callq 0xc4d0
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jae 0xab11
movl -0x8c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0xaab6
movq 0x19532(%rip), %rdi     # 0x23fd8
leaq 0xed57(%rip), %rsi      # 0x19804
callq 0x32e0
jmp 0xaab4
jmp 0xaab6
movq 0x1951b(%rip), %rdi     # 0x23fd8
leaq 0xeb01(%rip), %rsi      # 0x195c5
callq 0x32e0
movq %rax, -0xe8(%rbp)
jmp 0xaad2
movq -0x28(%rbp), %rdi
addq $0x30, %rdi
movslq -0x8c(%rbp), %rsi
callq 0xc4f0
movq -0xe8(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x3290
jmp 0xaafb
jmp 0xaafd
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0xaa6a
movl -0x8c(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jne 0xab33
movq 0x194b5(%rip), %rdi     # 0x23fd8
leaq 0xecda(%rip), %rsi      # 0x19804
callq 0x32e0
jmp 0xab31
jmp 0xab33
movq 0x1949e(%rip), %rdi     # 0x23fd8
leaq 0xeb1f(%rip), %rsi      # 0x19660
callq 0x32e0
movq %rax, -0xf0(%rbp)
jmp 0xab4f
movq -0xf0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x3290
movq %rax, -0xf8(%rbp)
jmp 0xab68
movq -0xf8(%rbp), %rdi
leaq 0xea52(%rip), %rsi      # 0x195c8
callq 0x32e0
movq %rax, -0x100(%rbp)
jmp 0xab84
movq -0x100(%rbp), %rdi
movq 0x19436(%rip), %rsi     # 0x23fc8
callq 0x3320
jmp 0xab99
leaq -0x50(%rbp), %rdi
callq 0x31b0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xa87f
leaq -0x50(%rbp), %rdi
callq 0x31b0
jmp 0xacc9
movq 0x19413(%rip), %rdi     # 0x23fd8
movq 0x193fc(%rip), %rsi     # 0x23fc8
callq 0x3320
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0xcd80
movq %rax, -0x98(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
callq 0xcde0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xcdb0
testb $0x1, %al
jne 0xac15
jmp 0xac9f
movq 0x193bc(%rip), %rdi     # 0x23fd8
leaq 0xea1c(%rip), %rsi      # 0x1963f
callq 0x32e0
movq %rax, -0x110(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xce10
movq -0x110(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x3290
movq %rax, %rdi
leaq 0xea86(%rip), %rsi      # 0x196de
callq 0x32e0
movq %rax, -0x108(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xce10
movq -0x108(%rbp), %rdi
movl 0x8(%rax), %esi
callq 0x34d0
movq %rax, %rdi
movq 0x1933f(%rip), %rsi     # 0x23fc8
callq 0x3320
leaq -0x98(%rbp), %rdi
callq 0xcec0
jmp 0xabe5
movq 0x19332(%rip), %rdi     # 0x23fd8
movq 0x1931b(%rip), %rsi     # 0x23fc8
callq 0x3320
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xa7f3
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
movq -0x60(%rbp), %rdi
callq 0x34e0
nopw %cs:(%rax,%rax)