// File: /workspace/github_cpp_makefile_star2_O3/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 0x5235
movq (%r12), %rdi
leaq 0x98(%rsp), %rax
cmpq %rax, %rdi
je 0x6c80
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x48(%rsp), %rdi
callq 0x4014
leaq 0x28(%rsp), %rdi
callq 0x4014
leaq 0xc5d5(%rip), %rdi      # 0x13270
leaq 0x6720(%rip), %rsi      # 0xd3c2
movl $0x5, %edx
callq 0x3260
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xc5b3(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x6857(%rip), %rsi      # 0xd520
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xc589(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x66d5(%rip), %rsi      # 0xd3c8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3260
movq %r15, %rdi
callq 0x47a9
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x5235
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6d30
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x3200
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0xc52f(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x667b(%rip), %rsi      # 0xd3c8
movl $0x2, %edx
movq %rax, %rdi
callq 0x3260
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x5235
leaq 0xc502(%rip), %rdi      # 0x13270
leaq 0x661e(%rip), %rsi      # 0xd393
movl $0x7, %edx
callq 0x3260
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0xc4e0(%rip), %rdi      # 0x13270
callq 0x3260
movq %rax, %rbx
leaq 0x6634(%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 0x675b(%rip), %rsi      # 0xd520
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
leaq 0xc497(%rip), %rdi      # 0x13270
leaq 0x65d2(%rip), %rsi      # 0xd3b2
movl $0x4, %edx
callq 0x3260
movq 0x48(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0xc475(%rip), %rdi      # 0x13270
callq 0x3260
leaq 0x6719(%rip), %rsi      # 0xd520
movl $0x1, %edx
movq %rax, %rdi
callq 0x3260
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e2f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e4a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e65
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
jmp 0x6e9b
movq %rax, %rbx
jmp 0x6eb9
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e9e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x3200
jmp 0x6e9e
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6eb9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x3200
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6ed4
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x3200
movq %rbx, %rdi
callq 0x33d0