// File: /workspace/github_cpp_makefile_star2_O3/kiven-li[P]xbytes/xbytes.cpp
// Function: xbytes::xbytes::dump_action_table()
void xbytes::dump_action_table()
{
	std::cout << "==============ACTION TABLE============" << std::endl;
	std::cout << "STATE 	";
	for(int i = 0; i < symbols.size(); ++i)
	{
		std::cout << symbols[i]->name << "	";
	}
	std::cout << std::endl;

	for(int i = 0; i < states.size(); ++i)
	{
		std::cout << i << "	";
		for(int j = 0; j < states[i]->actions.size(); ++j)
		{
			int valid_action_count = 0;
			action_array& aa = states[i]->actions[j];
			for(int m = 0; m < aa.size(); ++m)
			{
				assert(valid_action_count <= 1);
				action& act = aa[m];
				std::stringstream ss;
				switch(act.type)
				{
				case LR_ACTION_REDUCE:
					ss << "R" << act.r->index << "	";
					valid_action_count++;
					break;
				case LR_ACTION_SHIFT:
					ss << "S" << act.next_state << "	";
					valid_action_count++;
					break;
				case LR_ACTION_GOTO:
					ss << "G" << act.next_state << "	";
					valid_action_count++;
					break;
				case LR_ACTION_ACCEPT:
					ss << "accept" << "	";
					valid_action_count++;
					break;
				case LR_ACTION_ERROR:
					ss << "-	";
					valid_action_count++;
				}

				std::cout << ss.str();
			}
		}
		std::cout << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movq %rdi, %r12
movq 0x829c(%rip), %r13      # 0x10fd8
leaq 0x49b2(%rip), %rsi      # 0xd6f5
movl $0x26, %edx
movq %r13, %rdi
callq 0x32b0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
leaq 0x499d(%rip), %rsi      # 0xd71c
movl $0x7, %edx
movq %r13, %rdi
callq 0x32b0
movq 0x8(%r12), %rax
cmpq %rax, 0x10(%r12)
je 0x8de6
xorl %r15d, %r15d
movq 0x8236(%rip), %rbx      # 0x10fd8
leaq 0x48a6(%rip), %r14      # 0xd64f
movq (%rax,%r15,8), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
movq %rbx, %rdi
callq 0x32b0
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x32b0
incq %r15
movq 0x8(%r12), %rax
movq 0x10(%r12), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
cmpq %r15, %rcx
ja 0x8da9
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
movq 0x40(%r12), %rax
cmpq 0x38(%r12), %rax
je 0x90de
xorl %r14d, %r14d
movq %r12, -0x50(%rbp)
movq %r13, %rdi
movl %r14d, %esi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4810(%rip), %rsi      # 0xd64f
callq 0x32b0
movq 0x38(%r12), %rax
movq (%rax,%r14,8), %rdx
movq 0x50(%rdx), %rcx
cmpq %rcx, 0x58(%rdx)
je 0x909c
xorl %edi, %edi
movq %r14, -0x58(%rbp)
leaq (%rdi,%rdi,2), %rdx
movq (%rcx,%rdx,8), %rbx
cmpq %rbx, 0x8(%rcx,%rdx,8)
je 0x906f
movq %rdi, -0x60(%rbp)
leaq (%rcx,%rdx,8), %r15
xorl %r13d, %r13d
movl $0x8, %r12d
xorl %r14d, %r14d
cmpl $0x2, %r14d
jge 0x90f0
leaq -0x1e8(%rbp), %rdi
callq 0x3190
movl -0x8(%rbx,%r12), %eax
decl %eax
cmpl $0x4, %eax
ja 0x8fcf
leaq 0x41f7(%rip), %rcx      # 0xd0ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x4896(%rip), %rsi      # 0xd767
callq 0x32b0
movl -0x4(%rbx,%r12), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4759(%rip), %rsi      # 0xd64f
callq 0x32b0
jmp 0x8fcc
movl $0x2, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x485d(%rip), %rsi      # 0xd770
callq 0x32b0
jmp 0x8fcc
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x471a(%rip), %rsi      # 0xd64a
callq 0x32b0
movq (%rbx,%r12), %rax
movl (%rax), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x46f9(%rip), %rsi      # 0xd64f
callq 0x32b0
jmp 0x8fcc
movl $0x6, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x47f9(%rip), %rsi      # 0xd769
callq 0x32b0
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x46c7(%rip), %rsi      # 0xd64f
callq 0x32b0
jmp 0x8fcc
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x47c3(%rip), %rsi      # 0xd765
callq 0x32b0
movl -0x4(%rbx,%r12), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4688(%rip), %rsi      # 0xd64f
callq 0x32b0
incl %r14d
leaq -0x48(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x3340
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x7fea(%rip), %rdi      # 0x10fd8
callq 0x32b0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x900c
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3260
leaq -0x1e8(%rbp), %rdi
movq 0x7f9e(%rip), %rsi      # 0x10fb8
callq 0x31b0
leaq -0x168(%rbp), %rdi
callq 0x30c0
incq %r13
movq (%r15), %rbx
movq 0x8(%r15), %rax
subq %rbx, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x18, %r12
cmpq %r13, %rax
ja 0x8e88
movq -0x50(%rbp), %r12
movq 0x38(%r12), %rax
movq 0x7f71(%rip), %r13      # 0x10fd8
movq -0x58(%rbp), %r14
movq -0x60(%rbp), %rdi
incq %rdi
movq (%rax,%r14,8), %rdx
movq 0x50(%rdx), %rcx
movq 0x58(%rdx), %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
cmpq %rdi, %rdx
ja 0x8e61
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r13, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
incq %r14
movq 0x40(%r12), %rax
subq 0x38(%r12), %rax
sarq $0x3, %rax
cmpq %r14, %rax
ja 0x8e25
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x462d(%rip), %rdi      # 0xd724
leaq 0x40aa(%rip), %rsi      # 0xd1a8
leaq 0x4637(%rip), %rcx      # 0xd73c
movl $0x590, %edx            # imm = 0x590
callq 0x3150
jmp 0x912f
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x9132
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3260
jmp 0x9132
movq %rax, %rbx
movq 0x7e7f(%rip), %rsi      # 0x10fb8
leaq -0x1e8(%rbp), %rdi
callq 0x31b0
leaq -0x168(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x33d0
nop