// File: /workspace/github_c_makefile_star2_O0/sebbekarlsson[P]cola/src/interpret.c
// Function: interpret_visit
ast_node* interpret_visit(ast_node* node) {
    if (!node)
        error_in_interpreter("Encountered a NULL node\n");
    
    switch (node->type) {
        case AST_TYPE_RETURN:
            return interpret_visit_return((ast_node_return*)node);
            break;
        case AST_TYPE_COMPOUND:
            return interpret_visit_compound((ast_node_compound*)node);
            break;
        case AST_TYPE_BINOP:
            return interpret_visit_binop((ast_node_binop*)node);
            break;
        case AST_TYPE_EMPTY:
            return interpret_visit_empty((ast_node_empty*)node);
            break;
        case AST_TYPE_CHAR:
            return interpret_visit_char((ast_node_char*)node);
            break;
        case AST_TYPE_IF:
            return interpret_visit_if((ast_node_if*)node);
            break;
        case AST_TYPE_ELSE:
            return interpret_visit_else((ast_node_else*)node);
            break;
        case AST_TYPE_WHILE:
            return interpret_visit_while((ast_node_while*)node);
            break;
        case AST_TYPE_FOREACH:
            return interpret_visit_foreach((ast_node_foreach*)node);
            break;
        case AST_TYPE_INTEGER:
            return interpret_visit_integer((ast_node_integer*)node);
            break;
        case AST_TYPE_FLOAT:
            return interpret_visit_float((ast_node_float*)node);
            break;
        case AST_TYPE_STRING:
            return interpret_visit_string((ast_node_string*)node);
            break;
        case AST_TYPE_COMPONENT:
            return interpret_visit_component((ast_node_component*)node);
            break;
        case AST_TYPE_VECPTR:
            return interpret_visit_vecptr((ast_node_vecptr*)node);
            break;
        case AST_TYPE_VECTOR:
            return interpret_visit_vector((ast_node_vector*)node);
            break;
        case AST_TYPE_VARIABLE:
            return interpret_visit_variable((ast_node_variable*)node);
            break;
        case AST_TYPE_FUNCTION_CALL:
            return interpret_visit_function_call((ast_node_function_call*)node);
            break;
        case AST_TYPE_VARIABLE_DEFINITION:
            return interpret_visit_variable_definition((ast_node_variable_definition*)node);
            break;
        case AST_TYPE_FUNCTION_DEFINITION:
            return interpret_visit_function_definition((ast_node_function_definition*)node);
            break;
        case AST_TYPE_INTERPRETER_INSTR:
            return interpret_visit_interpreter_instr((ast_node_interpreter_instr*)node);
            break;
        default:
            printf("Unhandled AST node (%d)\n", node->type);
            return (void*)0;
            break;
    }

    return node;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x212f
leaq 0x4fb2(%rip), %rdi      # 0x70dc
callq 0x2040
movq -0x10(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x18(%rbp)
subq $0x15, %rax
ja 0x22aa
movq -0x18(%rbp), %rax
leaq 0x4f36(%rip), %rcx      # 0x7084
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x22d0
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x22f0
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x2370
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x2ec0
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x2ed0
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x2ee0
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x2f60
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x2fb0
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3050
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3210
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3220
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3230
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3240
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3480
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3580
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3590
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3640
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3770
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3840
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rdi
callq 0x3870
movq %rax, -0x8(%rbp)
jmp 0x22c6
movq -0x10(%rbp), %rax
movl (%rax), %esi
leaq 0x4e3e(%rip), %rdi      # 0x70f5
movb $0x0, %al
callq 0x1080
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq