// File: /workspace/github_cpp_makefile_star2_O2/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 0xb1a3
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4233(%rip), %r15      # 0xf27b
leaq 0xf8(%rsp), %r12
leaq 0xc8(%rsp), %rbp
testq %r14, %r14
je 0xb1a3
leaq 0x30(%r14), %r13
movq %r13, %rdi
movq %r15, %rsi
callq 0x368e
testb %al, %al
je 0xb092
movq %r12, %rdi
movq %rbx, %rsi
callq 0xd3ce
movq %r14, %rdi
movq %r12, %rsi
callq 0xa882
movq %r12, %rdi
jmp 0xb195
movq %r13, %rdi
leaq 0x420e(%rip), %rsi      # 0xf2aa
callq 0x368e
testb %al, %al
je 0xb0c5
movq %rbp, %rdi
movq %rbx, %rsi
callq 0xd3ce
movq %r14, %rdi
movq %rbp, %rsi
xorl %edx, %edx
callq 0xb205
movq %rbp, %rdi
jmp 0xb195
movq %r13, %rdi
leaq 0x416e(%rip), %rsi      # 0xf23d
callq 0x368e
testb %al, %al
je 0xb0fe
leaq 0x98(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd3ce
movq %r14, %rdi
movq %r13, %rsi
callq 0xb54e
movq %r13, %rdi
jmp 0xb195
movq %r13, %rdi
leaq 0x417a(%rip), %rsi      # 0xf282
callq 0x368e
testb %al, %al
je 0xb131
leaq 0x68(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd3ce
movq %r14, %rdi
movq %r13, %rsi
callq 0xb870
movq %r13, %rdi
jmp 0xb195
movq %r13, %rdi
leaq 0x411b(%rip), %rsi      # 0xf256
callq 0x368e
testb %al, %al
je 0xb164
leaq 0x38(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd3ce
movq %r14, %rdi
movq %r13, %rsi
callq 0xabcd
movq %r13, %rdi
jmp 0xb195
movq %r13, %rdi
leaq 0x40d9(%rip), %rsi      # 0xf247
callq 0x368e
testb %al, %al
je 0xb19a
leaq 0x8(%rsp), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0xd3ce
movq %r14, %rdi
movq %r13, %rsi
callq 0xb9bf
movq %r13, %rdi
callq 0x7b9c
movq 0x20(%r14), %r14
jmp 0xb058
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 0xb1f8
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
jmp 0xb1f8
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0xb1f8
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0xb1f8
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
jmp 0xb1f8
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x7b9c
movq %rbx, %rdi
callq 0x2300