// File: /workspace/github_cpp_makefile_star2_O1/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 0x8256(%rip), %r13      # 0x10fd8
leaq 0x496c(%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 0x4957(%rip), %rsi      # 0xd71c
movl $0x7, %edx
movq %r13, %rdi
callq 0x32b0
movq 0x8(%r12), %rax
cmpq %rax, 0x10(%r12)
je 0x8e2c
xorl %r15d, %r15d
movq 0x81f0(%rip), %rbx      # 0x10fd8
leaq 0x4860(%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 0x8def
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 0x9124
xorl %ebx, %ebx
movq %r12, -0x50(%rbp)
movq %r13, %rdi
movl %ebx, %esi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x47cc(%rip), %rsi      # 0xd64f
callq 0x32b0
movq 0x38(%r12), %rax
movq (%rax,%rbx,8), %rcx
movq 0x50(%rcx), %rax
cmpq %rax, 0x58(%rcx)
je 0x90db
xorl %esi, %esi
movq %rbx, -0x58(%rbp)
movq %rsi, -0x60(%rbp)
leaq (%rsi,%rsi,2), %rcx
movq (%rax,%rcx,8), %rbx
cmpq %rbx, 0x8(%rax,%rcx,8)
je 0x909d
leaq (%rax,%rcx,8), %r12
xorl %r13d, %r13d
movl $0x8, %r15d
xorl %r14d, %r14d
cmpl $0x2, %r14d
jge 0x9136
leaq -0x1e8(%rbp), %rdi
callq 0x3190
movl -0x8(%rbx,%r15), %eax
decl %eax
cmpl $0x4, %eax
ja 0x9013
leaq 0x41b3(%rip), %rcx      # 0xd0ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x4852(%rip), %rsi      # 0xd767
callq 0x32b0
movl -0x4(%rbx,%r15), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4715(%rip), %rsi      # 0xd64f
callq 0x32b0
jmp 0x9010
movl $0x2, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x4819(%rip), %rsi      # 0xd770
callq 0x32b0
jmp 0x9010
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x46d6(%rip), %rsi      # 0xd64a
callq 0x32b0
movq (%rbx,%r15), %rax
movl (%rax), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x46b5(%rip), %rsi      # 0xd64f
callq 0x32b0
jmp 0x9010
movl $0x6, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x47b5(%rip), %rsi      # 0xd769
callq 0x32b0
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x4683(%rip), %rsi      # 0xd64f
callq 0x32b0
jmp 0x9010
movl $0x1, %edx
leaq -0x1d8(%rbp), %rdi
leaq 0x477f(%rip), %rsi      # 0xd765
callq 0x32b0
movl -0x4(%rbx,%r15), %esi
leaq -0x1d8(%rbp), %rdi
callq 0x33b0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x4644(%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 0x7fa6(%rip), %rdi      # 0x10fd8
callq 0x32b0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x9050
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3260
leaq -0x1e8(%rbp), %rdi
movq 0x7f5a(%rip), %rsi      # 0x10fb8
callq 0x31b0
leaq -0x168(%rbp), %rdi
callq 0x30c0
incq %r13
movq (%r12), %rbx
movq 0x8(%r12), %rax
subq %rbx, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x18, %r15
cmpq %r13, %rax
ja 0x8ecc
movq -0x60(%rbp), %rsi
incq %rsi
movq -0x50(%rbp), %r12
movq 0x38(%r12), %rax
movq -0x58(%rbp), %rbx
movq (%rax,%rbx,8), %rcx
movq 0x50(%rcx), %rax
movq 0x58(%rcx), %rcx
subq %rax, %rcx
sarq $0x3, %rcx
movabsq $-0x5555555555555555, %rdx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rdx, %rcx
cmpq %rsi, %rcx
ja 0x8ea5
movq 0x7ef6(%rip), %r13      # 0x10fd8
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 %rbx
movq 0x40(%r12), %rax
subq 0x38(%r12), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
ja 0x8e6a
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x45e7(%rip), %rdi      # 0xd724
leaq 0x4064(%rip), %rsi      # 0xd1a8
leaq 0x45f1(%rip), %rcx      # 0xd73c
movl $0x590, %edx            # imm = 0x590
callq 0x3150
jmp 0x9175
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x9178
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x3260
jmp 0x9178
movq %rax, %rbx
movq 0x7e39(%rip), %rsi      # 0x10fb8
leaq -0x1e8(%rbp), %rdi
callq 0x31b0
leaq -0x168(%rbp), %rdi
callq 0x30c0
movq %rbx, %rdi
callq 0x33d0
nop