// File: /workspace/github_cpp_makefile_star2_O2/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 %rsi, -0x30(%rbp)
movq %rdi, -0x38(%rbp)
xorl %ebx, %ebx
movq -0x38(%rbp), %rcx
movq 0x40(%rcx), %rax
subq 0x38(%rcx), %rax
sarq $0x3, %rax
cmpq %rbx, %rax
jbe 0x6b59
movq -0x30(%rbp), %rdi
leaq 0x3e40(%rip), %rsi      # 0xa813
callq 0x2220
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x4, 0x10(%rax,%rcx)
movq %rax, %rdi
movl %ebx, %esi
callq 0x2370
movq %rax, %rdi
leaq 0x3e74(%rip), %rsi      # 0xa870
callq 0x2220
xorl %esi, %esi
movq %rbx, -0x40(%rbp)
movq -0x38(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax,%rbx,8), %rax
movq 0x50(%rax), %r13
movq 0x58(%rax), %rax
subq %r13, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %rsi, %rax
jbe 0x6b48
movq %rsi, -0x48(%rbp)
imulq $0x18, %rsi, %rax
addq %rax, %r13
xorl %r14d, %r14d
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%r13), %rbx
movq 0x8(%r13), %rax
subq %rbx, %rax
cqto
pushq $0x18
popq %rcx
idivq %rcx
cmpq %r12, %rax
jbe 0x6b38
cmpl $0x2, %r15d
jge 0x6b68
movl (%rbx,%r14), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jb 0x6ab5
leal -0x3(%rax), %ecx
cmpl $0x2, %ecx
jae 0x6b0b
movq -0x30(%rbp), %rdi
leaq 0x3dd0(%rip), %rsi      # 0xa85c
callq 0x2220
movl (%rbx,%r14), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
leaq 0x3d70(%rip), %rsi      # 0xa817
callq 0x2220
movq 0x8(%rbx,%r14), %rcx
movl (%rcx), %esi
jmp 0x6ae5
movq -0x30(%rbp), %rdi
leaq 0x3d9c(%rip), %rsi      # 0xa85c
callq 0x2220
movl (%rbx,%r14), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
leaq 0x3d3c(%rip), %rsi      # 0xa817
callq 0x2220
movl 0x4(%rbx,%r14), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
leaq 0x3d69(%rip), %rsi      # 0xa860
callq 0x2220
incl %r15d
incq %r12
addq $0x18, %r14
jmp 0x6a43
cmpl $0x5, %eax
jne 0x6aff
movq -0x30(%rbp), %rdi
leaq 0x3d41(%rip), %rsi      # 0xa85c
callq 0x2220
movl (%rbx,%r14), %esi
movq %rax, %rdi
callq 0x2370
movq %rax, %rdi
leaq 0x3d28(%rip), %rsi      # 0xa85e
jmp 0x6af7
movq -0x48(%rbp), %rsi
incq %rsi
movq -0x40(%rbp), %rbx
jmp 0x6a07
movq -0x30(%rbp), %rdi
callq 0x2110
incq %rbx
jmp 0x69af
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3bb5(%rip), %rdi      # 0xa724
leaq 0x3632(%rip), %rsi      # 0xa1a8
leaq 0x3ca5(%rip), %rcx      # 0xa822
movl $0x60b, %edx            # imm = 0x60B
callq 0x2160
nop