// File: /workspace/github_cpp_makefile_star2_O1/CoinXu[P]reviser-compiler/src/parser.cpp
// Function: reviser::compiler::Parser::ConsumeStruct(reviser::ast::Struct*)
Struct* Parser::ConsumeStruct(Struct* parent) {
    Expect(TOKEN_STRUCT);
    Expect(TOKEN_ID);

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

    Struct* s = new Struct(CloneToken(token));

    Expect(TOKEN_LEFT_BRACE);

    generator->descriptor->PushContextVariable(s);
    generator->descriptor->PushNewContext();

    while (!Accept(TOKEN_RIGHT_BRACE)) {
      if (LookAtType(TOKEN_STRUCT)) {
        s->AddStruct(ConsumeStruct(s));
      } else if (LookAtType(TOKEN_ENUM)) {
        s->AddEnum(ConsumeEnum(s));
      } else {
        StructProperty* p = ConsumeStructProperty();
        if (generator->descriptor->StructIncludeProperty(s, p->declare->id->text)) {
          RuntimeError("duplicate declare property named [" + p->declare->id->text + "]");
        }
        if (generator->descriptor->FindCurrentContextVariableById(p->declare->id->text)) {
          RuntimeError("duplicate declare named [" + p->declare->id->text + "]");
        }
        s->AddProperty(p);
      }
    }

    generator->descriptor->PopBackContext();
    return s;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rsi, %r14
movq %rdi, %rbx
movl $0x2, %esi
callq 0x2d618
movq %rbx, %rdi
movl $0x4, %esi
callq 0x2d618
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r15
leaq -0x128(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq -0x138(%rbp), %r12
movq %r12, %rdi
callq 0x2a264
movq %r15, %rdi
movq %r12, %rsi
callq 0x33d70
testq %rax, %rax
je 0x2cb65
movb $0x1, %r14b
xorl %eax, %eax
jmp 0x2cbb3
testq %r14, %r14
je 0x2cbae
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r15
leaq -0x108(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq -0x118(%rbp), %rdi
callq 0x2a264
leaq -0x118(%rbp), %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x34042
movl %eax, %r14d
movb $0x1, %al
jmp 0x2cbb3
xorl %eax, %eax
xorl %r14d, %r14d
testb %al, %al
je 0x2cbcc
leaq -0x108(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cbcc
callq 0x25320
movq -0x138(%rbp), %rdi
cmpq %r13, %rdi
je 0x2cbdd
callq 0x25320
testb %r14b, %r14b
je 0x2cc8b
leaq 0x18(%rbx), %rdx
leaq 0x23952(%rip), %rsi     # 0x50543
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x2c6b4
leaq 0x24e1e(%rip), %rsi     # 0x51a22
movq %r14, %rdi
callq 0x25650
leaq -0xc8(%rbp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2cc39
movq %rdx, -0xd8(%rbp)
movq (%rcx), %rdx
movq %rdx, -0xc8(%rbp)
jmp 0x2cc40
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
leaq -0xd8(%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 -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x2cc79
callq 0x25320
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cc8b
callq 0x25320
leaq 0x10(%rbx), %r15
movl $0xa0, %edi
callq 0x25340
movq %rax, %r14
movq %r15, %rsi
callq 0x2d484
movq %r14, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x31f34
movq %rbx, %rdi
movl $0x7b, %esi
callq 0x2d618
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
movq %r14, %rsi
callq 0x33b70
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
callq 0x33a74
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2ca72
testb %al, %al
jne 0x2cf9e
leaq -0xa8(%rbp), %r13
movq %r14, -0x50(%rbp)
movq %rbx, -0x58(%rbp)
movq (%rbx), %rdi
callq 0x30388
cmpl $0x2, (%rax)
jne 0x2cd27
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2caf0
movq %r14, %rdi
movq %rax, %rsi
callq 0x32096
jmp 0x2cf89
movq (%rbx), %rdi
callq 0x30388
cmpl $0x3, (%rax)
jne 0x2cd4f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d068
movq %r14, %rdi
movq %rax, %rsi
callq 0x3211e
jmp 0x2cf89
movq %rbx, %rdi
callq 0x2d936
movq 0x8(%rbx), %rcx
movq %r14, %r15
movq 0x50(%rcx), %r12
movq %rax, %rbx
movq 0x48(%rax), %rax
movq 0x8(%rax), %rax
movq %r13, -0xb8(%rbp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq -0xb8(%rbp), %r14
movq %r14, %rdi
callq 0x2a264
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x34042
movl %eax, %r12d
movq -0xb8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2cdb0
callq 0x25320
testb %r12b, %r12b
leaq -0x88(%rbp), %r12
leaq -0xe8(%rbp), %r13
movq %rbx, %r15
movq -0x58(%rbp), %rbx
je 0x2ce7b
movq 0x48(%r15), %rax
movq 0x8(%rax), %rdx
addq $0x8, %rdx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
leaq 0x23775(%rip), %rsi     # 0x5055d
callq 0x2c6b4
movq %r14, %rdi
leaq 0x24c2b(%rip), %rsi     # 0x51a22
callq 0x25650
movq %r12, -0x98(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2ce25
movq %rdx, -0x98(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x88(%rbp)
jmp 0x2ce2d
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x90(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
xorl %edx, %edx
callq 0x2d4fe
movq -0x98(%rbp), %rdi
cmpq %r12, %rdi
je 0x2ce69
callq 0x25320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2ce7b
callq 0x25320
movq 0x8(%rbx), %rax
movq 0x50(%rax), %r12
movq 0x48(%r15), %rax
movq 0x8(%rax), %rax
movq %r13, -0xf8(%rbp)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq -0xf8(%rbp), %r14
movq %r14, %rdi
callq 0x2a264
movq %r12, %rdi
movq %r14, %rsi
callq 0x33d70
movq %rax, %r12
movq -0xf8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2cecb
callq 0x25320
testq %r12, %r12
leaq -0x68(%rbp), %r12
je 0x2cf73
movq 0x48(%r15), %rax
movq 0x8(%rax), %rdx
addq $0x8, %rdx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
leaq 0x23651(%rip), %rsi     # 0x50543
callq 0x2c6b4
movq %r14, %rdi
leaq 0x24b21(%rip), %rsi     # 0x51a22
callq 0x25650
movq %r12, -0x78(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2cf26
movq %rdx, -0x78(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x68(%rbp)
jmp 0x2cf2e
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x70(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
leaq -0x78(%rbp), %rsi
xorl %edx, %edx
callq 0x2d4fe
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x2cf61
callq 0x25320
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2cf73
callq 0x25320
movq -0x50(%rbp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3200e
leaq -0xa8(%rbp), %r13
movq %rbx, %rdi
movl $0x7d, %esi
callq 0x2ca72
testb %al, %al
je 0x2ccff
movq 0x8(%rbx), %rax
movq 0x50(%rax), %rdi
callq 0x33acc
movq %r14, %rax
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x118(%rbp), %rdi
cmpq %r12, %rdi
je 0x2cffc
callq 0x25320
jmp 0x2cffc
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
cmpq %r14, %rdi
je 0x2cfef
callq 0x25320
jmp 0x2cfef
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
jmp 0x2d039
movq %rax, %rbx
movq -0x138(%rbp), %rdi
jmp 0x2d061
movq %rax, %rbx
movq -0x98(%rbp), %rdi
jmp 0x2d022
jmp 0x2d02e
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2d03e
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r12, %rdi
je 0x2d031
callq 0x25320
jmp 0x2d031
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2d043
callq 0x25320
movq %rbx, %rdi
callq 0x255f0
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
jmp 0x2d061
movq %rax, %rbx
movq -0xf8(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2d03e
jmp 0x2d043