// File: /workspace/github_cpp_makefile_star2_O3/JameyWoo[P]csmile/assembly.cpp
// Function: genStmt(TreeNode*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<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>>>>>)
void genStmt(TreeNode* stmts, map<string, string> var2stack) {
    if (stmts == NULL) return;
    TreeNode* stmt = stmts;
    while (stmt != NULL) {
        // debug(stmt->nodekind);

        if (stmt->nodekind == "Output") {
            genOutput(stmt, var2stack);
        } else if (stmt->nodekind == "Assign") {
            genAssign(stmt, var2stack, false);
        } else if (stmt->nodekind == "Selection") {
            genIfElse(stmt, var2stack);
        } else if (stmt->nodekind == "ReturnStmt") {
            genReturn(stmt, var2stack);
        } else if (stmt->nodekind == "Call") {
            genCall(stmt, var2stack);
        } else if (stmt->nodekind == "Iteration") {
            genWhile(stmt, var2stack);
        }

        stmt = stmt->sibling;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
testq %rdi, %rdi
je 0xff8e
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x5455(%rip), %r15      # 0x1527b
leaq 0xf8(%rsp), %r12
leaq 0xc8(%rsp), %rbp
leaq 0x30(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x2090
testl %eax, %eax
je 0xfee3
movq %r13, %rdi
leaq 0x5453(%rip), %rsi      # 0x152aa
callq 0x2090
testl %eax, %eax
je 0xfefe
movq %r13, %rdi
leaq 0x53c7(%rip), %rsi      # 0x15235
callq 0x2090
testl %eax, %eax
je 0xff1b
movq %r13, %rdi
leaq 0x53fd(%rip), %rsi      # 0x15282
callq 0x2090
testl %eax, %eax
je 0xff3e
movq %r13, %rdi
leaq 0x53ba(%rip), %rsi      # 0x15256
callq 0x2090
testl %eax, %eax
je 0xff5e
movq %r13, %rdi
leaq 0x5394(%rip), %rsi      # 0x15247
callq 0x2090
testl %eax, %eax
jne 0xff81
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e16
movq %r14, %rdi
movq %r13, %rsi
callq 0x10f10
movq %r13, %rdi
jmp 0xff7c
movq %r12, %rdi
movq %rbx, %rsi
callq 0x13e16
movq %r14, %rdi
movq %r12, %rsi
callq 0xee06
movq %r12, %rdi
jmp 0xff7c
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x13e16
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xfff0
movq %rbp, %rdi
jmp 0xff7c
leaq 0x98(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e16
movq %r14, %rdi
movq %r13, %rsi
callq 0x10616
movq %r13, %rdi
jmp 0xff7c
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e16
movq %r14, %rdi
movq %r13, %rsi
callq 0x10cb2
movq %r13, %rdi
jmp 0xff7c
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e16
movq %r14, %rdi
movq %r13, %rsi
callq 0xf473
movq %r13, %rdi
callq 0xab5a
movq 0x20(%r14), %r14
testq %r14, %r14
jne 0xfe36
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0xffe3
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0xffe3
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xffe3
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0xffe3
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
jmp 0xffe3
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xab5a
movq %rbx, %rdi
callq 0x2310