// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x3500(%rip), %r14      # 0x5154
leaq 0x3439(%rip), %r15      # 0x5094
testq %rbx, %rbx
jne 0x1c68
movq %r14, %rdi
callq 0x1b85
movl (%rbx), %esi
cmpq $0x15, %rsi
ja 0x1d66
movslq (%r15,%rsi,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x20(%rbx), %rbx
jmp 0x1c5b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2627
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2941
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x25e0
movq %rbx, %rdi
callq 0x12b2
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4669
jmp 0x1d76
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2bc5
movq %rbx, %rdi
callq 0x2b22
jmp 0x1d76
movq %rbx, %rdi
callq 0x279f
jmp 0x1d76
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1de1
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2580
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2a56
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1d92
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x29d0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x25c0
leaq 0x3400(%rip), %rdi      # 0x516d
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10a0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq