// File: /workspace/github_cpp_makefile_star2_O3/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 0x572d
cmpl $0x1, 0x11845(%rip)     # 0x23298
je 0x11a63
leaq 0xa32c(%rip), %rdi      # 0x1bd88
xorl %eax, %eax
callq 0x1546f
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq 0x1182e(%rip), %rsi     # 0x232a0
movq 0x1182f(%rip), %rdx     # 0x232a8
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x16942
callq 0x572d
leaq -0x1c8(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x99d3(%rip), %rsi      # 0x1b46f
leaq 0x99cd(%rip), %rdx      # 0x1b470
leaq -0x1d8(%rbp), %rdi
callq 0x169e0
leaq 0xa2f3(%rip), %rsi      # 0x1bda9
leaq -0x238(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15648
leaq -0x1d8(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x5c40
leaq -0x228(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x11af8
movq -0x228(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x1d8(%rbp), %rdi
cmpq %r14, %rdi
je 0x11b13
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
leaq -0x148(%rbp), %r14
leaq -0x158(%rbp), %r13
xorl %ebx, %ebx
cmpq $0x0, 0x11778(%rip)     # 0x232a8
je 0x12029
leaq 0x11763(%rip), %rdi     # 0x232a0
leaq 0x96c9(%rip), %rsi      # 0x1b20d
callq 0x30b0
testl %eax, %eax
je 0x12029
cmpl $0x1, 0x11740(%rip)     # 0x23298
je 0x11b6f
movq 0x1173f(%rip), %rsi     # 0x232a0
leaq 0xa247(%rip), %rdi      # 0x1bdaf
xorl %eax, %eax
callq 0x1546f
leaq -0x58(%rbp), %rax
movq %rax, -0x68(%rbp)
movq 0x11722(%rip), %rsi     # 0x232a0
movq 0x11723(%rip), %rdx     # 0x232a8
addq %rsi, %rdx
leaq -0x68(%rbp), %rdi
callq 0x16942
callq 0x572d
leaq -0xb0(%rbp), %rax
movq %rax, -0xc0(%rbp)
movq $0x0, -0xb8(%rbp)
movb $0x0, -0xb0(%rbp)
leaq 0x116e3(%rip), %rdi     # 0x232a0
leaq 0x9622(%rip), %rsi      # 0x1b1e6
callq 0x30b0
testl %eax, %eax
jne 0x11c6c
callq 0x572d
movl 0x116bc(%rip), %eax     # 0x23298
addl $-0x3, %eax
cmpl $-0x3, %eax
ja 0x11bf9
movq 0x116b5(%rip), %rsi     # 0x232a0
leaq 0xa1e3(%rip), %rdi      # 0x1bdd5
xorl %eax, %eax
callq 0x1546f
leaq -0xc0(%rbp), %rdi
leaq 0x11699(%rip), %rsi     # 0x232a0
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 0x16942
leaq -0x100(%rbp), %rdi
callq 0x5fc6
movl %eax, %ebx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x11c67
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
movq -0x48(%rbp), %rsi
movq -0x68(%rbp), %rdx
cmpq $0x0, -0xb8(%rbp)
leaq 0xa19a(%rip), %rcx      # 0x1be1d
leaq 0xa7f7(%rip), %rax      # 0x1c481
cmoveq %rax, %rcx
movq -0xc0(%rbp), %r8
leaq 0xa166(%rip), %rdi      # 0x1be02
xorl %eax, %eax
callq 0x151ad
leaq 0x118c6(%rip), %rdi     # 0x23570
leaq -0x48(%rbp), %rsi
callq 0x1a3c6
movq %rax, %r15
testq %rax, %rax
jne 0x11d79
movq $0x0, -0x80(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq $0x1, -0x98(%rbp)
xorps %xmm0, %xmm0
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 0x16942
leaq -0x138(%rbp), %r15
movq %r15, %rdi
leaq -0xa0(%rbp), %rdx
movq %rdx, %rsi
callq 0x168c6
leaq 0x11841(%rip), %rdi     # 0x23570
movq %r13, %rsi
callq 0x1a4d2
movq %r15, %rdi
callq 0x15aa0
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x11d5a
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq -0xa0(%rbp), %rdi
callq 0x15aa0
leaq 0x11803(%rip), %rdi     # 0x23570
leaq -0x48(%rbp), %rsi
callq 0x1a3c6
movq %rax, %r15
addq $0x28, %r15
movq %r15, %rdi
leaq -0x68(%rbp), %rsi
callq 0x18e2a
testq %rax, %rax
je 0x11da0
movq -0x68(%rbp), %rsi
leaq 0xa088(%rip), %rdi      # 0x1be21
xorl %eax, %eax
callq 0x1546f
movq %r14, -0x158(%rbp)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x16942
movl %ebx, -0x138(%rbp)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1a81a
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x11de6
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x117bb(%rip), %rdi     # 0x235a8
leaq -0x68(%rbp), %rsi
callq 0x19546
testq %rax, %rax
je 0x11e0d
movq -0x68(%rbp), %rsi
leaq 0xa036(%rip), %rdi      # 0x1be3c
xorl %eax, %eax
callq 0x1546f
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xa0(%rbp), %rdi
callq 0x16942
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 0x16942
leaq -0x128(%rbp), %rcx
movq %rcx, -0x138(%rbp)
movq -0xa0(%rbp), %rax
leaq -0x90(%rbp), %rdx
cmpq %rdx, %rax
je 0x11e89
movq %rax, -0x138(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x128(%rbp)
jmp 0x11e8f
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 0x116e2(%rip), %rdi     # 0x235a8
movq %r13, %rsi
callq 0x1a938
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0x11ef0
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x11f0b
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x11f2d
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x31d0
leaq 0x1136c(%rip), %rdi     # 0x232a0
leaq 0x92d2(%rip), %rsi      # 0x1b20d
callq 0x30b0
movl %eax, %r15d
testl %eax, %eax
je 0x11fe5
leaq -0xd0(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq -0xe0(%rbp), %rdi
leaq 0x92a2(%rip), %rsi      # 0x1b209
leaq 0x929c(%rip), %rdx      # 0x1b20a
callq 0x169e0
leaq -0x1b8(%rbp), %r12
movq %r12, %rdi
leaq 0x9e25(%rip), %rsi      # 0x1bda9
leaq -0x48(%rbp), %rdx
callq 0x15648
leaq -0xe0(%rbp), %rdi
movq %r12, %rsi
callq 0x5c40
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0x11fbe
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x11fe0
movq -0xd0(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x12007
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x12020
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
testl %r15d, %r15d
jne 0x11b28
leaq -0x188(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x91d2(%rip), %rsi      # 0x1b20d
leaq 0x91cc(%rip), %rdx      # 0x1b20e
leaq -0x198(%rbp), %rdi
callq 0x169e0
leaq 0x9d54(%rip), %rsi      # 0x1bda9
leaq -0x218(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15648
leaq -0x198(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x5c40
leaq -0x208(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12097
movq -0x208(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0x120b2
movq -0x188(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
leaq -0x168(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x9146(%rip), %rsi      # 0x1b20f
leaq 0x9140(%rip), %rdx      # 0x1b210
leaq -0x178(%rbp), %rdi
callq 0x169e0
leaq 0x9cc6(%rip), %rsi      # 0x1bda9
leaq -0x1f8(%rbp), %rdi
leaq -0x48(%rbp), %rdx
callq 0x15648
leaq -0x178(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
callq 0x5c40
leaq -0x1e8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12125
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0x12140
movq -0x168(%rbp), %rsi
incq %rsi
callq 0x31d0
callq 0x572d
movq -0x48(%rbp), %rsi
leaq 0x9d06(%rip), %rdi      # 0x1be56
xorl %eax, %eax
callq 0x151ad
cmpl $0x4, 0x11482(%rip)     # 0x235e0
jl 0x12165
callq 0x3fdc
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x1217e
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 0x121b7
movq -0x1e8(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x121b7
movq %rax, %rbx
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0x12341
movq -0x168(%rbp), %rsi
jmp 0x1225b
jmp 0x1233e
movq %rax, %rbx
leaq -0x208(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x121ff
movq -0x208(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x121ff
movq %rax, %rbx
movq -0x198(%rbp), %rdi
cmpq %r14, %rdi
je 0x12341
movq -0x188(%rbp), %rsi
jmp 0x1225b
jmp 0x1233e
movq %rax, %rbx
leaq -0x228(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x12244
movq -0x228(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x12244
movq %rax, %rbx
movq -0x1d8(%rbp), %rdi
cmpq %r14, %rdi
je 0x12341
movq -0x1c8(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x12341
jmp 0x1233e
jmp 0x1233e
jmp 0x1233e
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x158d6
jmp 0x1228b
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0x15aa0
jmp 0x12383
movq %rax, %rbx
movq -0x100(%rbp), %rdi
leaq -0xf0(%rbp), %rax
cmpq %rax, %rdi
je 0x12383
movq -0xf0(%rbp), %rsi
jmp 0x12372
jmp 0x12380
jmp 0x1233e
movq %rax, %rbx
movq -0x1b8(%rbp), %rdi
leaq -0x1a8(%rbp), %rax
cmpq %rax, %rdi
je 0x122f3
movq -0x1a8(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x122f3
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
leaq -0xd0(%rbp), %rax
cmpq %rax, %rdi
je 0x12383
movq -0xd0(%rbp), %rsi
jmp 0x12372
jmp 0x12380
movq %rax, %rbx
jmp 0x12358
jmp 0x12380
movq %rax, %rbx
leaq -0x38(%rbp), %r14
jmp 0x123a9
jmp 0x12380
movq %rax, %rbx
movq -0x158(%rbp), %rdi
cmpq %r14, %rdi
je 0x12383
movq -0x148(%rbp), %rsi
jmp 0x12372
movq %rax, %rbx
leaq -0x38(%rbp), %r14
jmp 0x123c2
jmp 0x12380
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x1590c
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x12383
movq -0x90(%rbp), %rsi
incq %rsi
callq 0x31d0
jmp 0x12383
jmp 0x12380
jmp 0x12380
movq %rax, %rbx
leaq -0x38(%rbp), %r14
movq -0xc0(%rbp), %rdi
leaq -0xb0(%rbp), %rax
cmpq %rax, %rdi
je 0x123a9
movq -0xb0(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x123c2
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x31d0
movq -0x48(%rbp), %rdi
cmpq %r14, %rdi
je 0x123d7
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x31d0
movq %rbx, %rdi
callq 0x3320