// File: /workspace/github_cpp_makefile_star2_O3/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 0x2f19e
movq %rax, %rsi
callq 0x2c258
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 0x290da
movq %r15, %rdi
movq %r12, %rsi
callq 0x32d46
movq %rax, %r15
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
je 0x2da12
callq 0x24320
testq %r15, %r15
jne 0x2dab4
leaq 0x8(%rbx), %rdx
leaq 0x21c70(%rip), %rsi     # 0x4f696
leaq -0x88(%rbp), %r15
movq %r15, %rdi
callq 0x2b4b3
leaq 0x21c6d(%rip), %rsi     # 0x4f6a9
movq %r15, %rdi
callq 0x24650
leaq -0x58(%rbp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2da68
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x2da6f
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 0x2c2d2
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x2daa2
callq 0x24320
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2dab4
callq 0x24320
movq %r14, %rdi
movl $0x4, %esi
callq 0x2c3ec
leaq 0x10(%r14), %r13
movq %r13, %rsi
callq 0x2c258
movq %rax, %r15
movq %r14, %rdi
movl $0x3d, %esi
callq 0x2b86e
testb %al, %al
je 0x2db8d
movq %r14, %rdi
xorl %esi, %esi
callq 0x2c3ec
movl $0x10, %edi
callq 0x24340
movq %rax, %r12
movq %r13, %rsi
callq 0x2c258
movq %r12, %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x30a30
leaq -0x88(%rbp), %rsi
movl $0xc, (%rsi)
leaq 0x32dca(%rip), %rdi     # 0x608f0
callq 0x2a05c
movq 0x20(%r14), %rdx
cmpq 0x8(%rax), %rdx
jne 0x2db4a
testq %rdx, %rdx
je 0x2dba7
movq (%rax), %rsi
movq 0x18(%r14), %rdi
callq 0x24360
testl %eax, %eax
je 0x2dba7
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x21b63(%rip), %rsi     # 0x4f6bc
leaq 0x21b83(%rip), %rdx     # 0x4f6e3
leaq -0x48(%rbp), %r13
movq %r13, %rdi
callq 0x29178
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2c2d2
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2dba7
callq 0x24320
jmp 0x2dba7
movl $0x10, %edi
callq 0x24340
movq %rax, %r12
movq %rax, %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x30a30
movq 0x8(%r14), %rax
movq 0x50(%rax), %rdi
movl $0xa, %esi
callq 0x32fbc
movl $0x58, %edi
callq 0x24340
movq %rax, %r14
movq %rax, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x309be
movl $0x20, %edi
callq 0x24340
movq %rax, %r12
movq %rax, %rdi
movl $0xa, %esi
movq %r15, %rdx
movq %rbx, %rcx
movq %r14, %r8
xorl %r9d, %r9d
callq 0x30a88
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 0x2dc39
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r15, %rdi
je 0x2dc31
callq 0x24320
jmp 0x2dc31
movq %rax, %rbx
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2dc52
jmp 0x2dc57
jmp 0x2dc4c
jmp 0x2dc4c
movq %rax, %rbx
movq %r14, %rdi
jmp 0x2dc52
movq %rax, %rbx
movq %r12, %rdi
callq 0x24320
movq %rbx, %rdi
callq 0x245f0
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2dc52
jmp 0x2dc57