// File: rfotino[P]consolite-compiler/src/syntax.cpp
// Function: DoWhileStatement::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 DoWhileStatement::output(Parser *parser,
                              const std::shared_ptr<FunctionToken>& function,
                              const std::string& returnLabel,
                              const std::string&,
                              const std::string&) {
  // Create the break and continue labels.
  std::string breakLabel =
    parser->getUnusedLabel(function->name() + "_do_while_break");
  std::string continueLabel =
    parser->getUnusedLabel(function->name() + "_do_while_continue");
  // Output the continue label.
  parser->writeln(continueLabel + ":");
  // Output the loop body.
  _body->output(parser, function, returnLabel, breakLabel, continueLabel);
  // Test the condition.
  _condExpr->output(parser, VarLocation("L"));
  parser->writeInst("TST L L");
  parser->writeInst("JNE " + continueLabel);
  // Output the break label.
  parser->writeln(breakLabel + ":");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
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), %rax
movq %rax, -0x1f0(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x1e8(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd780
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
movq %rdi, -0x1e0(%rbp)
callq 0xdbe0
movq -0x1e0(%rbp), %rsi
leaq 0x3e5e6(%rip), %rdx     # 0x6ff9c
leaq -0x70(%rbp), %rdi
callq 0xe020
jmp 0x319c1
movq -0x1e8(%rbp), %rsi
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0xc3c0
jmp 0x319d7
leaq -0x70(%rbp), %rdi
callq 0x8848
leaq -0x90(%rbp), %rdi
callq 0x8848
movq -0x10(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x18(%rbp), %rdi
callq 0xd780
movq %rax, %rsi
leaq -0x100(%rbp), %rdi
callq 0xdbe0
jmp 0x31a11
leaq 0x3e594(%rip), %rdx     # 0x6ffac
leaq -0xe0(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0xe020
jmp 0x31a2d
movq -0x1f8(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rdx
callq 0xc3c0
jmp 0x31a49
leaq -0xe0(%rbp), %rdi
callq 0x8848
leaq -0x100(%rbp), %rdi
callq 0x8848
movq -0x10(%rbp), %rax
movq %rax, -0x200(%rbp)
leaq 0x3fbd5(%rip), %rdx     # 0x71648
leaq -0x120(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0xdd40
jmp 0x31a88
movq -0x200(%rbp), %rdi
leaq -0x120(%rbp), %rsi
callq 0xcc30
jmp 0x31a9d
leaq -0x120(%rbp), %rdi
callq 0x8848
movq -0x1f0(%rbp), %rdi
addq $0x20, %rdi
callq 0x341f0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq (%rdi), %rax
movq 0x8(%rax), %rax
leaq -0x50(%rbp), %r8
leaq -0xc0(%rbp), %r9
callq *%rax
jmp 0x31ade
movq -0x1f0(%rbp), %rdi
addq $0x10, %rdi
callq 0x33ae0
movq %rax, -0x218(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x169(%rbp), %rdi
movq %rdi, -0x208(%rbp)
callq 0x8760
movq -0x208(%rbp), %rdx
leaq 0x3e047(%rip), %rsi     # 0x6fb68
leaq -0x168(%rbp), %rdi
callq 0xced0
jmp 0x31b2f
leaq -0x148(%rbp), %rdi
leaq -0x168(%rbp), %rsi
callq 0x33d80
jmp 0x31b44
movq -0x210(%rbp), %rsi
movq -0x218(%rbp), %rdi
leaq -0x148(%rbp), %rdx
callq 0x22390
jmp 0x31b60
leaq -0x148(%rbp), %rdi
callq 0xe4c0
leaq -0x168(%rbp), %rdi
callq 0x8848
leaq -0x169(%rbp), %rdi
callq 0x8460
movq -0x10(%rbp), %rax
movq %rax, -0x228(%rbp)
leaq -0x191(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x8760
movq -0x220(%rbp), %rdx
leaq 0x3e3c0(%rip), %rsi     # 0x6ff70
leaq -0x190(%rbp), %rdi
callq 0xced0
jmp 0x31bbe
movq -0x228(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0xc600
jmp 0x31bd3
leaq -0x190(%rbp), %rdi
callq 0x8848
leaq -0x191(%rbp), %rdi
callq 0x8460
movq -0x10(%rbp), %rax
movq %rax, -0x230(%rbp)
leaq 0x3dc03(%rip), %rsi     # 0x6f800
leaq -0x1b8(%rbp), %rdi
leaq -0xc0(%rbp), %rdx
callq 0xdc30
jmp 0x31c12
movq -0x230(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0xc600
jmp 0x31c27
leaq -0x1b8(%rbp), %rdi
callq 0x8848
movq -0x10(%rbp), %rax
movq %rax, -0x238(%rbp)
leaq 0x3fa03(%rip), %rdx     # 0x71648
leaq -0x1d8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xdd40
jmp 0x31c57
movq -0x238(%rbp), %rdi
leaq -0x1d8(%rbp), %rsi
callq 0xcc30
jmp 0x31c6c
leaq -0x1d8(%rbp), %rdi
callq 0x8848
leaq -0xc0(%rbp), %rdi
callq 0x8848
leaq -0x50(%rbp), %rdi
callq 0x8848
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31cc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8848
leaq -0x90(%rbp), %rdi
callq 0x8848
jmp 0x31e5d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31e54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31d1f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x8848
leaq -0x100(%rbp), %rdi
callq 0x8848
jmp 0x31e54
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x8848
jmp 0x31e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31dbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31db0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x148(%rbp), %rdi
callq 0xe4c0
leaq -0x168(%rbp), %rdi
callq 0x8848
leaq -0x169(%rbp), %rdi
callq 0x8460
jmp 0x31e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0x31dfc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x190(%rbp), %rdi
callq 0x8848
leaq -0x191(%rbp), %rdi
callq 0x8460
jmp 0x31e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x8848
jmp 0x31e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x8848
leaq -0xc0(%rbp), %rdi
callq 0x8848
leaq -0x50(%rbp), %rdi
callq 0x8848
movq -0x98(%rbp), %rdi
callq 0x8750
nopl (%rax)