// File: 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
movq %rsp, %rbp
subq $0x3c0, %rsp            # imm = 0x3C0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x2e8(%rbp)
addq $0x10, %rdi
addq $0x28, %rdi
callq 0x33e20
testb $0x1, %al
jne 0x2f894
jmp 0x3006f
movq -0x2e8(%rbp), %rdi
addq $0x10, %rdi
callq 0x33980
testb $0x1, %al
jne 0x2f8ad
jmp 0x2fb6e
movq -0x2e8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x2f8(%rbp)
addq $0x10, %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x2f0(%rbp)
callq 0x339a0
movq -0x2f0(%rbp), %rdx
leaq 0x3f849(%rip), %rsi     # 0x6f12d
leaq -0x70(%rbp), %rdi
callq 0x325f0
jmp 0x2f8ef
leaq 0x40520(%rip), %rdx     # 0x6fe16
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xe020
jmp 0x2f905
movq -0x2f8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xc600
jmp 0x2f917
leaq -0x50(%rbp), %rdi
callq 0x8848
leaq -0x70(%rbp), %rdi
callq 0x8848
leaq -0x90(%rbp), %rdi
callq 0x8848
movq -0x2e8(%rbp), %rax
movzwl 0xb0(%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2fb69
movq -0x2e8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x308(%rbp)
movzwl 0xb0(%rax), %esi
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x300(%rbp)
movl $0x4, %edx
callq 0x6c950
movq -0x300(%rbp), %rdx
leaq 0x3ff1f(%rip), %rsi     # 0x6f8ab
leaq -0xc0(%rbp), %rdi
callq 0x325f0
jmp 0x2f99a
movq -0x308(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xc600
jmp 0x2f9af
leaq -0xc0(%rbp), %rdi
callq 0x8848
leaq -0xe0(%rbp), %rdi
callq 0x8848
movq -0x2e8(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x318(%rbp)
addq $0x10, %rsi
leaq -0x140(%rbp), %rdi
movq %rdi, -0x310(%rbp)
callq 0x339a0
movq -0x310(%rbp), %rdx
leaq 0x40518(%rip), %rsi     # 0x6ff16
leaq -0x120(%rbp), %rdi
callq 0x325f0
jmp 0x2fa0c
leaq 0x40154(%rip), %rdx     # 0x6fb67
leaq -0x100(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xe020
jmp 0x2fa28
movq -0x318(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xc600
jmp 0x2fa3d
leaq -0x100(%rbp), %rdi
callq 0x8848
leaq -0x120(%rbp), %rdi
callq 0x8848
leaq -0x140(%rbp), %rdi
callq 0x8848
jmp 0x2fb69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2fab2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2faa9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x8848
leaq -0x70(%rbp), %rdi
callq 0x8848
leaq -0x90(%rbp), %rdi
callq 0x8848
jmp 0x30260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2faf5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x8848
leaq -0xe0(%rbp), %rdi
callq 0x8848
jmp 0x30260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2fb58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2fb4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x100(%rbp), %rdi
callq 0x8848
leaq -0x120(%rbp), %rdi
callq 0x8848
leaq -0x140(%rbp), %rdi
callq 0x8848
jmp 0x30260
jmp 0x3006d
movq -0x10(%rbp), %rax
movq %rax, -0x328(%rbp)
leaq -0x161(%rbp), %rdi
movq %rdi, -0x320(%rbp)
callq 0x8760
movq -0x320(%rbp), %rdx
leaq 0x3fea7(%rip), %rsi     # 0x6fa41
leaq -0x160(%rbp), %rdi
callq 0xced0
jmp 0x2fba8
movq -0x328(%rbp), %rdi
leaq -0x160(%rbp), %rsi
callq 0xc600
jmp 0x2fbbd
leaq -0x160(%rbp), %rdi
callq 0x8848
leaq -0x161(%rbp), %rdi
callq 0x8460
movq -0x2e8(%rbp), %rcx
xorl %eax, %eax
cmpl 0x30(%rcx), %eax
je 0x2fd93
movq -0x2e8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x338(%rbp)
movzwl 0x30(%rax), %esi
leaq -0x1a8(%rbp), %rdi
movq %rdi, -0x330(%rbp)
movl $0x4, %edx
callq 0x6c950
movq -0x330(%rbp), %rdx
leaq 0x3fc88(%rip), %rsi     # 0x6f8ab
leaq -0x188(%rbp), %rdi
callq 0x325f0
jmp 0x2fc31
movq -0x338(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0xc600
jmp 0x2fc46
leaq -0x188(%rbp), %rdi
callq 0x8848
leaq -0x1a8(%rbp), %rdi
callq 0x8848
movq -0x10(%rbp), %rax
movq %rax, -0x348(%rbp)
leaq -0x1c9(%rbp), %rdi
movq %rdi, -0x340(%rbp)
callq 0x8760
movq -0x340(%rbp), %rdx
leaq 0x3fdc0(%rip), %rsi     # 0x6fa4a
leaq -0x1c8(%rbp), %rdi
callq 0xced0
jmp 0x2fc98
movq -0x348(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0xc600
jmp 0x2fcad
leaq -0x1c8(%rbp), %rdi
callq 0x8848
leaq -0x1c9(%rbp), %rdi
callq 0x8460
jmp 0x2fd93
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2fcfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x160(%rbp), %rdi
callq 0x8848
leaq -0x161(%rbp), %rdi
callq 0x8460
jmp 0x30260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2fd3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x8848
leaq -0x1a8(%rbp), %rdi
callq 0x8848
jmp 0x30260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2fd82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x8848
leaq -0x1c9(%rbp), %rdi
callq 0x8460
jmp 0x30260
movq -0x10(%rbp), %rax
movq %rax, -0x358(%rbp)
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x350(%rbp)
callq 0x8760
movq -0x350(%rbp), %rdx
leaq 0x4015c(%rip), %rsi     # 0x6ff1b
leaq -0x1f0(%rbp), %rdi
callq 0xced0
jmp 0x2fdcd
movq -0x358(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xc600
jmp 0x2fde2
leaq -0x1f0(%rbp), %rdi
callq 0x8848
leaq -0x1f1(%rbp), %rdi
callq 0x8460
movq -0x2e8(%rbp), %rax
movzwl 0xb0(%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x2ffc1
movq -0x2e8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x368(%rbp)
movzwl 0xb0(%rax), %esi
leaq -0x238(%rbp), %rdi
movq %rdi, -0x360(%rbp)
movl $0x4, %edx
callq 0x6c950
movq -0x360(%rbp), %rdx
leaq 0x3fa5a(%rip), %rsi     # 0x6f8ab
leaq -0x218(%rbp), %rdi
callq 0x325f0
jmp 0x2fe5f
movq -0x368(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0xc600
jmp 0x2fe74
leaq -0x218(%rbp), %rdi
callq 0x8848
leaq -0x238(%rbp), %rdi
callq 0x8848
movq -0x10(%rbp), %rax
movq %rax, -0x378(%rbp)
leaq -0x259(%rbp), %rdi
movq %rdi, -0x370(%rbp)
callq 0x8760
movq -0x370(%rbp), %rdx
leaq 0x4006c(%rip), %rsi     # 0x6ff24
leaq -0x258(%rbp), %rdi
callq 0xced0
jmp 0x2fec6
movq -0x378(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0xc600
jmp 0x2fedb
leaq -0x258(%rbp), %rdi
callq 0x8848
leaq -0x259(%rbp), %rdi
callq 0x8460
jmp 0x2ffc1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2ff2a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x8848
leaq -0x1f1(%rbp), %rdi
callq 0x8460
jmp 0x30260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2ff6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x8848
leaq -0x238(%rbp), %rdi
callq 0x8848
jmp 0x30260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x2ffb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x8848
leaq -0x259(%rbp), %rdi
callq 0x8460
jmp 0x30260
movq -0x10(%rbp), %rax
movq %rax, -0x388(%rbp)
leaq -0x281(%rbp), %rdi
movq %rdi, -0x380(%rbp)
callq 0x8760
movq -0x380(%rbp), %rdx
leaq 0x3f85b(%rip), %rsi     # 0x6f848
leaq -0x280(%rbp), %rdi
callq 0xced0
jmp 0x2fffb
movq -0x388(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0xc600
jmp 0x30010
leaq -0x280(%rbp), %rdi
callq 0x8848
leaq -0x281(%rbp), %rdi
callq 0x8460
jmp 0x3006d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x3005c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x8848
leaq -0x281(%rbp), %rdi
callq 0x8460
jmp 0x30260
jmp 0x3006f
movq -0x2e8(%rbp), %rdi
addq $0x98, %rdi
callq 0x356d0
testb $0x1, %al
jne 0x30088
jmp 0x3008d
jmp 0x30257
movq -0x2e8(%rbp), %rdi
addq $0x10, %rdi
addq $0x28, %rdi
callq 0x33e20
testb $0x1, %al
jne 0x300aa
jmp 0x301b5
movq $0x0, -0x290(%rbp)
movq -0x2e8(%rbp), %rdi
movq -0x290(%rbp), %rax
movq %rax, -0x390(%rbp)
addq $0x98, %rdi
callq 0x33db0
movq %rax, %rcx
movq -0x390(%rbp), %rax
cmpq %rcx, %rax
jae 0x301b0
movq -0x2e8(%rbp), %rdi
addq $0x98, %rdi
movq -0x290(%rbp), %rsi
callq 0x33d60
movq %rax, %rdi
callq 0x33ae0
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
movq %rcx, -0x3a8(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x3a0(%rbp)
movzwl 0xb0(%rax), %edx
movl -0x290(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal (%rax,%rcx,2), %esi
leaq -0x2b8(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x35710
movq -0x3a8(%rbp), %rdi
movq -0x3a0(%rbp), %rsi
movq -0x398(%rbp), %rdx
callq 0x22390
jmp 0x3016a
leaq -0x2b8(%rbp), %rdi
callq 0xe4c0
movq -0x290(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x290(%rbp)
jmp 0x300b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x2b8(%rbp), %rdi
callq 0xe4c0
jmp 0x30260
jmp 0x30257
movq -0x2e8(%rbp), %rdi
addq $0x98, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x33d60
movq %rax, %rdi
callq 0x33ae0
movq %rax, %rcx
movq -0x2e8(%rbp), %rax
movq %rcx, -0x3c0(%rbp)
movq -0x10(%rbp), %rcx
movq %rcx, -0x3b8(%rbp)
movq %rax, %rsi
addq $0x10, %rsi
movl 0x30(%rax), %edx
leaq -0x2e0(%rbp), %rdi
movq %rdi, -0x3b0(%rbp)
callq 0x35740
movq -0x3c0(%rbp), %rdi
movq -0x3b8(%rbp), %rsi
movq -0x3b0(%rbp), %rdx
callq 0x22390
jmp 0x30229
leaq -0x2e0(%rbp), %rdi
callq 0xe4c0
jmp 0x30257
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x2e0(%rbp), %rdi
callq 0xe4c0
jmp 0x30260
addq $0x3c0, %rsp            # imm = 0x3C0
popq %rbp
retq
movq -0x98(%rbp), %rdi
callq 0x8750
nopl (%rax)