// File: /workspace/github_cpp_makefile_star2_O1/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 0x2d618
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2d618
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r15
leaq -0xf0(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %r12
movq %r12, %rdi
callq 0x2a264
movq %r15, %rdi
movq %r12, %rsi
callq 0x33d70
testq %rax, %rax
je 0x2d0dd
movb $0x1, %r14b
xorl %eax, %eax
jmp 0x2d12b
testq %r14, %r14
je 0x2d126
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r15
leaq -0xd0(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq -0xe0(%rbp), %rdi
callq 0x2a264
leaq -0xe0(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x34042
movl %eax, %r14d
movb $0x1, %al
jmp 0x2d12b
xorl %eax, %eax
xorl %r14d, %r14d
testb %al, %al
je 0x2d144
leaq -0xd0(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d144
callq 0x25320
movq -0x100(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d155
callq 0x25320
testb %r14b, %r14b
je 0x2d203
leaq 0x18(%rbx), %rdx
leaq 0x233da(%rip), %rsi     # 0x50543
leaq -0x80(%rbp), %r14
movq %r14, %rdi
callq 0x2c6b4
leaq 0x248a6(%rip), %rsi     # 0x51a22
movq %r14, %rdi
callq 0x25650
leaq -0x90(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2d1b1
movq %rdx, -0xa0(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x90(%rbp)
jmp 0x2d1b8
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0xa0(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
xorl %edx, %edx
callq 0x2d4fe
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d1f1
callq 0x25320
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d203
callq 0x25320
leaq 0x10(%rbx), %rsi
callq 0x2d484
movq %rax, %r15
movl $0x50, %edi
callq 0x25340
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x31dc2
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
movq %r14, %rsi
callq 0x33ae6
movq %rbx, %rdi
movl $0x7b, %esi
callq 0x2d618
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2ca72
testb %al, %al
jne 0x2d3ce
leaq -0xb0(%rbp), %r13
movq %r14, %rax
addq $0x38, %rax
movq %rax, -0x58(%rbp)
leaq -0xc0(%rbp), %r12
movq %r14, -0x60(%rbp)
movq %rbx, %rdi
callq 0x2f5f0
movq %rax, -0x30(%rbp)
movq 0x8(%rbx), %rcx
movq 0x50(%rcx), %r15
movq 0x30(%rax), %rax
movq %r13, -0xc0(%rbp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x2a264
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x33f4a
movl %eax, %r15d
movq -0xc0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d2ca
callq 0x25320
testb %r15b, %r15b
je 0x2d327
movq %r12, %r14
movq %r13, %r12
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdx
addq $0x8, %rdx
leaq -0x80(%rbp), %r13
movq %r13, %rdi
leaq 0x23469(%rip), %rsi     # 0x50758
callq 0x2c6b4
movq %r13, %rdi
leaq 0x24724(%rip), %rsi     # 0x51a22
callq 0x25650
leaq -0x40(%rbp), %rsi
movq %rsi, -0x50(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2d34e
movq %rdx, -0x50(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x40(%rbp)
jmp 0x2d354
movq 0x40(%r14), %rsi
cmpq 0x48(%r14), %rsi
je 0x2d33f
movq -0x30(%rbp), %rax
movq %rax, (%rsi)
addq $0x8, 0x40(%r14)
jmp 0x2d3a7
movq -0x58(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x2fc70
jmp 0x2d3a7
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %r12, %r13
movq 0x8(%rax), %rdx
movq %rdx, -0x48(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
leaq -0x50(%rbp), %rsi
xorl %edx, %edx
callq 0x2d4fe
movq %r14, %r12
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
movq -0x60(%rbp), %r14
je 0x2d395
callq 0x25320
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
je 0x2d3a7
callq 0x25320
testb %r15b, %r15b
jne 0x2d3c1
movq %rbx, %rdi
movl $0x2c, %esi
callq 0x2ca72
testb %al, %al
jne 0x2d276
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2d618
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0xe0(%rbp), %rdi
cmpq %r12, %rdi
je 0x2d427
callq 0x25320
jmp 0x2d427
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d412
callq 0x25320
jmp 0x2d412
movq %rax, %rbx
leaq -0x70(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x2d452
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2d468
movq %rax, %rbx
movq -0x100(%rbp), %rdi
jmp 0x2d463
movq %rax, %rbx
movq -0x50(%rbp), %rdi
leaq -0x40(%rbp), %rax
cmpq %rax, %rdi
je 0x2d44a
callq 0x25320
jmp 0x2d44a
movq %rax, %rbx
movq -0x80(%rbp), %rdi
leaq -0x70(%rbp), %rax
cmpq %rax, %rdi
jne 0x2d468
jmp 0x2d46d
movq %rax, %rbx
movq -0xc0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2d46d
callq 0x25320
movq %rbx, %rdi
callq 0x255f0
nop