// File: /workspace/github_cpp_makefile_star2_O3/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
testq %rdi, %rdi
je 0x8cc2
movq %rdi, %rbx
leaq 0x789f(%rip), %r12      # 0x10408
leaq 0x81f8(%rip), %r14      # 0x10d68
leaq 0x86a1(%rip), %r15      # 0x11218
movzwl (%rbx), %eax
cmpq $0x13, %rax
ja 0x8cc2
movl $0x18, %r13d
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x10(%rbx), %rdi
callq 0x8b4b
movq 0x50(%rbx), %rdi
callq 0x8b4b
movl $0x58, %r13d
jmp 0x8cac
cmpq $0x0, 0x18(%rbx)
jne 0x8bca
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x416b
movq 0x28(%rbx), %rdi
callq 0x8b4b
movl $0x30, %r13d
jmp 0x8cac
movl $0x28, %r13d
jmp 0x8c92
cmpq $0x0, 0x18(%rbx)
jne 0x8c03
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x416b
movq 0x20(%rbx), %rdi
callq 0x8b4b
movl $0x48, %r13d
cmpq $0x0, 0x28(%rbx)
je 0x8cac
xorl %ebp, %ebp
movq 0x30(%rbx), %rax
movq (%rax,%rbp,8), %rdi
callq 0x8b4b
movq 0x40(%rbx), %rax
movq (%rax,%rbp,8), %rdi
callq 0x8b4b
incq %rbp
cmpq 0x28(%rbx), %rbp
jb 0x8c1f
jmp 0x8cac
movq 0x10(%rbx), %rdi
callq 0x8b4b
jmp 0x8cac
movq 0x10(%rbx), %rdi
callq 0x8b4b
movq 0x18(%rbx), %rdi
callq 0x8b4b
movq 0x20(%rbx), %rdi
callq 0x8b4b
movl $0x28, %r13d
jmp 0x8cac
movq 0x10(%rbx), %rdi
callq 0x8b4b
movq 0x18(%rbx), %rdi
callq 0x8b4b
movl $0x20, %r13d
jmp 0x8cac
movl $0x20, %r13d
cmpq $0x0, 0x18(%rbx)
jne 0x8cac
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x416b
movq (%rbx,%r13), %rbx
testq %rbx, %rbx
jne 0x8b77
jmp 0x8cc2
cmpq $0x0, 0x18(%rbx)
je 0x8cd1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x808a(%rip), %rdi      # 0x10d68
leaq 0x8533(%rip), %rcx      # 0x11218
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x416b
cmpq $0x0, 0x18(%rbx)
jne 0x8d1c
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x805a(%rip), %rdi      # 0x10d68
leaq 0x8503(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x416b
cmpq $0x0, 0x20(%rbx)
je 0x8d3c
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x8d26
cmpq $0x0, 0x30(%rbx)
je 0x8cc2
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x30(%rbx), %r14
jb 0x8d4a
jmp 0x8cc2
cmpq $0x0, 0x18(%rbx)
jne 0x8d87
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x7fef(%rip), %rdi      # 0x10d68
leaq 0x8498(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x416b
cmpq $0x0, 0x20(%rbx)
je 0x8da7
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x8d91
cmpq $0x0, 0x30(%rbx)
je 0x8cc2
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x30(%rbx), %r14
jb 0x8db5
jmp 0x8cc2
cmpq $0x0, 0x18(%rbx)
jne 0x8df2
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x7f84(%rip), %rdi      # 0x10d68
leaq 0x842d(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x416b
movq 0x20(%rbx), %rdi
callq 0x8b4b
cmpq $0x0, 0x28(%rbx)
je 0x8cc2
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x28(%rbx), %r14
jb 0x8e09
jmp 0x8cc2
cmpq $0x0, 0x10(%rbx)
je 0x8cc2
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x10(%rbx), %r14
jb 0x8e32
jmp 0x8cc2
cmpq $0x0, 0x18(%rbx)
jne 0x8e6f
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x7f07(%rip), %rdi      # 0x10d68
leaq 0x83b0(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x416b
cmpq $0x0, 0x20(%rbx)
je 0x8cc2
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b4b
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x8e7d
jmp 0x8cc2