// File: /workspace/github_cpp_makefile_star2_O1/kiven-li[P]xbytes/xbytes.cpp
// Function: xbytes::xbytes::output_action_table(std::basic_ofstream<char, std::char_traits<char>>&)
void xbytes::output_action_table(std::ofstream& ss)
{
	for(int i = 0; i < states.size(); ++i)
	{
		ss << "/*" << std::setw(4) << 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];
				switch(act.type)
				{
				case LR_ACTION_ACCEPT:
				case LR_ACTION_REDUCE:
					ss << "{" << act.type << "," << act.r->index << "},";
					valid_action_count++;
					break;
				case LR_ACTION_SHIFT:
				case LR_ACTION_GOTO:
					ss << "{" << act.type << "," << act.next_state << "},";
					valid_action_count++;
					break;
				case LR_ACTION_ERROR:
					ss << "{" << act.type << ",0},";
					valid_action_count++;
					break;
				}
			}			
		}
		ss << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0x40(%rdi), %rax
cmpq 0x38(%rdi), %rax
je 0x9b47
movq %rsi, %r15
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rsi, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x3ee6(%rip), %rsi      # 0xd813
callq 0x32b0
movq (%r15), %rax
movq -0x18(%rax), %rax
movq $0x4, 0x10(%r15,%rax)
movq %r15, %rdi
movl %r14d, %esi
callq 0x33b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3f14(%rip), %rsi      # 0xd870
callq 0x32b0
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rcx
movq 0x50(%rcx), %rax
cmpq %rax, 0x58(%rcx)
je 0x9b08
xorl %esi, %esi
movq %r14, -0x40(%rbp)
movq %rsi, -0x48(%rbp)
leaq (%rsi,%rsi,2), %rcx
movq (%rax,%rcx,8), %r12
cmpq %r12, 0x8(%rax,%rcx,8)
je 0x9acb
leaq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpl $0x2, %ebx
jge 0x9b56
movl (%r12,%r13), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x9a05
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
jae 0x9a95
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3e88(%rip), %rsi      # 0xd85c
callq 0x32b0
movl (%r12,%r13), %esi
movq %r15, %rdi
callq 0x33b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3e20(%rip), %rsi      # 0xd817
callq 0x32b0
movq 0x8(%r12,%r13), %rax
movl (%rax), %esi
jmp 0x9a41
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3e48(%rip), %rsi      # 0xd85c
callq 0x32b0
movl (%r12,%r13), %esi
movq %r15, %rdi
callq 0x33b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3de0(%rip), %rsi      # 0xd817
callq 0x32b0
movl 0x4(%r12,%r13), %esi
movq %r15, %rdi
movq -0x30(%rbp), %r15
callq 0x33b0
movl $0x2, %edx
movq %rax, %rdi
leaq 0x3e04(%rip), %rsi      # 0xd860
callq 0x32b0
incl %ebx
incq %r14
movq -0x50(%rbp), %rax
movq (%rax), %r12
movq 0x8(%rax), %rax
subq %r12, %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rcx, %rax
addq $0x18, %r13
cmpq %r14, %rax
ja 0x99a4
jmp 0x9acb
cmpl $0x5, %eax
jne 0x9a63
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3db3(%rip), %rsi      # 0xd85c
callq 0x32b0
movl (%r12,%r13), %esi
movq %r15, %rdi
callq 0x33b0
movl $0x4, %edx
movq %rax, %rdi
leaq 0x3d95(%rip), %rsi      # 0xd85e
jmp 0x9a5c
movq -0x48(%rbp), %rsi
incq %rsi
movq -0x38(%rbp), %rbx
movq 0x38(%rbx), %rax
movq -0x40(%rbp), %r14
movq (%rax,%r14,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 0x997d
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x3230
movsbl %al, %esi
movq %r15, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3170
incq %r14
movq 0x40(%rbx), %rax
subq 0x38(%rbx), %rax
sarq $0x3, %rax
cmpq %r14, %rax
ja 0x991e
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3bc7(%rip), %rdi      # 0xd724
leaq 0x3644(%rip), %rsi      # 0xd1a8
leaq 0x3cb7(%rip), %rcx      # 0xd822
movl $0x60b, %edx            # imm = 0x60B
callq 0x3150
nop