// File: /workspace/github_cpp_makefile_star2_O1/CoinXu[P]reviser-compiler/src/parser.cpp
// Function: reviser::compiler::Parser::ConsumeDataTypeDeclare()
Declare* Parser::ConsumeDataTypeDeclare() {
    Token* id = CloneToken(tokenizer->Current());
    string type = PreviousText();

    Expect(TOKEN_ID);

    // TODO
    // value optional support
    Expect(TOKEN_ASSIGN);

    Token* dvt = CloneToken(tokenizer->Current());
    string value = CurrentText();
    DataType data_type = DataTypeValue.at(type);

    switch (data_type) {
      case TYPE_BOOL:
        if (!helper::bool_is_bool(value)) {
          RuntimeError("expect bool value but received", dvt);
        } else {
          generator->descriptor->AddDataTypesOnce(TYPE_BOOL);
          Next();
        }
        break;

      case TYPE_FLOAT:
        if (!helper::numeric_is_float(value)) {
          RuntimeError("exceeds range of float", dvt);
        }
        generator->descriptor->AddDataTypesOnce(TYPE_FLOAT);
        Expect(TOKEN_DIGIT);
        break;

      case TYPE_DOUBLE:
        if (!helper::numeric_is_double(value)) {
          RuntimeError("exceeds range of double", dvt);
        }
        generator->descriptor->AddDataTypesOnce(TYPE_DOUBLE);
        Expect(TOKEN_DIGIT);
        break;

      case TYPE_INT32:
        if (!helper::numeric_is_int32(value)) {
          RuntimeError("exceeds range of int32", dvt);
        }
        generator->descriptor->AddDataTypesOnce(TYPE_INT32);
        Expect(TOKEN_DIGIT);
        break;

      case TYPE_INT64:
        if (!helper::numeric_is_int64(value)) {
          RuntimeError("exceeds range of int64", dvt);
        }
        generator->descriptor->AddDataTypesOnce(TYPE_INT64);
        Expect(TOKEN_DIGIT);
        break;

      case TYPE_UINT32:
        if (!helper::numeric_is_uint32(value)) {
          RuntimeError("exceeds range of uint32", dvt);
        }
        generator->descriptor->AddDataTypesOnce(TYPE_UINT32);
        Expect(TOKEN_DIGIT);
        break;

      case TYPE_UINT64:
        if (!helper::numeric_is_uint64(value)) {
          RuntimeError("exceeds range of uint64", dvt);
        }
        generator->descriptor->AddDataTypesOnce(TYPE_UINT64);
        Expect(TOKEN_DIGIT);
        break;

      case TYPE_STRING:
        generator->descriptor->AddDataTypesOnce(TYPE_STRING);
        Expect(TOKEN_LETTER);
        break;

      default:
        RuntimeError("unknow data type [" + type + "]");
        break;
    }

    RightValue* rv = new RightValue(data_type, dvt);
    Declare* declare = new Declare(data_type, id, rv);
    return declare;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdi, %r15
movq (%rdi), %rdi
callq 0x30388
movq %rax, %rsi
callq 0x2d484
movq %rax, -0x50(%rbp)
movq (%r15), %rdi
callq 0x30392
leaq -0x60(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq -0x70(%rbp), %rdi
callq 0x2a264
movq %r15, %rdi
movl $0x4, %esi
callq 0x2d618
movq %r15, %rdi
movl $0x3d, %esi
callq 0x2d618
movq (%r15), %rdi
callq 0x30388
movq %rax, %rsi
callq 0x2d484
movq %rax, %r14
movq (%r15), %rdi
callq 0x30388
leaq -0x38(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x8(%rax), %rsi
movq 0x10(%rax), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %rdi
callq 0x2a264
leaq 0x336a7(%rip), %rdi     # 0x61950
leaq -0x70(%rbp), %rsi
callq 0x2f726
movl (%rax), %r12d
cmpq $0x7, %r12
ja 0x2e757
leaq 0x22236(%rip), %rax     # 0x504fc
movslq (%rax,%r12,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq -0x240(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x250(%rbp), %rdi
callq 0x2a264
leaq -0x250(%rbp), %rdi
callq 0x2b168
movl %eax, %ebx
movq -0x250(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e310
callq 0x25320
testb %bl, %bl
je 0x2e7a8
movq 0x8(%r15), %rax
movq 0x50(%rax), %rdi
xorl %esi, %esi
callq 0x3423e
movq (%r15), %rdi
callq 0x308a0
jmp 0x2e6df
leaq -0x140(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %rdi
callq 0x2a264
leaq -0x150(%rbp), %rdi
callq 0x2af02
movl %eax, %ebx
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e375
callq 0x25320
movl $0x4, %r13d
testb %bl, %bl
jne 0x2e6c0
leaq -0x120(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x222a7(%rip), %rsi     # 0x5063c
leaq 0x222b6(%rip), %rdx     # 0x50652
leaq -0x130(%rbp), %rdi
callq 0x2a2fe
leaq -0x130(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0x130(%rbp), %rdi
jmp 0x2e6b3
leaq -0x1c0(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x1d0(%rbp), %rdi
callq 0x2a264
leaq -0x1d0(%rbp), %rdi
callq 0x2add9
movl %eax, %ebx
movq -0x1d0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e407
callq 0x25320
movl $0x2, %r13d
testb %bl, %bl
jne 0x2e6c0
leaq -0x1a0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x221e6(%rip), %rsi     # 0x5060d
leaq 0x221f6(%rip), %rdx     # 0x50624
leaq -0x1b0(%rbp), %rdi
callq 0x2a2fe
leaq -0x1b0(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0x1b0(%rbp), %rdi
jmp 0x2e6b3
leaq -0x180(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x190(%rbp), %rdi
callq 0x2a264
leaq -0x190(%rbp), %rdi
callq 0x2ae66
movl %eax, %ebx
movq -0x190(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e499
callq 0x25320
movl $0x3, %r13d
testb %bl, %bl
jne 0x2e6c0
leaq -0x160(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2216c(%rip), %rsi     # 0x50625
leaq 0x2217b(%rip), %rdx     # 0x5063b
leaq -0x170(%rbp), %rdi
callq 0x2a2fe
leaq -0x170(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0x170(%rbp), %rdi
jmp 0x2e6b3
movq 0x8(%r15), %rax
movq 0x50(%rax), %rdi
movl $0x5, %ebx
movl $0x7, %esi
callq 0x3423e
jmp 0x2e6d5
leaq -0x200(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x210(%rbp), %rdi
callq 0x2a264
leaq -0x210(%rbp), %rdi
callq 0x2ad4c
movl %eax, %ebx
movq -0x210(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e547
callq 0x25320
movl $0x1, %r13d
testb %bl, %bl
jne 0x2e6c0
leaq -0x1e0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2208f(%rip), %rsi     # 0x505f6
leaq 0x2209e(%rip), %rdx     # 0x5060c
leaq -0x1f0(%rbp), %rdi
callq 0x2a2fe
leaq -0x1f0(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0x1f0(%rbp), %rdi
jmp 0x2e6b3
leaq -0x100(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0x110(%rbp), %rdi
callq 0x2a264
leaq -0x110(%rbp), %rdi
callq 0x2af9e
movl %eax, %ebx
movq -0x110(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e5d9
callq 0x25320
movl $0x5, %r13d
testb %bl, %bl
jne 0x2e6c0
leaq -0xe0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x2205a(%rip), %rsi     # 0x50653
leaq 0x2206a(%rip), %rdx     # 0x5066a
leaq -0xf0(%rbp), %rdi
callq 0x2a2fe
leaq -0xf0(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0xf0(%rbp), %rdi
jmp 0x2e6b3
leaq -0xc0(%rbp), %r13
movq %r13, -0x10(%r13)
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x2a264
leaq -0xd0(%rbp), %rdi
callq 0x2b036
movl %eax, %ebx
movq -0xd0(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e66b
callq 0x25320
movl $0x6, %r13d
testb %bl, %bl
jne 0x2e6c0
leaq -0xa0(%rbp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x21fe4(%rip), %rsi     # 0x5066b
leaq 0x21ff4(%rip), %rdx     # 0x50682
leaq -0xb0(%rbp), %rdi
callq 0x2a2fe
leaq -0xb0(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0xb0(%rbp), %rdi
cmpq %rbx, %rdi
je 0x2e6c0
callq 0x25320
movl %r12d, %r13d
movq 0x8(%r15), %rax
movq 0x50(%rax), %rdi
movl $0x6, %ebx
movl %r13d, %esi
callq 0x3423e
movq %r15, %rdi
movl %ebx, %esi
callq 0x2d618
movl $0x58, %edi
callq 0x25340
movq %rax, %r15
movq %rax, %rdi
movl %r12d, %esi
movq %r14, %rdx
xorl %ecx, %ecx
callq 0x31ba0
movl $0x20, %edi
callq 0x25340
movq %rax, %r14
movq %rax, %rdi
movl %r12d, %esi
movq -0x50(%rbp), %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x31c6c
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2e730
callq 0x25320
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2e742
callq 0x25320
movq %r14, %rax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x21f25(%rip), %rsi     # 0x50683
leaq -0x270(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x2c6b4
leaq 0x232ad(%rip), %rsi     # 0x51a22
leaq -0x270(%rbp), %rdi
callq 0x25650
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2e7f0
movq %rdx, -0x90(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x80(%rbp)
jmp 0x2e7f8
leaq -0x220(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x21e1d(%rip), %rsi     # 0x505d7
leaq 0x21e34(%rip), %rdx     # 0x505f5
leaq -0x230(%rbp), %rdi
callq 0x2a2fe
leaq -0x230(%rbp), %rsi
movq %r15, %rdi
movq %r14, %rdx
callq 0x2d4fe
movq -0x230(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2e845
jmp 0x2e6df
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
leaq -0x90(%rbp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %r15, %rdi
xorl %edx, %edx
callq 0x2d4fe
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e831
callq 0x25320
leaq -0x260(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e6df
callq 0x25320
jmp 0x2e6df
movq %rax, %r12
movq -0xb0(%rbp), %rdi
jmp 0x2e8a4
movq %rax, %r12
movq -0x230(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0xf0(%rbp), %rdi
jmp 0x2e8a4
movq %rax, %r12
movq -0x1f0(%rbp), %rdi
jmp 0x2e8a4
movq %rax, %r12
movq -0x170(%rbp), %rdi
jmp 0x2e8a4
movq %rax, %r12
movq -0x1b0(%rbp), %rdi
jmp 0x2e8a4
movq %rax, %r12
movq -0x130(%rbp), %rdi
cmpq %rbx, %rdi
jne 0x2e96e
jmp 0x2e983
jmp 0x2e980
jmp 0x2e980
jmp 0x2e980
jmp 0x2e980
jmp 0x2e980
jmp 0x2e980
jmp 0x2e980
movq %rax, %r12
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x2e8ee
callq 0x25320
jmp 0x2e8ee
movq %rax, %r12
leaq -0x260(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x2e96e
jmp 0x2e983
movq %rax, %r12
movq -0xd0(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0x110(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0x210(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0x190(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0x250(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0x1d0(%rbp), %rdi
jmp 0x2e955
movq %rax, %r12
movq -0x150(%rbp), %rdi
cmpq %r13, %rdi
jne 0x2e96e
jmp 0x2e983
jmp 0x2e980
movq %rax, %r12
movq %r14, %rdi
jmp 0x2e96e
jmp 0x2e980
movq %rax, %r12
movq %r15, %rdi
callq 0x25320
jmp 0x2e983
jmp 0x2e980
jmp 0x2e97b
jmp 0x2e97b
movq %rax, %r12
jmp 0x2e995
movq %rax, %r12
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x2e995
callq 0x25320
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2e9a7
callq 0x25320
movq %r12, %rdi
callq 0x255f0
nop