// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: GlobalVarToken::output(Parser*)
void GlobalVarToken::output(Parser *parser) {
  // Write out a label for the global variable.
  parser->writeln(_name + ":");
  if (_type.isArray()) {
    // The address for the array's elements will be the current byte
    // position plus the instruction size.
    parser->writeData(toHexStr(parser->getBytePos() + INST_SIZE), 1);
    // Write out the array's elements as hex values.
    std::string dataOutput;
    for (size_t i = 0; i < _arrayValues.size(); i++) {
      dataOutput += toHexStr(_arrayValues[i]);
      if (i + 1 < _arrayValues.size()) {
        dataOutput += " ";
      }
    }
    parser->writeData(dataOutput, _arrayValues.size());
  } else {
    // Not an array, just write out the single hex value.
    parser->writeData(toHexStr(_value), 1);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x70(%rdi), %rsi
movq 0x78(%rdi), %rdx
addq %rsi, %rdx
movq %rsp, %r15
movq %r15, %rdi
callq 0xc014
leaq 0x20193(%rip), %rsi     # 0x385f8
movq %r15, %rdi
callq 0x7560
movq %rsp, %rsi
movq %rbx, %rdi
callq 0xb2c4
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x1848e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
cmpb $0x1, 0x68(%r14)
jne 0x18598
movl 0x290(%rbx), %eax
addl $0x4, %eax
movzwl %ax, %esi
movq %rsp, %r15
movq %r15, %rdi
movl $0x4, %edx
callq 0x33cd0
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0xb3b4
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x184db
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, 0x20(%rsp)
movq %r12, (%rsp)
movq $0x0, 0x8(%rsp)
movb $0x0, 0x10(%rsp)
movq 0x98(%r14), %rax
movq 0xa0(%r14), %rdx
subq %rax, %rdx
je 0x185e5
leaq 0x38(%rsp), %rbp
xorl %ebx, %ebx
leaq 0x28(%rsp), %r15
movq %rsp, %r12
leaq 0x1dc26(%rip), %r13     # 0x36145
movzwl (%rax,%rbx,2), %esi
movq %r15, %rdi
movl $0x4, %edx
callq 0x33cd0
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq %r12, %rdi
callq 0x70d0
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x18559
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
incq %rbx
movq 0xa0(%r14), %rax
subq 0x98(%r14), %rax
sarq %rax
cmpq %rax, %rbx
jae 0x1857d
movq %r12, %rdi
movq %r13, %rsi
callq 0x7560
movq 0x98(%r14), %rax
movq 0xa0(%r14), %rdx
subq %rax, %rdx
sarq %rdx
cmpq %rdx, %rbx
jb 0x1851f
jmp 0x185e8
movzwl 0x92(%r14), %esi
movq %rsp, %r14
movq %r14, %rdi
movl $0x4, %edx
callq 0x33cd0
movq %rbx, %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xb3b4
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x185d6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
sarq %rdx
movq %rsp, %rsi
movq 0x20(%rsp), %rdi
callq 0xb3b4
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
jne 0x185c9
jmp 0x185d6
jmp 0x1861d
jmp 0x1860d
jmp 0x1860d
jmp 0x1860d
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
jne 0x1864a
jmp 0x18657
jmp 0x1861d
movq %rax, %rbx
jmp 0x1863c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
je 0x1863c
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x72c0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x18657
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rbx, %rdi
callq 0x74f0
nop