// File: /workspace/github_cpp_makefile_star2_O1/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 0x1001e
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x53c5(%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 0xff73
movq %r13, %rdi
leaq 0x53c3(%rip), %rsi      # 0x152aa
callq 0x2090
testl %eax, %eax
je 0xff8e
movq %r13, %rdi
leaq 0x5337(%rip), %rsi      # 0x15235
callq 0x2090
testl %eax, %eax
je 0xffab
movq %r13, %rdi
leaq 0x536d(%rip), %rsi      # 0x15282
callq 0x2090
testl %eax, %eax
je 0xffce
movq %r13, %rdi
leaq 0x532a(%rip), %rsi      # 0x15256
callq 0x2090
testl %eax, %eax
je 0xffee
movq %r13, %rdi
leaq 0x5304(%rip), %rsi      # 0x15247
callq 0x2090
testl %eax, %eax
jne 0x10011
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e9a
movq %r14, %rdi
movq %r13, %rsi
callq 0x10fa0
movq %r13, %rdi
jmp 0x1000c
movq %r12, %rdi
movq %rbx, %rsi
callq 0x13e9a
movq %r14, %rdi
movq %r12, %rsi
callq 0xee96
movq %r12, %rdi
jmp 0x1000c
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x13e9a
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0x10080
movq %rbp, %rdi
jmp 0x1000c
leaq 0x98(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e9a
movq %r14, %rdi
movq %r13, %rsi
callq 0x106a6
movq %r13, %rdi
jmp 0x1000c
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e9a
movq %r14, %rdi
movq %r13, %rsi
callq 0x10d42
movq %r13, %rdi
jmp 0x1000c
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x13e9a
movq %r14, %rdi
movq %r13, %rsi
callq 0xf503
movq %r13, %rdi
callq 0xabe4
movq 0x20(%r14), %r14
testq %r14, %r14
jne 0xfec6
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 0x10073
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0x10073
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x10073
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x10073
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
jmp 0x10073
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0xabe4
movq %rbx, %rdi
callq 0x2310