// File: /workspace/github_cpp_makefile_star2_O3/CoinXu[P]reviser-compiler/src/parser.cpp
// Function: reviser::compiler::Parser::ConsumeEnum(reviser::ast::Struct*)
Enum* Parser::ConsumeEnum(Struct* parent) {
    Expect(TOKEN_ENUM);
    Expect(TOKEN_ID);

    if (generator->descriptor->FindCurrentContextVariableById(token.text)
      || (parent && generator->descriptor->StructIncludeProperty(parent, token.text))) {
      RuntimeError("duplicate declare named [" + token.text + "]");
    }

    Token* id = CloneToken(token);
    Enum* e = new Enum(id);
    generator->descriptor->PushContextVariable(e);

    Expect(TOKEN_LEFT_BRACE);

    // no property enum
    if (Accept(TOKEN_RIGHT_BRACE)) {
      return e;
    }

    do {
      EnumProperty* property = ConsumeEnumProperty();
      if (generator->descriptor->EnumInlcudeProperty(e, property->id->text)) {
        RuntimeError("duplicate declare enum property named [" + property->id->text + "]");
        break;
      }
      e->properties.push_back(property);
    } while (Accept(TOKEN_COMMA));

    Expect(TOKEN_RIGHT_BRACE);
    return e;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl $0x3, %esi
callq 0x2c3ec
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2c3ec
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r15
leaq -0xe8(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %r12
movq %r12, %rdi
callq 0x290da
movq %r15, %rdi
movq %r12, %rsi
callq 0x32afe
movb $0x1, %r15b
testq %rax, %rax
je 0x2bf42
movq -0xf8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2bee6
callq 0x24320
testb %r15b, %r15b
je 0x2bff7
leaq 0x18(%rbx), %rdx
leaq 0x23649(%rip), %rsi     # 0x4f543
leaq -0x78(%rbp), %r14
movq %r14, %rdi
callq 0x2b4b3
leaq 0x24b15(%rip), %rsi     # 0x50a22
movq %r14, %rdi
callq 0x24650
leaq -0x88(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2bfa5
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x2bfac
testq %r14, %r14
je 0x2c150
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r15
leaq -0xc8(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq -0xd8(%rbp), %rdi
callq 0x290da
leaq -0xd8(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x32dca
movl %eax, %r15d
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2bed5
callq 0x24320
jmp 0x2bed5
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0x98(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2c2d2
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0x2bfe5
callq 0x24320
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2bff7
callq 0x24320
leaq 0x10(%rbx), %rsi
callq 0x2c258
movq %rax, %r15
movl $0x50, %edi
callq 0x24340
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x30bc2
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
movq %r14, %rsi
callq 0x32896
movq %rbx, %rdi
movl $0x7b, %esi
callq 0x2c3ec
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2b86e
testb %al, %al
jne 0x2c1b1
leaq -0xa8(%rbp), %r15
movq %r14, %rax
addq $0x38, %rax
movq %rax, -0x38(%rbp)
leaq -0xb8(%rbp), %r12
movq %rbx, %rdi
callq 0x2e404
movq %rax, -0x30(%rbp)
movq 0x8(%rbx), %rcx
movq 0x50(%rcx), %r13
movq 0x30(%rax), %rax
movq %r15, -0xb8(%rbp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x290da
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x32cd8
movl %eax, %r13d
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c0ba
callq 0x24320
testb %r13b, %r13b
jne 0x2c0fe
movq 0x40(%r14), %rsi
cmpq 0x48(%r14), %rsi
je 0x2c0d7
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x40(%r14)
jmp 0x2c0e4
movq -0x38(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x2ea70
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x2b86e
testb %al, %al
jne 0x2c066
jmp 0x2c1a4
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdx
addq $0x8, %rdx
leaq 0x23647(%rip), %rsi     # 0x4f758
leaq -0x78(%rbp), %r15
movq %r15, %rdi
callq 0x2b4b3
leaq 0x248fe(%rip), %rsi     # 0x50a22
movq %r15, %rdi
callq 0x24650
leaq -0x48(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2c158
movq %rdx, -0x58(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x48(%rbp)
jmp 0x2c15f
xorl %r15d, %r15d
jmp 0x2bed5
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x58(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2c2d2
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c192
callq 0x24320
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2c1a4
callq 0x24320
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2c3ec
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2c21f
callq 0x24320
jmp 0x2c21f
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
jne 0x2c1fb
jmp 0x2c205
jmp 0x2c202
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0x2c205
callq 0x24320
jmp 0x2c205
movq %rax, %rbx
leaq -0x68(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2c23c
jmp 0x2c241
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2c23c
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2c23c
jmp 0x2c241
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x2c241
callq 0x24320
movq %rbx, %rdi
callq 0x245f0
nop