// File: /workspace/github_cpp_makefile_star2_O1/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 0x76be
cmpl $0x8, %eax
je 0x769c
cmpl $0x1, %eax
jne 0x7709
movq 0x28(%r14), %rsi
movq %rbx, %rdi
callq 0x722e
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 0xb374
leaq 0x5cda(%rip), %rsi      # 0xd328
leaq -0xc8(%rbp), %rdi
movq %r14, %rdx
callq 0xab49
leaq 0x5cdb(%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 0x7798
movq %rdx, -0x68(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x58(%rbp)
jmp 0x77a0
movq 0x8(%r14), %r15
movq 0x10(%r14), %r14
cmpq %r14, %r15
je 0x7954
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x75da
addq $0x8, %r15
jmp 0x76a4
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x722e
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x76da
jnp 0x7769
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x7954
movq 0x8(%rax), %r14
movq 0x10(%rax), %r15
cmpq %r15, %r14
je 0x7954
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x75da
addq $0x8, %r14
jmp 0x76ef
movq %rbx, %rdi
movq %r14, %rsi
callq 0x722e
movq 0xa855(%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 0x7954
movq 0x8(%rax), %r14
movq 0x10(%rax), %r15
cmpq %r15, %r14
je 0x7954
movq (%r14), %rsi
movq %rbx, %rdi
callq 0x75da
addq $0x8, %r14
jmp 0x777e
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 0xa77a(%rip), %rsi      # 0x11f38
leaq 0x5d02(%rip), %rcx      # 0xd4c7
leaq -0x88(%rbp), %rdi
movl $0x148, %edx            # imm = 0x148
movsd -0x48(%rbp), %xmm0
movb $0x1, %al
callq 0xb2c3
movq -0x68(%rbp), %rcx
movq -0x60(%rbp), %r8
movq -0x80(%rbp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r12, %rcx
je 0x77fb
movq -0x58(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x7818
leaq -0x78(%rbp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x7813
movq -0x78(%rbp), %rsi
cmpq %rsi, %rax
jbe 0x782a
movq -0x88(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x30d0
jmp 0x783a
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 0x785b
movq %rsi, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x7861
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 0xa764(%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 0x78d4
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x78ed
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x7902
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7921
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0xa8(%rbp), %rsi
movq %rbx, %rdi
callq 0xaf00
movsd -0x48(%rbp), %xmm0
movsd %xmm0, (%rax)
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x7954
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3240
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7975
movq %rax, %rbx
jmp 0x7996
movq %rax, %rbx
jmp 0x79af
movq %rax, %rbx
jmp 0x79c4
movq %rax, %rbx
jmp 0x79e3
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7996
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x78(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x79af
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x68(%rbp), %rdi
cmpq %r12, %rdi
je 0x79c4
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x79e3
movq -0xb8(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x79fe
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3370