// File: /workspace/github_cpp_makefile_star2_O3/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 0x9b01
movq %rsi, %r15
movq %rdi, %rbx
xorl %r14d, %r14d
movq %rsi, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
movl $0x2, %edx
movq %r15, %rdi
leaq 0x3f2c(%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 0x3f5a(%rip), %rsi      # 0xd870
callq 0x32b0
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdx
movq 0x50(%rdx), %rcx
cmpq %rcx, 0x58(%rdx)
je 0x9ac2
xorl %edi, %edi
movq %r14, -0x40(%rbp)
leaq (%rdi,%rdi,2), %rdx
movq (%rcx,%rdx,8), %r12
cmpq %r12, 0x8(%rcx,%rdx,8)
je 0x9a95
movq %rdi, -0x48(%rbp)
leaq (%rcx,%rdx,8), %rax
movq %rax, -0x50(%rbp)
xorl %r13d, %r13d
xorl %r14d, %r14d
xorl %ebx, %ebx
cmpl $0x2, %ebx
jge 0x9b10
movl (%r12,%r13), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x99bf
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
jae 0x9a4f
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3ece(%rip), %rsi      # 0xd85c
callq 0x32b0
movl (%r12,%r13), %esi
movq %r15, %rdi
callq 0x33b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3e66(%rip), %rsi      # 0xd817
callq 0x32b0
movq 0x8(%r12,%r13), %rax
movl (%rax), %esi
jmp 0x99fb
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3e8e(%rip), %rsi      # 0xd85c
callq 0x32b0
movl (%r12,%r13), %esi
movq %r15, %rdi
callq 0x33b0
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3e26(%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 0x3e4a(%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 0x995e
jmp 0x9a85
cmpl $0x5, %eax
jne 0x9a1d
movl $0x1, %edx
movq %r15, %rdi
leaq 0x3df9(%rip), %rsi      # 0xd85c
callq 0x32b0
movl (%r12,%r13), %esi
movq %r15, %rdi
callq 0x33b0
movl $0x4, %edx
movq %rax, %rdi
leaq 0x3ddb(%rip), %rsi      # 0xd85e
jmp 0x9a16
movq -0x38(%rbp), %rbx
movq 0x38(%rbx), %rax
movq -0x40(%rbp), %r14
movq -0x48(%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 0x9937
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 0x98d8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3c0d(%rip), %rdi      # 0xd724
leaq 0x368a(%rip), %rsi      # 0xd1a8
leaq 0x3cfd(%rip), %rcx      # 0xd822
movl $0x60b, %edx            # imm = 0x60B
callq 0x3150
nop