// File: CoinXu[P]reviser-compiler/src/parser.cpp
// Function: reviser::compiler::Parser::ConsumeDataTypeArrayDeclare(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Declare* Parser::ConsumeDataTypeArrayDeclare(string type_string) {
    Expect(TOKEN_RIGHT_BRACKET);

    if (DataTypeValue.find(type_string) == DataTypeValue.end()) {
      RuntimeError("unknow data type: " + type_string);
    }

    Expect(TOKEN_ID);
    const Token id = token;

    Expect(TOKEN_ASSIGN);
    Expect(TOKEN_LEFT_BRACKET);
    // TODO support initial values
    Expect(TOKEN_RIGHT_BRACKET);

    DataType type = DataTypeValue.at(type_string);

    generator->descriptor->include_type_array = true;
    generator->descriptor->AddDataTypesOnce(type);

    RightValue* rv = new RightValue(type, CloneToken(token), true);
    return new Declare(type, CloneToken(id), rv, true);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rsi, -0xa8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
movl $0x5d, %esi
callq 0xa83a0
movq -0xa8(%rbp), %rsi
leaq 0x87b63(%rip), %rdi     # 0x130aa0
callq 0xab270
movq %rax, -0x18(%rbp)
leaq 0x87b53(%rip), %rdi     # 0x130aa0
callq 0xab2a0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0xab240
testb $0x1, %al
jne 0xa8f69
jmp 0xa8fc5
movq -0xa8(%rbp), %rdx
leaq 0x565fd(%rip), %rsi     # 0xff574
leaq -0x40(%rbp), %rdi
movq %rdi, -0xb8(%rbp)
callq 0xa6e30
movq -0xb0(%rbp), %rdi
movq -0xb8(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0xa82a0
jmp 0xa8fa0
leaq -0x40(%rbp), %rdi
callq 0x992c0
jmp 0xa8fc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x992c0
jmp 0xa91ad
movq -0xb0(%rbp), %rdi
movl $0x4, %esi
callq 0xa83a0
movq -0xb0(%rbp), %rsi
addq $0x10, %rsi
leaq -0x90(%rbp), %rdi
callq 0xaade0
movq -0xb0(%rbp), %rdi
movl $0x3d, %esi
callq 0xa83a0
jmp 0xa9000
movq -0xb0(%rbp), %rdi
movl $0x5b, %esi
callq 0xa83a0
jmp 0xa9013
movq -0xb0(%rbp), %rdi
movl $0x5d, %esi
callq 0xa83a0
jmp 0xa9026
movq -0xa8(%rbp), %rsi
leaq 0x87a6c(%rip), %rdi     # 0x130aa0
callq 0xab2d0
movq %rax, -0xc0(%rbp)
jmp 0xa9042
movq -0xb0(%rbp), %rax
movq -0xc0(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, -0x94(%rbp)
movq 0x8(%rax), %rcx
movq 0x50(%rcx), %rcx
movb $0x1, 0x60(%rcx)
movq 0x8(%rax), %rax
movq 0x50(%rax), %rdi
movl -0x94(%rbp), %esi
callq 0xbd440
jmp 0xa9079
movl $0x58, %edi
callq 0x99480
movq %rax, -0xc8(%rbp)
jmp 0xa908c
movq -0xb0(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, -0xd4(%rbp)
movq %rdi, %rsi
addq $0x10, %rsi
callq 0xa81f0
movq %rax, -0xd0(%rbp)
jmp 0xa90b4
movq -0xd0(%rbp), %rdx
movl -0xd4(%rbp), %esi
movq -0xc8(%rbp), %rdi
movl $0x1, %ecx
callq 0xb3320
jmp 0xa90d4
movq -0xc8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movl $0x20, %edi
callq 0x99480
movq %rax, -0xe0(%rbp)
jmp 0xa90f5
movq -0xb0(%rbp), %rdi
movl -0x94(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0x90(%rbp), %rsi
callq 0xa81f0
movq %rax, -0xe8(%rbp)
jmp 0xa911d
movq -0xe8(%rbp), %rdx
movl -0xec(%rbp), %esi
movq -0xe0(%rbp), %rdi
movq -0xa0(%rbp), %rcx
movl $0x1, %r8d
callq 0xb3530
jmp 0xa9145
leaq -0x90(%rbp), %rdi
callq 0xa0bf0
movq -0xe0(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xa91a1
movq -0xc8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x99440
jmp 0xa91a1
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x99440
leaq -0x90(%rbp), %rdi
callq 0xa0bf0
movq -0x48(%rbp), %rdi
callq 0x99840
nopw %cs:(%rax,%rax)