// File: kiven-li[P]xbytes/xbytes.cpp
// Function: xbytes::xbytes::output_rule_table(std::basic_ofstream<char, std::char_traits<char>>&)
void xbytes::output_rule_table(std::ofstream& ss)
{
	for(int i = 0; i < rules.size(); ++i)
	{	
		ss << "/*"<< std::setw(4)  << i << "*/{\"";

		ss << (rules[i]->left)->name;
		if(rules[i]->left_alias.size() > 0)
		{
			ss << "(" << rules[i]->left_alias << ")";
		}
		ss <<" ->";
		for(int j = 0; j < rules[i]->rights.size(); ++j)
		{
			ss << " " << rules[i]->rights[j]->name;
			if(rules[i]->right_alias[j].size() > 0)
			{
				ss << "(" << rules[i]->right_alias[j] << ")";
			}
		}

		ss << "\", " << rules[i]->left->index << ", ";
		ss << rules[i]->rights.size() << "}," << std::endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x14(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0x20, %rdi
callq 0xc510
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0xb8b2
movq -0x10(%rbp), %rdi
leaq 0xe1e4(%rip), %rsi      # 0x19803
callq 0x32e0
movq %rax, -0x40(%rbp)
movl $0x4, %edi
callq 0xd690
movq -0x40(%rbp), %rdi
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %esi
callq 0x3380
movq %rax, %rdi
movl -0x14(%rbp), %esi
callq 0x34d0
movq %rax, %rdi
leaq 0xe1b3(%rip), %rsi      # 0x19809
callq 0x32e0
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq -0x38(%rbp), %rdi
movq (%rax), %rax
movq 0x8(%rax), %rsi
addq $0x8, %rsi
callq 0x3290
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq (%rax), %rdi
addq $0x10, %rdi
callq 0x3200
cmpq $0x0, %rax
jbe 0xb6ef
movq -0x10(%rbp), %rdi
leaq 0xde69(%rip), %rsi      # 0x1951f
callq 0x32e0
movq -0x28(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq -0x48(%rbp), %rdi
movq (%rax), %rsi
addq $0x10, %rsi
callq 0x3290
movq %rax, %rdi
leaq 0xdd88(%rip), %rsi      # 0x19472
callq 0x32e0
movq -0x10(%rbp), %rdi
leaq 0xde27(%rip), %rsi      # 0x19521
callq 0x32e0
movl $0x0, -0x1c(%rbp)
movq -0x28(%rbp), %rdi
movslq -0x1c(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq (%rax), %rdi
addq $0x30, %rdi
callq 0xc4d0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0xb80f
movq -0x10(%rbp), %rdi
leaq 0xde7f(%rip), %rsi      # 0x195c5
callq 0x32e0
movq -0x28(%rbp), %rdi
movq %rax, -0x58(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq (%rax), %rdi
addq $0x30, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xc4f0
movq -0x58(%rbp), %rdi
movq (%rax), %rsi
addq $0x8, %rsi
callq 0x3290
movq -0x28(%rbp), %rdi
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq (%rax), %rdi
addq $0x48, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xd560
movq %rax, %rdi
callq 0x3200
cmpq $0x0, %rax
jbe 0xb7ff
movq -0x10(%rbp), %rdi
leaq 0xdd65(%rip), %rsi      # 0x1951f
callq 0x32e0
movq -0x28(%rbp), %rdi
movq %rax, -0x60(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq (%rax), %rdi
addq $0x48, %rdi
movslq -0x1c(%rbp), %rsi
callq 0xd560
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x3290
movq %rax, %rdi
leaq 0xdc78(%rip), %rsi      # 0x19472
callq 0x32e0
jmp 0xb801
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xb706
movq -0x10(%rbp), %rdi
leaq 0xdff4(%rip), %rsi      # 0x1980e
callq 0x32e0
movq -0x28(%rbp), %rdi
movq %rax, -0x70(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq -0x70(%rbp), %rdi
movq (%rax), %rax
movq 0x8(%rax), %rax
movl (%rax), %esi
callq 0x34d0
movq %rax, %rdi
leaq 0xdfbf(%rip), %rsi      # 0x1980f
callq 0x32e0
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
addq $0x20, %rdi
movslq -0x14(%rbp), %rsi
callq 0xc530
movq (%rax), %rdi
addq $0x30, %rdi
callq 0xc4d0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x30a0
movq %rax, %rdi
leaq 0xdfc0(%rip), %rsi      # 0x19850
callq 0x32e0
movq %rax, %rdi
movq 0x18729(%rip), %rsi     # 0x23fc8
callq 0x3320
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xb5ef
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)