// File: /workspace/github_cpp_makefile_star2_O1/yanlinlin82[P]icpp/icpp.cpp
// Function: parse_enum()
void parse_enum()
{
	next(); // skip 'enum'

	if (type != symbol) {
		err("missing symbol for 'enum' name!\n");
	}
	string name = token;
	next(); // skip name

	expect_token("{", "enum " + name);
	next(); // skip '{'

	int value = 0;
	while (!token.empty() && token != "}") {
		if (type != symbol) {
			err("invalid token '%s' for 'enum' value!\n", token.c_str());
		}
		string enum_key = token;
		next(); // skip

		string value_txt;
		if (token == "=") {
			next(); // skip '='
			if (type != symbol && type != number) {
				err("invalid token '%s' for 'enum' declearation!\n", token.c_str());
			}
			value_txt = token;
			value = eval_number(value_txt);
			next();
		}
		log<3>("[DEBUG] enum '%s': %s%s%s\n", name.c_str(), enum_key.c_str(),
				(value_txt.empty() ? "" : " = "), value_txt.c_str());

		auto it = enum_values.find(name);
		if (it == enum_values.end()) {
			enum_values.insert(make_pair(name, unordered_map<string, int>()));
			it = enum_values.find(name);
		}
		auto it2 = it->second.find(enum_key);
		if (it2 != it->second.end()) {
			err("duplidated enum key '%s'!\n", enum_key.c_str());
		}
		it->second.insert(make_pair(enum_key, value++));
		auto it3 = enum_types.find(enum_key);
		if (it3 != enum_types.end()) {
			err("symbol '%s' has existed!\n", enum_key.c_str());
		}
		enum_types.insert(make_pair(enum_key, make_pair(name, value)));

		if (token == "}") break;
		expect_token(",", "enum " + name);
		next();
	}
	expect_token("}", "enum " + name);
	next(); // skip '}'
	expect_token(";", "enum " + name);
	next(); // skip ';'
	log<3>("[DEBUG] end of enum %s\n", name.c_str());
	if (verbose >= 4) dump_enum();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
callq 0x5790
cmpl $0x1, 0x1269a(%rip)     # 0x24298
je 0x11c0e
leaq 0xb181(%rip), %rdi      # 0x1cd88
xorl %eax, %eax
callq 0x1585f
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x12683(%rip), %rsi     # 0x242a0
movq 0x12684(%rip), %rdx     # 0x242a8
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x16d2e
callq 0x5790
leaq -0x1c8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xa828(%rip), %rsi      # 0x1c46f
leaq 0xa822(%rip), %rdx      # 0x1c470
leaq -0x1d8(%rbp), %rdi
callq 0x16dc8
leaq 0xb148(%rip), %rsi      # 0x1cda9
leaq -0x238(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15a35
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x5d07
leaq -0x228(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11ca3
movq -0x228(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x1d8(%rbp), %rdi
cmpq %r14, %rdi
je 0x11cbe
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
leaq -0x148(%rbp), %r14
leaq -0x158(%rbp), %r13
xorl %ebx, %ebx
cmpq $0x0, 0x125cd(%rip)     # 0x242a8
je 0x121e6
leaq 0x125b8(%rip), %rdi     # 0x242a0
leaq 0xa51e(%rip), %rsi      # 0x1c20d
callq 0x30b0
testl %eax, %eax
je 0x121e6
cmpl $0x1, 0x12595(%rip)     # 0x24298
je 0x11d1a
movq 0x12594(%rip), %rsi     # 0x242a0
leaq 0xb09c(%rip), %rdi      # 0x1cdaf
xorl %eax, %eax
callq 0x1585f
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq 0x12577(%rip), %rsi     # 0x242a0
movq 0x12578(%rip), %rdx     # 0x242a8
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x16d2e
callq 0x5790
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq $0x0, -0xb8(%rbp)
movb $0x0, -0xb0(%rbp)
leaq 0x12538(%rip), %rdi     # 0x242a0
leaq 0xa477(%rip), %rsi      # 0x1c1e6
callq 0x30b0
testl %eax, %eax
jne 0x11e17
callq 0x5790
movl 0x12511(%rip), %eax     # 0x24298
addl $-0x3, %eax
cmpl $-0x3, %eax
ja 0x11da4
movq 0x1250a(%rip), %rsi     # 0x242a0
leaq 0xb038(%rip), %rdi      # 0x1cdd5
xorl %eax, %eax
callq 0x1585f
leaq -0xc0(%rbp), %rdi
leaq 0x124ee(%rip), %rsi     # 0x242a0
callq 0x3110
leaq -0xf0(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xc0(%rbp), %rsi
movq -0xb8(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x16d2e
leaq -0x100(%rbp), %rdi
callq 0x6087
movl %eax, %ebx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x11e12
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
movq -0x48(%rbp), %rsi
movq -0x68(%rbp), %rdx
cmpq $0x0, -0xb8(%rbp)
leaq 0xafef(%rip), %rcx      # 0x1ce1d
leaq 0xb64c(%rip), %rax      # 0x1d481
cmoveq %rax, %rcx
movq -0xc0(%rbp), %r8
leaq 0xafbb(%rip), %rdi      # 0x1ce02
xorl %eax, %eax
callq 0x1559d
leaq 0x1271b(%rip), %rdi     # 0x24570
leaq -0x48(%rbp), %rsi
callq 0x1a820
movq %rax, %r15
testq %rax, %rax
jne 0x11f36
xorps %xmm0, %xmm0
movaps %xmm0, -0xa0(%rbp)
movaps %xmm0, -0x80(%rbp)
movaps %xmm0, -0x90(%rbp)
movq $0x0, -0x70(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq $0x1, -0x98(%rbp)
leaq -0x90(%rbp), %rcx
movups %xmm0, (%rcx)
movl $0x3f800000, -0x80(%rbp) # imm = 0x3F800000
movups %xmm0, -0x8(%rax)
movq %r14, -0x158(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x16d2e
leaq -0x138(%rbp), %r15
movq %r15, %rdi
leaq -0xa0(%rbp), %rdx
movq %rdx, %rsi
callq 0x16cb0
leaq 0x12684(%rip), %rdi     # 0x24570
movq %r13, %rsi
callq 0x1a92c
movq %r15, %rdi
callq 0x15e88
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x11f17
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0xa0(%rbp), %rdi
callq 0x15e88
leaq 0x12646(%rip), %rdi     # 0x24570
leaq -0x48(%rbp), %rsi
callq 0x1a820
movq %rax, %r15
addq $0x28, %r15
movq %r15, %rdi
leaq -0x68(%rbp), %rsi
callq 0x1922c
testq %rax, %rax
je 0x11f5d
movq -0x68(%rbp), %rsi
leaq 0xaecb(%rip), %rdi      # 0x1ce21
xorl %eax, %eax
callq 0x1585f
movq %r14, -0x158(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x16d2e
movl %ebx, -0x138(%rbp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1ac76
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x11fa3
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x125fe(%rip), %rdi     # 0x245a8
leaq -0x68(%rbp), %rsi
callq 0x19968
testq %rax, %rax
je 0x11fca
movq -0x68(%rbp), %rsi
leaq 0xae79(%rip), %rdi      # 0x1ce3c
xorl %eax, %eax
callq 0x1585f
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x16d2e
incl %ebx
movl %ebx, -0x80(%rbp)
movq %r14, -0x158(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x16d2e
leaq -0x128(%rbp), %rcx
movq %rcx, -0x138(%rbp)
movq -0xa0(%rbp), %rax
leaq -0x90(%rbp), %rdx
cmpq %rdx, %rax
je 0x12046
movq %rax, -0x138(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x1204c
movups (%rdx), %xmm0
movups %xmm0, (%rcx)
movq -0x98(%rbp), %rax
movq %rax, -0x130(%rbp)
movq %rdx, -0xa0(%rbp)
movq $0x0, -0x98(%rbp)
movb $0x0, -0x90(%rbp)
movl -0x80(%rbp), %eax
movl %eax, -0x118(%rbp)
leaq 0x12525(%rip), %rdi     # 0x245a8
movq %r13, %rsi
callq 0x1ad94
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x120ad
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x120c8
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x120ea
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x121af(%rip), %rdi     # 0x242a0
leaq 0xa115(%rip), %rsi      # 0x1c20d
callq 0x30b0
movl %eax, %r15d
testl %eax, %eax
je 0x121a2
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
leaq 0xa0e5(%rip), %rsi      # 0x1c209
leaq 0xa0df(%rip), %rdx      # 0x1c20a
callq 0x16dc8
leaq -0x1b8(%rbp), %r12
movq %r12, %rdi
leaq 0xac68(%rip), %rsi      # 0x1cda9
leaq -0x48(%rbp), %rdx
callq 0x15a35
leaq -0xe0(%rbp), %rdi
movq %r12, %rsi
callq 0x5d07
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0x1217b
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x1219d
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x121c4
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x121dd
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
testl %r15d, %r15d
jne 0x11cd3
leaq -0x188(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0xa015(%rip), %rsi      # 0x1c20d
leaq 0xa00f(%rip), %rdx      # 0x1c20e
leaq -0x198(%rbp), %rdi
callq 0x16dc8
leaq 0xab97(%rip), %rsi      # 0x1cda9
leaq -0x218(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15a35
leaq -0x198(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x5d07
leaq -0x208(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12254
movq -0x208(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0x1226f
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
leaq -0x168(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x9f89(%rip), %rsi      # 0x1c20f
leaq 0x9f83(%rip), %rdx      # 0x1c210
leaq -0x178(%rbp), %rdi
callq 0x16dc8
leaq 0xab09(%rip), %rsi      # 0x1cda9
leaq -0x1f8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15a35
leaq -0x178(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x5d07
leaq -0x1e8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x122e2
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0x122fd
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x5790
movq -0x48(%rbp), %rsi
leaq 0xab49(%rip), %rdi      # 0x1ce56
xorl %eax, %eax
callq 0x1559d
cmpl $0x4, 0x122c5(%rip)     # 0x245e0
jl 0x12322
callq 0x3fdc
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x1233b
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x1e8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12374
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x12374
movq %rax, %rbx
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0x124fe
movq -0x168(%rbp), %rsi
jmp 0x12418
jmp 0x124fb
movq %rax, %rbx
leaq -0x208(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x123bc
movq -0x208(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x123bc
movq %rax, %rbx
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0x124fe
movq -0x188(%rbp), %rsi
jmp 0x12418
jmp 0x124fb
movq %rax, %rbx
leaq -0x228(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12401
movq -0x228(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x12401
movq %rax, %rbx
movq -0x1d8(%rbp), %rdi
cmpq %r14, %rdi
je 0x124fe
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x124fe
jmp 0x124fb
jmp 0x124fb
jmp 0x124fb
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x15cbe
jmp 0x12448
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x15e88
jmp 0x12540
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x12540
movq -0xf0(%rbp), %rsi
jmp 0x1252f
jmp 0x1253d
jmp 0x124fb
movq %rax, %rbx
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0x124b0
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x124b0
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x12540
movq -0xd0(%rbp), %rsi
jmp 0x1252f
jmp 0x1253d
movq %rax, %rbx
jmp 0x12515
jmp 0x1253d
movq %rax, %rbx
leaq -0x38(%rbp), %r14
jmp 0x12566
jmp 0x1253d
movq %rax, %rbx
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x12540
movq -0x148(%rbp), %rsi
jmp 0x1252f
movq %rax, %rbx
leaq -0x38(%rbp), %r14
jmp 0x1257f
jmp 0x1253d
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x15cf4
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x12540
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x12540
jmp 0x1253d
jmp 0x1253d
movq %rax, %rbx
leaq -0x38(%rbp), %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x12566
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x1257f
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x12594
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320