// File: /workspace/github_cpp_makefile_star2_O1/SunriseFox[P]very-simple-c-compiler/./src/asm.cpp
// Function: handleFor(StatementNode*)
void handleFor(StatementNode* node) {
    TreeNode* st1 = node->child;
    TreeNode* st2 = st1->sibling;
    TreeNode* st3 = st2->sibling;
    TreeNode* st4 = st3->sibling;

    handleExprNode(st1);
    string LFor = getNextLabel();
    string LCondition = getNextLabel();
    of << "\tjmp\t" << LCondition << "\n";

    of << LFor << ":\n";
    handleCodeBlock(st4);
    handleExprNode(st3);

    of << LCondition << ":\n";
    string reg = handleExprNode(st2);
    of << "\ttestl\t" << reg << ", " << reg << "\n";
    of << "\tje\t" << LFor << "\n";
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq 0x18(%rdi), %rsi
movq 0x20(%rsi), %rbx
movq 0x20(%rbx), %r14
movq 0x20(%r14), %r15
leaq 0x88(%rsp), %r12
movq %r12, %rdi
callq 0x5226
movq (%r12), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x6c91
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x48(%rsp), %rdi
callq 0x4045
leaq 0x28(%rsp), %rdi
callq 0x4045
leaq 0xc5c4(%rip), %rdi      # 0x13270
leaq 0x670f(%rip), %rsi      # 0xd3c2
movl $0x5, %edx
callq 0x3260
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xc5a2(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x6846(%rip), %rsi      # 0xd520
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xc578(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x66c4(%rip), %rsi      # 0xd3c8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3260
movq %r15, %rdi
callq 0x47e9
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x5226
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d41
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xc51e(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x666a(%rip), %rsi      # 0xd3c8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3260
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5226
leaq 0xc4f1(%rip), %rdi      # 0x13270
leaq 0x660d(%rip), %rsi      # 0xd393
movl $0x7, %edx
callq 0x3260
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xc4cf(%rip), %rdi      # 0x13270
callq 0x3260
movq %rax, %rbx
leaq 0x6623(%rip), %rsi      # 0xd3d3
movl $0x2, %edx
movq %rax, %rdi
callq 0x3260
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq %rbx, %rdi
callq 0x3260
leaq 0x674a(%rip), %rsi      # 0xd520
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
leaq 0xc486(%rip), %rdi      # 0x13270
leaq 0x65c1(%rip), %rsi      # 0xd3b2
movl $0x4, %edx
callq 0x3260
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xc464(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x6708(%rip), %rsi      # 0xd520
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e40
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e5b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e76
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x6eac
movq %rax, %rbx
jmp 0x6eca
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6eaf
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x6eaf
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6eca
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ee5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x33d0