// File: /workspace/github_cpp_makefile_star2_O2/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: LocalVarToken::output(Parser*, std::shared_ptr<FunctionToken> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void LocalVarToken::output(Parser *parser,
			   const std::shared_ptr<FunctionToken>&,
			   const std::string&,
			   const std::string&,
			   const std::string&) {
  // If this is an array, store the address of the data in the variable's
  // location.
  if (_type.isArray()) {
    // Store the location of the array at the variable's location.
    if (this->isReg()) {
      // Store FP + _dataOffset in the variable's register.
      parser->writeInst("MOV " + this->getReg() + " FP");
      if (0 != _dataOffset) {
        parser->writeInst("MOVI L " + toHexStr(_dataOffset));
        parser->writeInst("ADD " + this->getReg() + " L");
      }
    } else {
      // Store FP + _offset in M
      parser->writeInst("MOV M FP");
      if (0 != _offset) {
        parser->writeInst("MOVI L " + toHexStr(_offset));
        parser->writeInst("ADD M L");
      }
      // Store FP + _dataOffset in N
      parser->writeInst("MOV N FP");
      if (0 != _dataOffset) {
        parser->writeInst("MOVI L " + toHexStr(_dataOffset));
        parser->writeInst("ADD N L");
      }
      // Store the data offset in the variable's location relative to
      // the frame pointer.
      parser->writeInst("STOR N M");
    }
  }
  // If there is no initial value, do nothing else.
  if (_initExprs.empty()) {
    return;
  }
  // Store initial values.
  if (_type.isArray()) {
    for (size_t i = 0; i < _initExprs.size(); i++) {
      // Output initial expressions for each element.
      _initExprs[i]->output(parser, VarLocation(_dataOffset + (DATA_SIZE * i)));
    }
  } else {
    // Output initial expression for the scalar, to either the register
    // or frame pointer offset.
    _initExprs[0]->output(parser, VarLocation(_reg, _offset));
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x10(%rdi), %r15
cmpb $0x1, 0x68(%rdi)
jne 0x170c8
cmpq $0x0, 0x18(%r14)
je 0x16f6c
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x73e0
leaq 0x122b7(%rip), %rsi     # 0x29129
leaq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0x1832f
leaq 0x12f00(%rip), %rdx     # 0x29d86
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x9ad4
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x28(%rsp), %rdi
callq 0x75c8
leaq 0x48(%rsp), %rdi
callq 0x75c8
movzwl 0xb0(%r14), %eax
testw %ax, %ax
je 0x170c8
movzwl %ax, %esi
leaq 0x28(%rsp), %r12
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x27ea7
leaq 0x12936(%rip), %rsi     # 0x2981b
movq %rsp, %rdi
movq %r12, %rdx
callq 0x1832f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x28(%rsp), %rdi
callq 0x75c8
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x73e0
leaq 0x12f62(%rip), %rsi     # 0x29e86
leaq 0x28(%rsp), %rdi
movq %r12, %rdx
callq 0x1832f
leaq 0x12b9f(%rip), %rdx     # 0x29ad7
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x9ad4
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x28(%rsp), %rdi
callq 0x75c8
leaq 0x48(%rsp), %rdi
jmp 0x170c3
leaq 0x12a3e(%rip), %rsi     # 0x299b1
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x9502
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
movl 0x30(%r14), %eax
testl %eax, %eax
je 0x17004
movzwl %ax, %esi
leaq 0x28(%rsp), %r12
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x27ea7
leaq 0x12866(%rip), %rsi     # 0x2981b
movq %rsp, %rdi
movq %r12, %rdx
callq 0x1832f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x28(%rsp), %rdi
callq 0x75c8
leaq 0x129d6(%rip), %rsi     # 0x299ba
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x9502
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x12e80(%rip), %rsi     # 0x29e8b
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x9502
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
movzwl 0xb0(%r14), %eax
testw %ax, %ax
je 0x170a1
movzwl %ax, %esi
leaq 0x28(%rsp), %r12
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x27ea7
leaq 0x127c9(%rip), %rsi     # 0x2981b
movq %rsp, %rdi
movq %r12, %rdx
callq 0x1832f
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x28(%rsp), %rdi
callq 0x75c8
leaq 0x12e13(%rip), %rsi     # 0x29e94
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x9502
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
leaq 0x12710(%rip), %rsi     # 0x297b8
movq %rsp, %rdi
leaq 0x28(%rsp), %rdx
callq 0x9502
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x914a
movq %rsp, %rdi
callq 0x75c8
movq 0x98(%r14), %rax
movq 0xa0(%r14), %rcx
cmpq %rcx, %rax
je 0x1717a
cmpb $0x1, 0x68(%r14)
jne 0x1714b
leaq 0x10(%rsp), %r12
xorl %r13d, %r13d
movq %rsp, %r15
xorl %ebp, %ebp
subq %rax, %rcx
sarq $0x4, %rcx
cmpq %rcx, %rbp
jae 0x1717a
movq (%rax,%r13,8), %rdi
movzwl 0xb0(%r14), %eax
movq %r12, (%rsp)
andq $0x0, 0x8(%rsp)
addl %r13d, %eax
movb $0x0, 0x10(%rsp)
movl %eax, 0x20(%rsp)
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10ca6
movq %r15, %rdi
callq 0x75c8
incq %rbp
movq 0x98(%r14), %rax
movq 0xa0(%r14), %rcx
addq $0x2, %r13
jmp 0x170f3
movq (%rax), %r12
movl 0x30(%r14), %ebp
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x73e0
movl %ebp, 0x20(%r14)
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10ca6
movq %rsp, %rdi
callq 0x75c8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x171ed
jmp 0x171a3
jmp 0x171ae
jmp 0x171bb
jmp 0x171ed
jmp 0x171a3
jmp 0x171ae
jmp 0x171bb
jmp 0x171ed
jmp 0x171a3
jmp 0x171ed
jmp 0x171a3
jmp 0x171ed
movq %rax, %rbx
jmp 0x171f8
jmp 0x171c7
jmp 0x171d4
jmp 0x171e3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x75c8
jmp 0x171be
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
jmp 0x171f3
jmp 0x171ed
movq %rax, %rbx
movq %rsp, %rdi
callq 0x75c8
jmp 0x171d7
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x75c8
jmp 0x171e6
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
jmp 0x171f3
movq %rax, %rbx
movq %rsp, %rdi
callq 0x75c8
movq %rbx, %rdi
callq 0x7510