// File: /workspace/github_cpp_makefile_star2_O2/rfotino[P]consolite-compiler/src/syntax.cpp
// Function: IfStatement::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 IfStatement::output(Parser *parser,
                         const std::shared_ptr<FunctionToken>& function,
                         const std::string& returnLabel,
                         const std::string& breakLabel,
                         const std::string& continueLabel) {
  std::string falseLabel = parser->getUnusedLabel(function->name() + "_if_false");
  std::string endLabel = parser->getUnusedLabel(function->name() + "_if_end");
  // Test the condition and jump to the false label if it is false.
  _condExpr.output(parser, VarLocation("L"));
  parser->writeInst("TST L L");
  parser->writeInst("JEQ " + falseLabel);
  // Output the true statement and jump to the end.
  _trueStatement->output(parser, function, returnLabel, breakLabel,
                         continueLabel);
  parser->writeInst("JMPI " + endLabel);
  // Output the false statement label and the false statement.
  parser->writeln(falseLabel + ":");
  if (nullptr != _falseStatement) {
    _falseStatement->output(parser, function, returnLabel, breakLabel,
                            continueLabel);
  }
  // Output the end label that the true statement uses to jump over the
  // false statement.
  parser->writeln(endLabel + ":");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %r9, %r15
movq %r8, %r12
movq %rcx, 0x30(%rsp)
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %rbp
movq (%rdx), %rsi
addq $0x58, %rsi
leaq 0x58(%rsp), %r14
movq %r14, %rdi
callq 0x73e0
leaq 0x12bf8(%rip), %rdx     # 0x29ece
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x9ad4
leaq 0x78(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x901a
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x58(%rsp), %rdi
callq 0x75c8
movq (%r13), %rsi
addq $0x58, %rsi
leaq 0x38(%rsp), %rdi
callq 0x73e0
movq %r15, %r14
leaq 0x12bb3(%rip), %rdx     # 0x29ed8
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x9ad4
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x901a
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x38(%rsp), %rdi
callq 0x75c8
leaq 0x12777(%rip), %rsi     # 0x29ad8
leaq 0x38(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x9502
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x73e0
leaq 0x10(%rbp), %rdi
leaq 0x8(%rsp), %rdx
movq %rbx, %rsi
callq 0x10ca6
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x38(%rsp), %rdi
callq 0x75c8
leaq 0x12b35(%rip), %rsi     # 0x29ee0
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x9502
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x914a
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x1245b(%rip), %rsi     # 0x29833
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rdx
callq 0x9980
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x914a
leaq 0x8(%rsp), %rdi
callq 0x75c8
movq 0x38(%rbp), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
movq %r13, %rdx
movq 0x30(%rsp), %rcx
movq %r12, %r8
movq %r14, %r9
callq *0x8(%rax)
leaq 0x11cf5(%rip), %rsi     # 0x29115
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0x9980
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x914a
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x141e3(%rip), %rdx     # 0x2b630
leaq 0x8(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x99f6
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x93f2
leaq 0x8(%rsp), %rdi
callq 0x75c8
movq 0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x17493
movq (%rdi), %rax
movq %rbx, %rsi
movq %r13, %rdx
movq 0x30(%rsp), %rcx
movq %r12, %r8
movq %r14, %r9
callq *0x8(%rax)
leaq 0x14196(%rip), %rdx     # 0x2b630
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x99f6
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x93f2
leaq 0x8(%rsp), %rdi
callq 0x75c8
leaq 0x58(%rsp), %rdi
callq 0x75c8
leaq 0x78(%rsp), %rdi
callq 0x75c8
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x174f6
jmp 0x17559
jmp 0x174f6
jmp 0x17559
jmp 0x174f6
jmp 0x17559
jmp 0x174f6
jmp 0x17559
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x17519
jmp 0x17559
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x75c8
jmp 0x17514
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x75c8
jmp 0x1755c
jmp 0x17559
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x75c8
jmp 0x17534
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x17561
movq %rax, %rbx
jmp 0x17566
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x75c8
jmp 0x17552
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x1756b
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x75c8
leaq 0x78(%rsp), %rdi
callq 0x75c8
movq %rbx, %rdi
callq 0x7510