// File: /workspace/github_cpp_makefile_star2_O3/kiven-li[P]xbytes/xbytes.cpp
// Function: xbytes::xbytes::add_rule(xbytes::rule&)
void xbytes::add_rule(rule& r)
{
	//create new rule
	rule* rr = new rule();
	rr->index = rules.size();
	rr->left = r.left;
	rr->left_alias = r.left_alias;
	rr->rights = r.rights;
	rr->right_alias = r.right_alias;
	rr->code = r.code;
	make_string_rule(*rr);
	rules.push_back(rr);

	//attach rule with left symbol
	rr->left->rules.push_back(rr);

	//set start rule
	if(rr->left->name == "program")
	{
		start = rr;

		symbol* s = new symbol();
		s->index = symbols.size();
		s->name = ACCEPT_TERMINAL;
		s->type = ST_TERMINAL;
		s->associativity = AT_NONE;
		s->precedence = -1;
		symbols.push_back(s);
		rr->rights.push_back(s);
		rr->right_alias.push_back("");
	}
	
	//clear global rule
	r.left = NULL;
	r.left_alias.clear();
	r.rights.clear();	
	r.right_alias.clear();
	r.code.clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movl $0xa8, %edi
callq 0x3250
movq %rax, %r12
leaq 0x10(%rax), %rdi
addq $0x20, %rax
movq %rax, 0x10(%r12)
xorl %eax, %eax
movq %rax, 0x18(%r12)
movb %al, 0x20(%r12)
leaq 0x30(%r12), %r14
leaq 0x60(%r12), %r13
leaq 0x70(%r12), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%r12)
movups %xmm0, 0x40(%r12)
movups %xmm0, 0x50(%r12)
movq %rcx, 0x60(%r12)
movq %rax, 0x68(%r12)
movb %al, 0x70(%r12)
leaq 0x90(%r12), %rcx
movq %rcx, 0x80(%r12)
movq %rax, 0x88(%r12)
movb %al, 0x90(%r12)
movq %r12, -0x30(%rbp)
movq 0x28(%r15), %rax
subq 0x20(%r15), %rax
shrq $0x3, %rax
movl %eax, (%r12)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%r12)
leaq 0x10(%rbx), %rsi
callq 0x3120
leaq 0x30(%rbx), %rsi
movq %r14, %rdi
callq 0xa192
leaq 0x48(%rbx), %r14
leaq 0x48(%r12), %rdi
movq %r14, %rsi
callq 0xa358
leaq 0x60(%rbx), %rsi
movq %r13, %rdi
callq 0x3120
movq %r12, %rsi
callq 0x7d12
movq 0x28(%r15), %rsi
cmpq 0x30(%r15), %rsi
je 0x7a97
movq %r12, (%rsi)
addq $0x8, 0x28(%r15)
jmp 0x7aab
leaq 0x20(%r15), %rdi
leaq -0x30(%rbp), %r12
movq %r12, %rdx
callq 0xbf9a
movq (%r12), %r12
movq 0x8(%r12), %rdi
movq 0x58(%rdi), %rsi
cmpq 0x60(%rdi), %rsi
je 0x7ac4
movq %r12, (%rsi)
addq $0x8, 0x58(%rdi)
jmp 0x7ad1
addq $0x50, %rdi
leaq -0x30(%rbp), %rdx
callq 0xbf9a
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rdi
addq $0x8, %rdi
leaq 0x5a43(%rip), %rsi      # 0xd527
callq 0x30a0
testl %eax, %eax
jne 0x7c34
movq -0x30(%rbp), %rax
movq %rax, (%r15)
movl $0xa8, %edi
callq 0x3250
movq %rax, %r12
leaq 0x8(%rax), %rdi
addq $0x18, %rax
movq %rax, 0x8(%r12)
xorl %eax, %eax
movq %rax, 0x10(%r12)
movb %al, 0x18(%r12)
leaq 0x38(%r12), %rcx
movq %rcx, 0x28(%r12)
movq %rax, 0x30(%r12)
movb %al, 0x38(%r12)
movl $0x0, 0x48(%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r12)
movq %rax, 0x60(%r12)
movups %xmm0, 0x70(%r12)
movups %xmm0, 0x80(%r12)
movups %xmm0, 0x90(%r12)
movq %r12, -0x38(%rbp)
movq 0x10(%r15), %rax
subq 0x8(%r15), %rax
shrq $0x3, %rax
movl %eax, (%r12)
leaq 0x561d(%rip), %rcx      # 0xd199
movl $0x1, %r8d
xorl %esi, %esi
xorl %edx, %edx
callq 0x3320
movl $0x1, 0x48(%r12)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq %rax, 0xa0(%r12)
movq 0x10(%r15), %rsi
cmpq 0x18(%r15), %rsi
je 0x7bb5
movq %r12, (%rsi)
addq $0x8, 0x10(%r15)
jmp 0x7bc5
addq $0x8, %r15
leaq -0x38(%rbp), %rdx
movq %r15, %rdi
callq 0xb088
movq -0x30(%rbp), %rdi
movq 0x38(%rdi), %rsi
cmpq 0x40(%rdi), %rsi
je 0x7be1
movq -0x38(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x38(%rdi)
jmp 0x7bee
addq $0x30, %rdi
leaq -0x38(%rbp), %rdx
callq 0xb088
movq -0x30(%rbp), %r15
leaq -0x48(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x5a4f(%rip), %rdx      # 0xd650
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x375a
addq $0x48, %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0xc0da
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x7c34
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3260
xorl %eax, %eax
movq %rax, 0x8(%rbx)
movq %rax, 0x18(%rbx)
movq 0x10(%rbx), %rax
movb $0x0, (%rax)
movq 0x30(%rbx), %rax
cmpq %rax, 0x38(%rbx)
je 0x7c53
movq %rax, 0x38(%rbx)
movq 0x48(%rbx), %rsi
movq %r14, %rdi
callq 0xc2fc
movq $0x0, 0x68(%rbx)
movq 0x60(%rbx), %rax
movb $0x0, (%rax)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r13, %rdi
je 0x7c95
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3260
movq %rbx, %rdi
callq 0x33d0
nop