// File: /workspace/github_cpp_makefile_star2_O2/cphinton42[P]hinton-language/src/main.cpp
// Function: check_for_untyped(AST*)
void check_for_untyped(AST *ast)
{
    if(ast)
    {
        switch(ast->type)
        {
            case AST_Type::decl_ast: {
                Decl_AST *decl_ast = static_cast<Decl_AST*>(ast);
                check_for_untyped(&decl_ast->ident);
                check_for_untyped(decl_ast->decl_type);
                check_for_untyped(decl_ast->expr);
            } break;
            case AST_Type::block_ast: {
                Block_AST *block_ast = static_cast<Block_AST*>(ast);
                for(u64 i = 0; i < block_ast->statements.count; ++i)
                {
                    check_for_untyped(block_ast->statements[i]);
                }
            } break;
            case AST_Type::while_ast: {
                While_AST *while_ast = static_cast<While_AST*>(ast);
                check_for_untyped(while_ast->guard);
                check_for_untyped(while_ast->body);
            } break;
            case AST_Type::for_ast: {
                For_AST *for_ast = static_cast<For_AST*>(ast);
                check_for_untyped(for_ast->induction_var);
                if(for_ast->flags & FOR_FLAG_OVER_ARRAY)
                {
                    check_for_untyped(for_ast->index_var);
                    check_for_untyped(for_ast->array_expr);
                }
                else
                {
                    check_for_untyped(for_ast->low_expr);
                    check_for_untyped(for_ast->high_expr);
                }
                check_for_untyped(for_ast->body);
            } break;
            case AST_Type::if_ast: {
                If_AST *if_ast = static_cast<If_AST*>(ast);
                check_for_untyped(if_ast->guard);
                check_for_untyped(if_ast->then_block);
                check_for_untyped(if_ast->else_block);
            } break;
            case AST_Type::assign_ast: {
                Assign_AST *assign_ast = static_cast<Assign_AST*>(ast);
                check_for_untyped(assign_ast->lhs);
                check_for_untyped(assign_ast->rhs);
            } break;
            case AST_Type::return_ast: {
                Return_AST *return_ast = static_cast<Return_AST*>(ast);
                check_for_untyped(return_ast->expr);
            } break;
            case AST_Type::ident_ast: {
                Ident_AST *ident_ast = static_cast<Ident_AST*>(ast);
                report_if_expr_untyped(ident_ast);
            } break;
            case AST_Type::function_type_ast: {
                Function_Type_AST *function_type_ast = static_cast<Function_Type_AST*>(ast);
                report_if_expr_untyped(function_type_ast);
                for(u64 i = 0; i < function_type_ast->parameter_types.count; ++i)
                {
                    check_for_untyped(function_type_ast->parameter_types[i]);
                }
                for(u64 i = 0; i < function_type_ast->return_types.count; ++i)
                {
                    check_for_untyped(function_type_ast->return_types[i]);
                }
            } break;
            case AST_Type::function_ast: {
                Function_AST *function_ast = static_cast<Function_AST*>(ast);
                report_if_expr_untyped(function_ast);
                check_for_untyped(function_ast->prototype);
                for(u64 i = 0; i < function_ast->param_names.count; ++i)
                {
                    check_for_untyped(function_ast->param_names[i]);
                    check_for_untyped(function_ast->default_values[i]);
                }
                check_for_untyped(function_ast->block);
            } break;
            case AST_Type::function_call_ast: {
                Function_Call_AST *function_call_ast = static_cast<Function_Call_AST*>(ast);
                report_if_expr_untyped(function_call_ast);
                check_for_untyped(function_call_ast->function);
                for(u64 i = 0; i < function_call_ast->args.count; ++i)
                {
                    check_for_untyped(function_call_ast->args[i]);
                }
            } break;
            case AST_Type::access_ast: {
                Access_AST *access_ast = static_cast<Access_AST*>(ast);
                report_if_expr_untyped(access_ast);
                check_for_untyped(access_ast->lhs);
            } break;
            case AST_Type::binary_operator_ast: {
                Binary_Operator_AST *binop_ast = static_cast<Binary_Operator_AST*>(ast);
                report_if_expr_untyped(binop_ast);
                check_for_untyped(binop_ast->lhs);
                check_for_untyped(binop_ast->rhs);
            } break;
            case AST_Type::number_ast: {
                Number_AST *number_ast = static_cast<Number_AST*>(ast);
                report_if_expr_untyped(number_ast);
            } break;
            case AST_Type::enum_ast: {
                Enum_AST *enum_ast = static_cast<Enum_AST*>(ast);
                report_if_expr_untyped(enum_ast);
                for(u64 i = 0; i < enum_ast->values.count; ++i)
                {
                    check_for_untyped(enum_ast->values[i]);
                }
            } break;
            case AST_Type::struct_ast: {
                Struct_AST *struct_ast = static_cast<Struct_AST*>(ast);
                report_if_expr_untyped(struct_ast);
                for(u64 i = 0; i < struct_ast->constants.count; ++i)
                {
                    check_for_untyped(struct_ast->constants[i]);
                }
                for(u64 i = 0; i < struct_ast->fields.count; ++i)
                {
                    check_for_untyped(struct_ast->fields[i]);
                }
            } break;
            case AST_Type::unary_ast: {
                Unary_Operator_AST *unop_ast = static_cast<Unary_Operator_AST*>(ast);
                report_if_expr_untyped(unop_ast);
                check_for_untyped(unop_ast->operand);
            } break;
            case AST_Type::primitive_ast: {
                Primitive_AST *prim_ast = static_cast<Primitive_AST*>(ast);
                report_if_expr_untyped(prim_ast);
            } break;
            case AST_Type::string_ast: {
                String_AST *string_ast = static_cast<String_AST*>(ast);
                report_if_expr_untyped(string_ast);
            } break;
            case AST_Type::bool_ast: {
                Bool_AST *bool_ast = static_cast<Bool_AST*>(ast);
                report_if_expr_untyped(bool_ast);
            } break;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x18
popq %r14
leaq 0x6d29(%rip), %r15      # 0xe408
pushq $0x28
popq %r13
pushq $0x20
popq %rbp
testq %rbx, %rbx
je 0x78d4
movzwl (%rbx), %eax
cmpq $0x13, %rax
ja 0x78d4
movslq (%r15,%rax,4), %rcx
addq %r15, %rcx
movq %r14, %rax
jmpq *%rcx
leaq 0x10(%rbx), %rdi
callq 0x76c6
movq 0x50(%rbx), %rdi
callq 0x76c6
pushq $0x58
jmp 0x77ca
movq %rbx, %rdi
callq 0x76af
jmp 0x7791
movq %rbx, %rdi
callq 0x76af
movq 0x20(%rbx), %rdi
callq 0x76c6
xorl %r12d, %r12d
cmpq 0x28(%rbx), %r12
jae 0x7764
movq 0x30(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x76c6
movq 0x40(%rbx), %rax
movq (%rax,%r12,8), %rdi
callq 0x76c6
incq %r12
jmp 0x773f
pushq $0x48
jmp 0x77ca
movq 0x10(%rbx), %rdi
callq 0x76c6
movq %r14, %rax
jmp 0x77cb
movq 0x10(%rbx), %rdi
callq 0x76c6
movq 0x18(%rbx), %rdi
callq 0x76c6
movq 0x20(%rbx), %rdi
callq 0x76c6
movq %r13, %rax
jmp 0x77cb
movq 0x10(%rbx), %rdi
callq 0x76c6
movq 0x18(%rbx), %rdi
callq 0x76c6
jmp 0x77b2
movq %rbx, %rdi
callq 0x76af
movq %rbp, %rax
jmp 0x77cb
movq %rbx, %rdi
callq 0x76af
movq 0x28(%rbx), %rdi
callq 0x76c6
pushq $0x30
popq %rax
movq (%rbx,%rax), %rbx
jmp 0x76e6
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x76af
movq %rbx, %rdi
callq 0x76af
xorl %r14d, %r14d
cmpq 0x20(%rbx), %r14
jae 0x780d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x77f5
xorl %r14d, %r14d
cmpq 0x30(%rbx), %r14
jae 0x78d4
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x7810
movq %rbx, %rdi
callq 0x76af
xorl %r14d, %r14d
cmpq 0x20(%rbx), %r14
jae 0x784f
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x7837
xorl %r14d, %r14d
cmpq 0x30(%rbx), %r14
jae 0x78d4
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x7852
xorl %r14d, %r14d
cmpq 0x10(%rbx), %r14
jae 0x78d4
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x786d
movq %rbx, %rdi
callq 0x76af
xorl %r14d, %r14d
cmpq 0x20(%rbx), %r14
jae 0x78d4
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x7890
movq %rbx, %rdi
callq 0x76af
movq 0x20(%rbx), %rdi
callq 0x76c6
xorl %r14d, %r14d
cmpq 0x28(%rbx), %r14
jae 0x78d4
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x76c6
incq %r14
jmp 0x78bc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq