// File: /workspace/github_cpp_makefile_star2_O3/philpoore[P]Math/./src/Interp.cpp
// Function: Interp::execStmt(AstStmt*)
void Interp::execStmt(AstStmt* stmt) {
    if (stmt->expr->type == AST_TYPE_ASSIGN) {
        AstAssign* assign = (AstAssign*)stmt->expr;
        double value = eval(assign->expr);
        string name = assign->name;
#ifdef DEBUG
        cerr << "--> setting variable: " + name + " to " + to_string(value)
             << endl;
#endif
        variables[name] = value;
    } else if (stmt->expr->type == AST_TYPE_BLOCK) {
        AstBlock* block = (AstBlock*)stmt->expr;
        for (auto stmt : block->stmts) {
            execStmt(stmt);
        }
    } else if (stmt->expr->type == AST_TYPE_IF) {
        AstIf* ast = (AstIf*)stmt->expr;
        double a = eval(ast->expr);
        if (a) {
            if (ast->if_branch) {
                for (auto stmt : ast->if_branch->stmts) {
                    execStmt(stmt);
                }
            }
        } else {
            if (ast->else_branch) {
                for (auto stmt : ast->else_branch->stmts) {
                    execStmt(stmt);
                }
            }
        }
    } else {
        double value = eval(stmt->expr);
        cout << setprecision(16) << value << endl;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rdi, %rbx
movq 0x8(%rsi), %r14
movl (%r14), %eax
cmpl $0x9, %eax
je 0x761e
cmpl $0x8, %eax
je 0x75fc
cmpl $0x1, %eax
jne 0x7669
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x718e
movsd %xmm0, -0x48(%rbp)
leaq -0x98(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
addq %rsi, %rdx
leaq -0xa8(%rbp), %r14
movq %r14, %rdi
callq 0xb26a
leaq 0x5d7a(%rip), %rsi      # 0xd328
leaq -0xc8(%rbp), %rdi
movq %r14, %rdx
callq 0xaa41
leaq 0x5d7b(%rip), %rsi      # 0xd33f
leaq -0xc8(%rbp), %rdi
callq 0x33a0
leaq -0x58(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x76f8
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x7700
movq 0x8(%r14), %r15
movq 0x10(%r14), %r14
cmpq %r14, %r15
je 0x78b3
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x753a
addq $0x8, %r15
jmp 0x7604
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x718e
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x763a
jnp 0x76c9
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x78b3
movq 0x8(%rax), %r14
movq 0x10(%rax), %r15
cmpq %r15, %r14
je 0x78b3
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x753a
addq $0x8, %r14
jmp 0x764f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x718e
movq 0xa8f5(%rip), %rdi      # 0x11f70
movq (%rdi), %rax
movq -0x18(%rax), %rax
movq $0x10, 0x8(%rdi,%rax)
callq 0x3320
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %rbx, %rdi
callq 0x3030
movq %rax, %rdi
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3180
movq 0x18(%r14), %rax
testq %rax, %rax
je 0x78b3
movq 0x8(%rax), %r14
movq 0x10(%rax), %r15
cmpq %r15, %r14
je 0x78b3
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x753a
addq $0x8, %r14
jmp 0x76de
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x60(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xa81a(%rip), %rsi      # 0x11f38
leaq 0x5da2(%rip), %rcx      # 0xd4c7
leaq -0x88(%rbp), %rdi
movl $0x148, %edx            # imm = 0x148
movsd -0x48(%rbp), %xmm0
movb $0x1, %al
callq 0xb1b9
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x80(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r12, %rcx
je 0x775b
movq -0x58(%rbp), %rdi
movq -0x88(%rbp), %rsi
cmpq %rdi, %rax
jbe 0x777e
leaq -0x78(%rbp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x7779
movq -0x78(%rbp), %rdi
cmpq %rdi, %rax
jbe 0x7789
leaq -0x68(%rbp), %rdi
callq 0x30d0
jmp 0x7799
leaq -0x88(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3260
leaq -0x30(%rbp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x77ba
movq %rsi, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x77c0
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0xa805(%rip), %rdi      # 0x11ff0
callq 0x3270
movq %rax, %r14
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq %r14, %rdi
callq 0x3030
movq %rax, %rdi
callq 0x3180
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7833
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x784c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x7861
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7880
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0xadf8
movsd -0x48(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x78b3
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3240
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x78d4
movq %rax, %rbx
jmp 0x78f5
movq %rax, %rbx
jmp 0x790e
movq %rax, %rbx
jmp 0x7923
movq %rax, %rbx
jmp 0x7942
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x78f5
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x790e
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x7923
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7942
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x795d
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3370
nop