// File: /workspace/github_cpp_makefile_star2_O1/CoinXu[P]reviser-compiler/src/parser.cpp
// Function: reviser::compiler::Parser::ConsumeStructDeclare()
Declare* Parser::ConsumeStructDeclare() {
    Token* sid = CloneToken(tokenizer->Previous());
    // struct type id
    if (!generator->descriptor->FindStructContextVariableById(sid->text)) {
      RuntimeError("undefined struct [" + sid->text + "] in current scope");
    }

    Expect(TOKEN_ID);
    Token* id = CloneToken(token);
    StructValue* sv;

    // struct only allow null to default value
    if (Accept(TOKEN_ASSIGN)) {
      Expect(TOKEN_DATA_TYPE);
      sv = new StructValue(sid, CloneToken(token));
      if (token.text != ReservedWordMap[RESERVED_NULL]) {
        RuntimeError("struct only allow null to default value");
      }
    } else {
      sv = new StructValue(sid, nullptr);
    }

    generator->descriptor->AddDataTypesOnce(TYPE_STRUCT);
    RightValue* rv = new RightValue(sv);
    Declare* declare = new Declare(TYPE_STRUCT, id, sid, rv);
    return declare;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x30392
movq %rax, %rsi
callq 0x2d484
movq %rax, %rbx
movq 0x8(%r14), %rax
movq 0x50(%rax), %r15
leaq -0x98(%rbp), %r13
movq %r13, -0x10(%r13)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
callq 0x2a264
movq %r15, %rdi
movq %r12, %rsi
callq 0x33fbe
movq %rax, %r15
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ec32
callq 0x25320
testq %r15, %r15
jne 0x2ecd4
leaq 0x8(%rbx), %rdx
leaq 0x21a50(%rip), %rsi     # 0x50696
leaq -0x88(%rbp), %r15
movq %r15, %rdi
callq 0x2c6b4
leaq 0x21a4d(%rip), %rsi     # 0x506a9
movq %r15, %rdi
callq 0x25650
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2ec88
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x2ec8f
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq -0x68(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r14, %rdi
xorl %edx, %edx
callq 0x2d4fe
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x2ecc2
callq 0x25320
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ecd4
callq 0x25320
movq %r14, %rdi
movl $0x4, %esi
callq 0x2d618
leaq 0x10(%r14), %r13
movq %r13, %rsi
callq 0x2d484
movq %rax, %r15
movq %r14, %rdi
movl $0x3d, %esi
callq 0x2ca72
testb %al, %al
je 0x2edad
movq %r14, %rdi
xorl %esi, %esi
callq 0x2d618
movl $0x10, %edi
callq 0x25340
movq %rax, %r12
movq %r13, %rsi
callq 0x2d484
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x31c30
leaq -0x88(%rbp), %rsi
movl $0xc, (%rsi)
leaq 0x32baa(%rip), %rdi     # 0x618f0
callq 0x2b236
movq 0x20(%r14), %rdx
cmpq 0x8(%rax), %rdx
jne 0x2ed6a
testq %rdx, %rdx
je 0x2edc7
movq (%rax), %rsi
movq 0x18(%r14), %rdi
callq 0x25360
testl %eax, %eax
je 0x2edc7
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21943(%rip), %rsi     # 0x506bc
leaq 0x21963(%rip), %rdx     # 0x506e3
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x2a2fe
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2d4fe
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2edc7
callq 0x25320
jmp 0x2edc7
movl $0x10, %edi
callq 0x25340
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x31c30
movq 0x8(%r14), %rax
movq 0x50(%rax), %rdi
movl $0xa, %esi
callq 0x3423e
movl $0x58, %edi
callq 0x25340
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x31bbe
movl $0x20, %edi
callq 0x25340
movq %rax, %r12
movq %rax, %rdi
movl $0xa, %esi
movq %r15, %rdx
movq %rbx, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x31c88
movq %r12, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
jmp 0x2ee59
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x2ee51
callq 0x25320
jmp 0x2ee51
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2ee72
jmp 0x2ee77
jmp 0x2ee6c
jmp 0x2ee6c
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2ee72
movq %rax, %rbx
movq %r12, %rdi
callq 0x25320
movq %rbx, %rdi
callq 0x255f0
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2ee72
jmp 0x2ee77