// File: /workspace/github_cpp_makefile_star2_O1/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: ForStatement::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 ForStatement::output(Parser *parser,
                          const std::shared_ptr<FunctionToken>& function,
                          const std::string& returnLabel,
                          const std::string&,
                          const std::string&) {
  // Evaluate the initial expressions and discard the result.
  for (auto expr : _initExprs) {
    expr->output(parser, VarLocation("L"));
  }
  // Create the start, break, and continue labels.
  std::string startLabel =
    parser->getUnusedLabel(function->name() + "_for_start");
  std::string breakLabel =
    parser->getUnusedLabel(function->name() + "_for_break");
  std::string continueLabel =
    parser->getUnusedLabel(function->name() + "_for_continue");
  // Output the start label and test the condition.
  parser->writeln(startLabel + ":");
  _condExpr->output(parser, VarLocation("L"));
  parser->writeInst("TST L L");
  parser->writeInst("JEQ " + breakLabel);
  // Output the function body followed by the continue label.
  _body->output(parser, function, returnLabel, breakLabel, continueLabel);
  parser->writeln(continueLabel + ":");
  // Output the loop expressions and jump to the start of the loop.
  for (auto expr : _loopExprs) {
    expr->output(parser, VarLocation("L"));
  }
  parser->writeInst("JMPI " + startLabel);
  // Output the break label.
  parser->writeln(breakLabel + ":");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rcx, 0xb0(%rsp)
movq %rdx, 0xc0(%rsp)
movq %rsi, 0x28(%rsp)
movq 0x30(%rdi), %r15
movq %rdi, 0xb8(%rsp)
movq 0x38(%rdi), %r12
cmpq %r12, %r15
je 0x2099f
leaq 0x10(%rsp), %rbp
movq %rsp, %r14
movq (%r15), %rbx
movq 0x8(%r15), %r13
testq %r13, %r13
je 0x20908
movq 0x276a0(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x20903
incl 0x8(%r13)
jmp 0x20908
lock
incl 0x8(%r13)
leaq 0x60(%rsp), %rax
movq %rax, 0x50(%rsp)
leaq 0x50(%rsp), %rdi
leaq 0x161ba(%rip), %rsi     # 0x36ad8
leaq 0x161b4(%rip), %rdx     # 0x36ad9
callq 0xc0a4
movq %rbp, (%rsp)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0xc014
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
callq 0x1592e
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x20969
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x20985
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
testq %r13, %r13
je 0x20992
movq %r13, %rdi
callq 0x81ea
addq $0x10, %r15
cmpq %r12, %r15
jne 0x208e5
movq 0xc0(%rsp), %r12
movq (%r12), %rax
leaq 0xa0(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
callq 0xc014
leaq 0x1650f(%rip), %rsi     # 0x36ee8
movq %rbx, %rdi
callq 0x7560
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20a07
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x20a0e
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
movq %rsp, %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x50(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xa992
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20a4d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x20a6a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x72c0
movq (%r12), %rax
leaq 0x80(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
leaq 0x70(%rsp), %rdi
callq 0xc014
movq 0xb8(%rsp), %r14
leaq 0x16455(%rip), %rsi     # 0x36ef3
leaq 0x70(%rsp), %rdi
callq 0x7560
movq %r15, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20ac9
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x20ad0
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
movq %rsp, %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x90(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xa992
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20b12
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x70(%rsp), %rdi
cmpq %rbx, %rdi
je 0x20b2c
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x72c0
movq (%r12), %rax
leaq 0x40(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq 0x58(%rax), %rsi
movq 0x60(%rax), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %rdi
callq 0xc014
leaq 0x163a9(%rip), %rsi     # 0x36efe
leaq 0x30(%rsp), %rdi
callq 0x7560
movq %r15, (%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x20b80
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x20b87
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rsi
movq %rsp, %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x70(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0xa992
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20bc6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20be2
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rsp, %rdi
movq %r15, (%rdi)
movq 0x50(%rsp), %rsi
movq 0x58(%rsp), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x179f7(%rip), %rsi     # 0x385f8
movq %rsp, %rdi
callq 0x7560
movq %rsp, %rsi
movq 0x28(%rsp), %rdi
callq 0xb2c4
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20c2c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x10(%r14), %rbx
leaq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
movq %rax, (%rdi)
leaq 0x15e94(%rip), %rsi     # 0x36ad8
leaq 0x15e8e(%rip), %rdx     # 0x36ad9
callq 0xc0a4
movq %rsp, %rdi
movq %r15, (%rdi)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
callq 0xc014
movq %rsp, %rdx
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
callq 0x1592e
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20c8e
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20caa
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rsp, %rdi
movq %r15, (%rdi)
leaq 0x16229(%rip), %rsi     # 0x36ee0
leaq 0x16229(%rip), %rdx     # 0x36ee7
callq 0xc0a4
movq %rsp, %rsi
movq 0x28(%rsp), %rdi
callq 0xadb2
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20ce6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x15b46(%rip), %rsi     # 0x36833
movq %rsp, %rdi
leaq 0x90(%rsp), %rdx
callq 0xb963
movq %rsp, %rsi
movq 0x28(%rsp), %rdi
callq 0xadb2
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20d20
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x20(%r14), %rdi
movq (%rdi), %rax
leaq 0x90(%rsp), %r8
leaq 0x70(%rsp), %r9
movq 0x28(%rsp), %rsi
movq %r12, %rdx
movq 0xb0(%rsp), %rcx
callq *0x8(%rax)
movq %rsp, %rdi
movq %r15, (%rdi)
movq 0x70(%rsp), %rsi
movq 0x78(%rsp), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x17892(%rip), %rsi     # 0x385f8
movq %rsp, %rdi
callq 0x7560
movq %rsp, %rsi
movq 0x28(%rsp), %rdi
callq 0xb2c4
movq (%rsp), %rdi
movq %r15, %r13
cmpq %r15, %rdi
je 0x20d94
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x48(%r14), %r15
movq 0x50(%r14), %r12
cmpq %r12, %r15
je 0x20e62
movq %rsp, %rbp
movq (%r15), %rbx
movq 0x8(%r15), %r14
testq %r14, %r14
je 0x20dcb
movq 0x271dd(%rip), %rax     # 0x47f98
cmpb $0x0, (%rax)
je 0x20dc6
incl 0x8(%r14)
jmp 0x20dcb
lock
incl 0x8(%r14)
leaq 0x40(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x30(%rsp), %rdi
leaq 0x15cf7(%rip), %rsi     # 0x36ad8
leaq 0x15cf1(%rip), %rdx     # 0x36ad9
callq 0xc0a4
movq %r13, (%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %rbp, %rdi
callq 0xc014
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
movq %rbp, %rdx
callq 0x1592e
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x20e2c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x20e48
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
testq %r14, %r14
je 0x20e55
movq %r14, %rdi
callq 0x81ea
addq $0x10, %r15
cmpq %r12, %r15
jne 0x20da8
leaq 0x152bc(%rip), %rsi     # 0x36125
movq %rsp, %rdi
leaq 0x50(%rsp), %rdx
callq 0xb963
movq %rsp, %rsi
movq 0x28(%rsp), %rdi
leaq 0xa0(%rsp), %rbx
leaq 0x80(%rsp), %r14
callq 0xadb2
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x20ea9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq %rsp, %rdi
movq %r13, (%rdi)
movq 0x90(%rsp), %rsi
movq 0x98(%rsp), %rdx
addq %rsi, %rdx
callq 0xc014
leaq 0x1772a(%rip), %rsi     # 0x385f8
movq %rsp, %rdi
callq 0x7560
movq %rsp, %rsi
movq 0x28(%rsp), %rdi
callq 0xb2c4
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x20ef9
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x20f13
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x90(%rsp), %rdi
cmpq %rbx, %rdi
je 0x20f30
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20f4b
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x20f66
jmp 0x20f66
jmp 0x20fe7
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
jne 0x20fd5
jmp 0x21101
jmp 0x20fe7
jmp 0x20fc5
jmp 0x20fc5
jmp 0x20fe7
jmp 0x20fe7
jmp 0x20fc5
jmp 0x20fe7
jmp 0x20fc5
jmp 0x20fe7
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x20fa7
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x20fa7
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x21101
movq 0x40(%rsp), %rsi
jmp 0x20fda
jmp 0x20fe7
jmp 0x20fc5
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x21101
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x21101
movq %rax, %rbx
jmp 0x21101
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x2100d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x2100d
movq %rax, %rbx
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x21123
movq 0x40(%rsp), %rsi
jmp 0x2111b
movq %rax, %rbx
jmp 0x21123
movq %rbx, %r14
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x21056
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x21056
movq %rbx, %r14
movq %rax, %rbx
movq 0x70(%rsp), %rdi
cmpq %r14, %rdi
je 0x21148
movq 0x80(%rsp), %rsi
jmp 0x21140
movq %rax, %rbx
jmp 0x21148
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x21097
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x21097
movq %rax, %rbx
movq 0x90(%rsp), %rdi
cmpq %r14, %rdi
je 0x211b1
movq 0xa0(%rsp), %rsi
jmp 0x2115b
movq %rax, %rbx
jmp 0x210f4
movq %rax, %rbx
jmp 0x210d8
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r13, %rdi
je 0x210d8
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x210f4
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x72c0
testq %r14, %r14
je 0x21101
movq %r14, %rdi
callq 0x81ea
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x21123
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x21148
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x72c0
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x211b1
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
jmp 0x211b1
movq %rax, %rbx
jmp 0x211a4
movq %rax, %rbx
jmp 0x21188
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %rbp, %rdi
je 0x21188
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x72c0
movq 0x50(%rsp), %rdi
leaq 0x60(%rsp), %rax
cmpq %rax, %rdi
je 0x211a4
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x72c0
testq %r13, %r13
je 0x211b1
movq %r13, %rdi
callq 0x81ea
movq %rbx, %rdi
callq 0x74f0
nop