// File: /workspace/github_cpp_makefile_star2_O3/kiven-li[P]xbytes/xbytes.cpp
// Function: xbytes::xbytes::lexical_rule(char)
void xbytes::lexical_rule(char cc)
{
	line[char_index_in_line++] = cc;

	if(cc == '\0') return;

	switch(state)
	{
	case LS_START:
	{
		if(isalpha(cc))
		{
			s.name.push_back(cc);
			state = LS_LEFT_SYMBOL;
		}
		else if(cc == '%')
		{
			state = LS_CODE_DECLARE;
		}
		else if(cc == '#')
		{
			assoc_prec ap;
			ap.associativity = AT_NONE;
			assoc_precs.push_back(ap);
			state = LS_ASSOCIATIVITY_DECLARE;
		}
		else if(cc != ' ' && cc != '\n' && cc != '\r')
		{
			error_on_line(line, "expect char/SPACE", char_index_in_line);
		}	
		break;
	}
	case LS_CODE_DECLARE:
	{
		if(isalpha(cc) || cc == '_')
		{
			declare_code_name.push_back(cc);
		}
		else if(cc == '{')
		{
			++bracket_count;
			state = LS_CODE;
		}
		else if(cc != ' ' && cc != '\r' && cc != '\n')
		{
			error_on_line(line, "expect char OR { OR \\r OR \\n", char_index_in_line);
		}
		break;
	}
	case LS_CODE:
	{
		if(cc == '}')
		{
			--bracket_count;
			if(bracket_count == 0)
			{
				if(declare_code_name == "include")
				{
					include_code = declare_code;
				}
				else if(declare_code_name == "token")
				{
					token_code = declare_code;
				}
				else if(declare_code_name == "syntax_error")
				{
					syntax_error_code = declare_code;
				}

				declare_code.clear();
				declare_code_name.clear();

				state = LS_START;				
			}
			else
			{
				declare_code.push_back(cc);
			}
		}
		else if(cc == '{')
		{
			++bracket_count;
			declare_code.push_back(cc);
		}
		else
		{
			declare_code.push_back(cc);
		}
		break;
	}
	case LS_ASSOCIATIVITY_DECLARE:
	{
		if(isalpha(cc))
		{
			declare_associativity_name.push_back(cc);
		}
		else if(cc == ' ')
		{
			int ass = declare_associativity_name == "left" ? AT_LEFT : AT_RIGHT;
			assoc_precs[assoc_precs.size() - 1].associativity = ass;
			state = LS_ASSOCIATIVITY;
		}
		else 
		{
			error_on_line(line, "expect char OR space", char_index_in_line);
		}
		break;
	}
	case LS_ASSOCIATIVITY:
	{
		if(isalpha(cc))
		{
			associativity_symbol_name.push_back(cc);
		}
		else if(cc == ' ')
		{
			if(associativity_symbol_name.size() != 0)
			{
				assoc_precs[assoc_precs.size() - 1].symbol_names.push_back(associativity_symbol_name);
				associativity_symbol_name.clear();
			}
		}
		else if(cc == '\r' || cc == '\n')
		{
			if(associativity_symbol_name.size() != 0)
			{
				assoc_precs[assoc_precs.size() - 1].symbol_names.push_back(associativity_symbol_name); 
				associativity_symbol_name.clear();
			}
			declare_associativity_name.clear();
			state = LS_START;
		}
		else
		{
			error_on_line(line, "expect char, space, \\r, OR \\n", char_index_in_line);
		}
		break;
	}
	case LS_LEFT_SYMBOL:
	{
		if(isalpha(cc) || cc == '_' || isdigit(cc) || cc == '-')
		{
			s.name.push_back(cc);
		}
		else if(cc == '(')
		{
			state = LS_LEFT_ALIAS;
		}
		else if(cc == '-')
		{
			state = LS_ARROW;
		}
		else if(cc == ' ')
		{
			state = LS_LEFT_WAIT_ARROW;
		}
		else
		{
			error_on_line(line, "expect char/(/-/SPACE", char_index_in_line);
		}

		break;
	}
	case LS_LEFT_ALIAS:
	{
		if(isalpha(cc))
		{
			s.alias.push_back(cc);
		}
		else if(cc == ')')
		{
			state = LS_LEFT_WAIT_ARROW;
		}
		else
		{
			error_on_line(line, "expect char or )", char_index_in_line);
		}

		break;
	}
	case LS_LEFT_WAIT_ARROW:
	{
		if(cc == '-')
		{
			state = LS_ARROW;				
		}
		else if(cc != ' ')
		{
			error_on_line(line, "expect -", char_index_in_line);
		}

		break;
	}
	case LS_ARROW:
	{
		if(cc == '>')
		{
			state = LS_RIGHT_WARIT_SYMBOL;
			make_symbol(r, s);			
		}
		else
		{
			error_on_line(line, "expect >", char_index_in_line);
		}

		break;
	}
	case LS_RIGHT_WARIT_SYMBOL:
	{
		if(cc == '.')
		{
			state = LS_WAIT_RULE_CODE;
		}
		else if(isalpha(cc))
		{
			state = LS_RIGHT_SYMBOL;
			s.name.push_back(cc);
		}
		else if(cc != ' ')
		{
			error_on_line(line, "expect char/./SPACE", char_index_in_line);
		}

		break;
	}
	case LS_RIGHT_SYMBOL:
	{
		if(cc == '.')
		{
			state = LS_WAIT_RULE_CODE;
			make_symbol(r, s);
		}
		else if(isalpha(cc) || cc == '_' || isdigit(cc) || cc == '-')
		{
			s.name.push_back(cc);
		}
		else if(cc == '(')
		{
			state = LS_RIGHT_ALIAS;
		}
		else if(cc == ' ')
		{
			state = LS_RIGHT_WARIT_SYMBOL;
			make_symbol(r, s);
		}
		else
		{
			error_on_line(line, "expect char/./(/SPACE", char_index_in_line);
		}
		break;
	}
	case LS_RIGHT_ALIAS:
	{
		if(isalpha(cc))
		{
			s.alias.push_back(cc);
		}
		else if(cc == ')')
		{
			state = LS_RIGHT_WARIT_SYMBOL;
			make_symbol(r, s);
		}
		else
		{
			error_on_line(line, "expect ) or char", char_index_in_line);
		}
		break;
	}
	case LS_WAIT_RULE_CODE:
	{
		if(cc == '{')
		{
			bracket_count++;
			r.code.push_back(cc);
			state = LS_RULE_CODE;
		}
		else if(isalpha(cc))
		{
			add_rule(r);
			s.name.push_back(cc);
			state = LS_LEFT_SYMBOL;
		}
		else if(cc != ' ' && cc != '\r' && cc != '\n')
		{
			error_on_line(line, "expect \r\n or { or SPACE", char_index_in_line);
		}
		break;
	}
	case LS_RULE_CODE:
	{
		if(cc == '}')
		{
			r.code.push_back(cc);
			
			if(--bracket_count == 0) 
			{
				add_rule(r);
				state = LS_START;
			}
		}
		else
		{
			r.code.push_back(cc);
			if(cc == '{') bracket_count++;
		}
		break;
	}
	}

	if(cc == '\n')
	{
		for(int m = 0; m < MAX_LINE_SIZE; ++m) line[m] = 0;
		if(char_index_in_line) line_count++;
		char_index_in_line = 0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %r15d
movslq 0x608(%rdi), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x608(%rdi)
movb %r15b, 0x208(%rdi,%rax)
testb %r15b, %r15b
je 0x478f
movq %rdi, %rbx
leaq 0x208(%rdi), %r14
movl 0xb0(%rdi), %eax
cmpq $0xd, %rax
ja 0x4761
leaq 0x8c30(%rip), %rcx      # 0xd04c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
jne 0x47b9
movsbl %r15b, %eax
cmpl $0x1f, %eax
jle 0x49f6
cmpl $0x20, %eax
je 0x478f
cmpl $0x23, %eax
je 0x4ab4
cmpl $0x25, %eax
jne 0x4a08
movl $0xa, 0xb0(%rbx)
jmp 0x478f
movsbl %r15b, %esi
cmpl $0x7b, %esi
je 0x48b4
cmpl $0x7d, %esi
jne 0x48d8
decl 0x610(%rbx)
je 0x4a3c
addq $0x638, %rbx            # imm = 0x638
movq %rbx, %rdi
movl $0x7d, %esi
jmp 0x48c9
cmpb $0x3e, %r15b
je 0x482c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8fd2(%rip), %rsi      # 0xd48d
leaq 0x8fd3(%rip), %rdx      # 0xd495
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
je 0x47e1
leaq 0x658(%rbx), %rdi
jmp 0x4758
leaq 0x1c0(%rbx), %rdi
cmpb $0x7d, %r15b
jne 0x46d8
movl $0x7d, %esi
callq 0x31f0
decl 0x610(%rbx)
jne 0x478f
leaq 0x160(%rbx), %rsi
movq %rbx, %rdi
callq 0x799c
jmp 0x4b33
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
jne 0x45b6
cmpb $0x29, %r15b
je 0x47d5
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8f17(%rip), %rsi      # 0xd473
leaq 0x8f20(%rip), %rdx      # 0xd483
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
movsbl %r15b, %eax
cmpl $0x20, %eax
je 0x478f
cmpl $0x2d, %eax
jne 0x4b42
movl $0x4, 0xb0(%rbx)
jmp 0x478f
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
je 0x4822
leaq 0xe0(%rbx), %rdi
jmp 0x4758
movl %r15d, %edi
callq 0x3350
cmpb $0x5f, %r15b
je 0x4751
testl %eax, %eax
jne 0x4751
movl %r15d, %eax
addl $-0x30, %eax
cmpl $0xa, %eax
setae %al
cmpb $0x2d, %r15b
setne %cl
testb %al, %cl
je 0x4751
movsbl %r15b, %eax
cmpl $0x20, %eax
je 0x47d5
cmpl $0x28, %eax
jne 0x4c12
movl $0x2, 0xb0(%rbx)
jmp 0x478f
cmpb $0x2e, %r15b
jne 0x46ff
movl $0x8, 0xb0(%rbx)
jmp 0x478f
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
je 0x4856
leaq 0x678(%rbx), %rdi
jmp 0x4758
cmpb $0x2e, %r15b
jne 0x4724
movl $0x8, 0xb0(%rbx)
jmp 0x4836
movl %r15d, %edi
callq 0x3350
cmpb $0x5f, %r15b
je 0x471b
testl %eax, %eax
jne 0x471b
movsbl %r15b, %eax
cmpl $0x1f, %eax
jg 0x48e4
cmpl $0xa, %eax
je 0x4767
cmpl $0xd, %eax
je 0x478f
jmp 0x4c46
cmpb $0x7b, %r15b
jne 0x479a
incl 0x610(%rbx)
leaq 0x1c0(%rbx), %rdi
movl $0x7b, %esi
callq 0x31f0
movl $0x9, 0xb0(%rbx)
jmp 0x478f
movsbl %r15b, %r15d
movl %r15d, %esi
callq 0x31f0
cmpl $0xa, %r15d
je 0x4767
cmpl $0x7b, %r15d
jne 0x478f
incl 0x610(%rbx)
jmp 0x478f
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
je 0x4965
movl $0x6, 0xb0(%rbx)
jmp 0x4751
leaq 0x618(%rbx), %rdi
jmp 0x4758
movl %r15d, %edi
callq 0x3350
cmpb $0x5f, %r15b
je 0x4751
testl %eax, %eax
jne 0x4751
movl %r15d, %eax
addl $-0x30, %eax
cmpl $0xa, %eax
setae %al
cmpb $0x2d, %r15b
setne %cl
testb %al, %cl
jne 0x4a8f
leaq 0xc0(%rbx), %rdi
movsbl %r15b, %esi
callq 0x31f0
cmpb $0xa, %r15b
jne 0x478f
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
xorl %esi, %esi
callq 0x3130
cmpl $0x0, 0x608(%rbx)
je 0x4785
incl 0x60c(%rbx)
movl $0x0, 0x608(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl %r15d, %edi
callq 0x3350
testl %eax, %eax
je 0x49a3
leaq 0x160(%rbx), %rsi
movq %rbx, %rdi
callq 0x799c
leaq 0xc0(%rbx), %rdi
movsbl %r15b, %esi
callq 0x31f0
movl $0x1, 0xb0(%rbx)
jmp 0x4761
movl $0x3, 0xb0(%rbx)
jmp 0x478f
cmpb $0x20, %r15b
jne 0x4b76
leaq 0x658(%rbx), %rdi
leaq 0x8c2c(%rip), %rsi      # 0xd425
callq 0x30a0
cmpl $0x1, %eax
movl $0x2, %eax
sbbl $0x0, %eax
movq 0x6a0(%rbx), %rcx
movl %eax, -0x20(%rcx)
movl $0xd, 0xb0(%rbx)
jmp 0x478f
cmpb $0x29, %r15b
jne 0x4baa
movl $0x5, 0xb0(%rbx)
leaq 0x160(%rbx), %rsi
leaq 0xb8(%rbx), %rdx
movq %rbx, %rdi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x77e6
movsbl %r15b, %eax
cmpl $0xa, %eax
je 0x490b
cmpl $0xd, %eax
je 0x490b
cmpl $0x20, %eax
jne 0x4bde
cmpq $0x0, 0x680(%rbx)
je 0x478f
leaq 0x678(%rbx), %rsi
movq 0x6a0(%rbx), %rdi
addq $-0x18, %rdi
callq 0xa30c
movq $0x0, 0x680(%rbx)
movq 0x678(%rbx), %rax
movb $0x0, (%rax)
jmp 0x478f
incl 0x610(%rbx)
addq $0x638, %rbx            # imm = 0x638
movq %rbx, %rdi
movl $0x7b, %esi
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x31f0
leaq 0x638(%rbx), %rdi
jmp 0x475c
cmpl $0x20, %eax
je 0x478f
cmpl $0x7b, %eax
jne 0x4c46
incl 0x610(%rbx)
movl $0xb, 0xb0(%rbx)
jmp 0x478f
cmpq $0x0, 0x680(%rbx)
je 0x4941
leaq 0x678(%rbx), %rsi
movq 0x6a0(%rbx), %rdi
addq $-0x18, %rdi
callq 0xa30c
movq $0x0, 0x680(%rbx)
movq 0x678(%rbx), %rax
movb $0x0, (%rax)
movq $0x0, 0x660(%rbx)
movq 0x658(%rbx), %rax
movb $0x0, (%rax)
movl $0x0, 0xb0(%rbx)
jmp 0x4761
cmpb $0x20, %r15b
je 0x478f
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8b18(%rip), %rsi      # 0xd496
leaq 0x8b24(%rip), %rdx      # 0xd4a9
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
movsbl %r15b, %eax
cmpl $0xa, %eax
je 0x4767
cmpl $0xd, %eax
je 0x478f
cmpl $0x20, %eax
je 0x478f
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8b00(%rip), %rsi      # 0xd4d1
leaq 0x8b10(%rip), %rdx      # 0xd4e8
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
cmpl $0xa, %eax
je 0x4767
cmpl $0xd, %eax
je 0x478f
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x89c4(%rip), %rsi      # 0xd3db
leaq 0x89ce(%rip), %rdx      # 0xd3ec
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq 0x618(%rbx), %r14
leaq 0x89c0(%rip), %rsi      # 0xd40a
movq %r14, %rdi
callq 0x30a0
testl %eax, %eax
je 0x4af6
leaq 0x89b1(%rip), %rsi      # 0xd412
movq %r14, %rdi
callq 0x30a0
testl %eax, %eax
je 0x4afd
leaq 0x89a0(%rip), %rsi      # 0xd418
movq %r14, %rdi
callq 0x30a0
testl %eax, %eax
jne 0x4b11
movl $0x90, %edi
jmp 0x4b02
movsbl %r15b, %eax
cmpl $0x20, %eax
je 0x482c
cmpl $0x28, %eax
jne 0x4c7a
movl $0x7, 0xb0(%rbx)
jmp 0x478f
leaq -0x30(%rbp), %r14
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movl $0x0, -0x8(%r14)
leaq 0x698(%rbx), %rdi
leaq -0x38(%rbp), %rsi
callq 0xa2c4
movl $0xc, 0xb0(%rbx)
movq %r14, %rdi
callq 0xa598
jmp 0x478f
movl $0x50, %edi
jmp 0x4b02
movl $0x70, %edi
leaq 0x638(%rbx), %rsi
addq %rbx, %rdi
callq 0x3120
xorl %eax, %eax
movq %rax, 0x640(%rbx)
movq 0x638(%rbx), %rcx
movb %al, (%rcx)
movq %rax, 0x620(%rbx)
movq 0x618(%rbx), %rcx
movb %al, (%rcx)
movl $0x0, 0xb0(%rbx)
jmp 0x478f
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8933(%rip), %rsi      # 0xd484
leaq 0x8934(%rip), %rdx      # 0xd48c
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x88a5(%rip), %rsi      # 0xd42a
leaq 0x88b2(%rip), %rdx      # 0xd43e
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8907(%rip), %rsi      # 0xd4c0
leaq 0x8910(%rip), %rdx      # 0xd4d0
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8852(%rip), %rsi      # 0xd43f
leaq 0x8868(%rip), %rdx      # 0xd45c
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x883c(%rip), %rsi      # 0xd45d
leaq 0x884a(%rip), %rdx      # 0xd472
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8798(%rip), %rsi      # 0xd3ed
leaq 0x87ad(%rip), %rdx      # 0xd409
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x8821(%rip), %rsi      # 0xd4aa
leaq 0x882f(%rip), %rdx      # 0xd4bf
leaq -0x38(%rbp), %rdi
callq 0x375a
movl 0x608(%rbx), %ecx
leaq -0x38(%rbp), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4d0c
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
movq %rax, %rbx
movq %r14, %rdi
callq 0xa598
jmp 0x4d04
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
jmp 0x4ce7
jmp 0x4d01
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x4d04
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x3260
jmp 0x4d04
movq %rax, %rbx
movq %rbx, %rdi
callq 0x33d0