// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/parser.cpp
// Function: reviser::compiler::Parser::ConsumeEnumDeclare()
Declare* Parser::ConsumeEnumDeclare() {
    Token* eid = CloneToken(tokenizer->Previous());

    // enum type id
    if (!generator->descriptor->FindEnumContextVariableById(eid->text)) {
      RuntimeError("undefined enum [" + eid->text + "] in current scope");
    }

    Expect(TOKEN_ID);
    Token* id = CloneToken(token);
    Expect(TOKEN_ASSIGN);
    Expect(TOKEN_ID);
    Token* ei = CloneToken(token);

    // value must match type
    if (eid->text != ei->text) {
      RuntimeError("enum type [" + eid->text + "] not match value [" + ei->text + "]");
    }

    // enum variable id
    Enum* def = generator->descriptor->FindEnumContextVariableById(ei->text);
    if (!def) {
      RuntimeError("undefined enum [" + ei->text + "] in current scope");
    }

    Expect(TOKEN_CONNECTION);
    Expect(TOKEN_ID);
    if (!generator->descriptor->EnumInlcudeProperty(def, token.text)) {
      RuntimeError("undefined property [" + token.text + "] in enum [" + ei->text + "]");
    }

    Token* ep = CloneToken(token);
    EnumValue* ev = new EnumValue(ei, ep);
    RightValue* rv = new RightValue(ev);
    Declare* declare = new Declare(TYPE_ENUM, id, eid, rv);
    return declare;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x2f19e
movq %rax, %rsi
callq 0x2c258
movq %rax, %r14
movq %rbx, -0x30(%rbp)
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rbx
leaq -0x188(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq -0x198(%rbp), %r15
movq %r15, %rdi
callq 0x290da
movq %rbx, %rdi
movq %r15, %rsi
callq 0x32c54
movq %rax, %rbx
movq -0x198(%rbp), %rdi
cmpq %r12, %rdi
je 0x2dceb
callq 0x24320
leaq 0x8(%r14), %r12
testq %rbx, %rbx
jne 0x2dd9d
leaq 0x219e5(%rip), %rsi     # 0x4f6e4
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x2b4b3
leaq 0x21994(%rip), %rsi     # 0x4f6a9
movq %rbx, %rdi
callq 0x24650
leaq -0x128(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2dd4a
movq %rdx, -0x138(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x128(%rbp)
jmp 0x2dd51
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x138(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x2c2d2
movq -0x138(%rbp), %rdi
cmpq %r15, %rdi
je 0x2dd8b
callq 0x24320
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2dd9d
callq 0x24320
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2c3ec
leaq 0x10(%rbx), %r15
movq %r15, %rsi
callq 0x2c258
movq %rax, -0x90(%rbp)
movq %rbx, %rdi
movl $0x3d, %esi
callq 0x2c3ec
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2c3ec
movq %r15, -0x98(%rbp)
movq %r15, %rsi
callq 0x2c258
leaq 0x8(%rax), %rcx
movq %rcx, -0x60(%rbp)
movq 0x10(%r14), %r15
movq %rax, -0x38(%rbp)
cmpq 0x10(%rax), %r15
jne 0x2de27
movq -0x60(%rbp), %rax
movq (%rax), %rbx
testq %r15, %r15
je 0x2dfa8
movq (%r12), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x24360
testl %eax, %eax
je 0x2dfab
leaq 0x218c7(%rip), %rsi     # 0x4f6f5
leaq -0xf8(%rbp), %rbx
movq %rbx, %rdi
movq %r12, %rdx
callq 0x2b4b3
leaq 0x218ba(%rip), %rsi     # 0x4f701
movq %rbx, %rdi
callq 0x24650
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2de73
movq %rdx, -0x80(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x70(%rbp)
jmp 0x2de7a
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x80(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x240f0
leaq -0x48(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2decb
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x2ded3
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x58(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x22b2d(%rip), %rsi     # 0x50a22
callq 0x24650
leaq -0x108(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2df27
movq %rdx, -0x118(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x108(%rbp)
jmp 0x2df2f
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x118(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x2c2d2
movq -0x118(%rbp), %rdi
cmpq %r13, %rdi
je 0x2df69
callq 0x24320
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x2df77
callq 0x24320
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x2df85
callq 0x24320
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2df9a
callq 0x24320
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rbx
movq 0x10(%rax), %r15
jmp 0x2dfab
xorl %r15d, %r15d
movq %r14, -0x88(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x50(%rax), %r12
leaq -0x168(%rbp), %r14
movq %r14, -0x10(%r14)
addq %rbx, %r15
leaq -0x178(%rbp), %r13
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x290da
movq %r12, %rdi
movq %r13, %rsi
callq 0x32c54
movq %rax, %r12
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
je 0x2e000
callq 0x24320
testq %r12, %r12
jne 0x2e0af
leaq 0x216d4(%rip), %rsi     # 0x4f6e4
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
movq -0x60(%rbp), %rdx
callq 0x2b4b3
leaq 0x21682(%rip), %rsi     # 0x4f6a9
movq %rbx, %rdi
callq 0x24650
leaq -0xc8(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2e05c
movq %rdx, -0xd8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc8(%rbp)
jmp 0x2e063
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0xd8(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x2c2d2
movq -0xd8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2e09d
callq 0x24320
leaq -0x48(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e0af
callq 0x24320
movq -0x30(%rbp), %r14
movq %r14, %rdi
movl $0x2e, %esi
callq 0x2c3ec
movq %r14, %rdi
movl $0x4, %esi
callq 0x2c3ec
movq 0x8(%r14), %rax
movq 0x50(%rax), %rbx
leaq -0x148(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x18(%r14), %rsi
movq 0x20(%r14), %rdx
addq %rsi, %rdx
leaq -0x158(%rbp), %r15
movq %r15, %rdi
callq 0x290da
movq %rbx, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x32cd8
movl %eax, %ebx
movq -0x158(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e11b
callq 0x24320
testb %bl, %bl
jne 0x2e29b
movq -0x30(%rbp), %rax
leaq 0x18(%rax), %rdx
leaq 0x215e3(%rip), %rsi     # 0x4f715
leaq -0xf8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2b4b3
leaq 0x215e2(%rip), %rsi     # 0x4f72a
movq %rbx, %rdi
callq 0x24650
leaq -0x70(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2e174
movq %rdx, -0x80(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x70(%rbp)
jmp 0x2e17b
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x80(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
callq 0x240f0
leaq -0x48(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2e1cc
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x2e1d4
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
leaq -0x58(%rbp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x2282c(%rip), %rsi     # 0x50a22
callq 0x24650
leaq -0xa8(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2e228
movq %rdx, -0xb8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xa8(%rbp)
jmp 0x2e230
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0xb8(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0x2c2d2
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e26a
callq 0x24320
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x2e278
callq 0x24320
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x2e286
callq 0x24320
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e29b
callq 0x24320
movq -0x98(%rbp), %rsi
callq 0x2c258
movq %rax, %rbx
movl $0x10, %edi
callq 0x24340
movq %rax, %r15
movq %rax, %rdi
movq -0x38(%rbp), %rsi
movq %rbx, %rdx
callq 0x30a44
movl $0x58, %edi
callq 0x24340
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x309e0
movl $0x20, %edi
callq 0x24340
movq %rax, %r15
movq %rax, %rdi
movl $0x9, %esi
movq -0x90(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x30a88
movq %r15, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
jmp 0x2e33b
jmp 0x2e347
movq %rax, %rbx
movq -0x138(%rbp), %rdi
cmpq %r15, %rdi
je 0x2e34a
callq 0x24320
jmp 0x2e34a
movq %rax, %rbx
leaq -0x48(%rbp), %rax
jmp 0x2e3a8
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
jmp 0x2e36c
jmp 0x2e378
jmp 0x2e38b
jmp 0x2e39e
movq %rax, %rbx
movq -0x118(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e37b
callq 0x24320
jmp 0x2e37b
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r12, %rdi
je 0x2e38e
callq 0x24320
jmp 0x2e38e
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r15, %rdi
je 0x2e3a1
callq 0x24320
jmp 0x2e3a1
movq %rax, %rbx
leaq -0xe8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2e3f6
jmp 0x2e3fb
jmp 0x2e3bd
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2e3f6
movq %rax, %rbx
movq %r15, %rdi
jmp 0x2e3f6
movq %rax, %rbx
movq -0x158(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2e3f6
jmp 0x2e3fb
movq %rax, %rbx
movq -0x178(%rbp), %rdi
cmpq %r14, %rdi
jne 0x2e3f6
jmp 0x2e3fb
movq %rax, %rbx
movq -0x198(%rbp), %rdi
cmpq %r12, %rdi
je 0x2e3fb
callq 0x24320
movq %rbx, %rdi
callq 0x245f0
nop