// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, -0x38(%rbp)
movq 0x90d6(%rip), %rdi      # 0xefd8
leaq 0x47b6(%rip), %rsi      # 0xa6bf
callq 0x2220
movq %rax, %rdi
callq 0x2110
xorl %r14d, %r14d
leaq -0x80(%rbp), %rbx
movq -0x38(%rbp), %rcx
movq 0x38(%rcx), %rax
movq 0x40(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r14, %rcx
jbe 0x6178
movq (%rax,%r14,8), %rax
movq %rax, -0x30(%rbp)
movq 0x9090(%rip), %rdi      # 0xefd8
leaq 0x4793(%rip), %rsi      # 0xa6e2
callq 0x2220
movq %rax, %rdi
movq %r14, -0x40(%rbp)
movl %r14d, %esi
callq 0x2370
movq %rax, %rdi
leaq 0x422a(%rip), %rsi      # 0xa197
callq 0x2220
movq %rax, %rdi
callq 0x2110
xorl %r15d, %r15d
movq -0x30(%rbp), %rcx
movq 0x8(%rcx), %rax
movq 0x10(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
jbe 0x60f3
movq (%rax,%r15,8), %rax
movq (%rax), %r14
movl 0x8(%rax), %r13d
leaq -0x60(%rbp), %rdi
leaq 0x46a1(%rip), %rsi      # 0xa650
movq %rbx, %rdx
callq 0x25f4
xorl %r12d, %r12d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r15,8), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r12, %rcx
jbe 0x600a
movq (%rax,%r12,8), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
leaq 0x482b(%rip), %rdx      # 0xa817
callq 0x754a
leaq -0x60(%rbp), %rdi
movq %rbx, %rsi
callq 0x23c0
movq %rbx, %rdi
callq 0x2100
incq %r12
jmp 0x5fba
movq 0x8fc7(%rip), %rdi      # 0xefd8
leaq 0x4637(%rip), %rsi      # 0xa64f
callq 0x2220
movq 0x8(%r14), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
leaq 0x46b2(%rip), %rsi      # 0xa6e9
callq 0x2220
xorl %r12d, %r12d
movq 0x38(%r14), %rax
subq 0x30(%r14), %rax
sarq $0x3, %rax
cmpq %r12, %rax
jbe 0x6094
cmpq %r12, %r13
jne 0x6068
movq 0x8f7c(%rip), %rdi      # 0xefd8
leaq 0x47b1(%rip), %rsi      # 0xa814
callq 0x2220
movq 0x8f69(%rip), %rdi      # 0xefd8
leaq 0x455f(%rip), %rsi      # 0xa5d5
callq 0x2220
movq 0x30(%r14), %rcx
movq (%rcx,%r12,8), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2200
incq %r12
jmp 0x603f
cmpl %r12d, %r13d
jne 0x60ac
movq 0x8f38(%rip), %rdi      # 0xefd8
leaq 0x476d(%rip), %rsi      # 0xa814
callq 0x2220
movq 0x8f25(%rip), %rdi      # 0xefd8
leaq 0x45b6(%rip), %rsi      # 0xa670
callq 0x2220
movq %rax, %rdi
leaq -0x60(%rbp), %rsi
callq 0x2200
movq %rax, %rdi
leaq 0x4503(%rip), %rsi      # 0xa5d8
callq 0x2220
movq %rax, %rdi
callq 0x2110
leaq -0x60(%rbp), %rdi
callq 0x2100
incq %r15
jmp 0x5f7d
movq 0x8ede(%rip), %rdi      # 0xefd8
callq 0x2110
movq -0x30(%rbp), %r12
movq 0x38(%r12), %r15
addq $0x28, %r12
leaq 0x45db(%rip), %r14      # 0xa6ee
movq 0x8ebe(%rip), %rdi      # 0xefd8
cmpq %r12, %r15
je 0x6167
leaq 0x4529(%rip), %rsi      # 0xa64f
callq 0x2220
movq 0x20(%r15), %rsi
addq $0x8, %rsi
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
movq %r14, %rsi
callq 0x2220
movl 0x28(%r15), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
callq 0x2110
movq %r15, %rdi
callq 0x2180
movq %rax, %r15
jmp 0x6113
callq 0x2110
movq -0x40(%rbp), %r14
incq %r14
jmp 0x5f1d
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x619b
jmp 0x619b
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x2100
jmp 0x619e
jmp 0x619b
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x2100
movq %rbx, %rdi
callq 0x2380
nop