// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x78d3(%rip), %r12      # 0x10408
leaq 0x822c(%rip), %r14      # 0x10d68
leaq 0x86d5(%rip), %r15      # 0x11218
testq %rbx, %rbx
je 0x8c8c
movzwl (%rbx), %eax
cmpq $0x13, %rax
ja 0x8c8c
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
leaq 0x10(%rbx), %rdi
callq 0x8b22
movq 0x50(%rbx), %rdi
callq 0x8b22
movq 0x58(%rbx), %rbx
jmp 0x8b43
cmpq $0x0, 0x18(%rbx)
jne 0x8bf7
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4261
jmp 0x8bf7
cmpq $0x0, 0x18(%rbx)
jne 0x8bdc
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4261
jmp 0x8bdc
movq 0x10(%rbx), %rdi
callq 0x8b22
movq 0x18(%rbx), %rbx
jmp 0x8b43
movq 0x10(%rbx), %rdi
callq 0x8b22
movq 0x18(%rbx), %rdi
callq 0x8b22
movq 0x20(%rbx), %rdi
callq 0x8b22
movq 0x28(%rbx), %rbx
jmp 0x8b43
movq 0x10(%rbx), %rdi
callq 0x8b22
movq 0x18(%rbx), %rdi
callq 0x8b22
movq 0x20(%rbx), %rbx
jmp 0x8b43
cmpq $0x0, 0x18(%rbx)
jne 0x8c1a
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4261
movq 0x20(%rbx), %rdi
callq 0x8b22
cmpq $0x0, 0x28(%rbx)
je 0x8c50
xorl %r13d, %r13d
movq 0x30(%rbx), %rax
movq (%rax,%r13,8), %rdi
callq 0x8b22
movq 0x40(%rbx), %rax
movq (%rax,%r13,8), %rdi
callq 0x8b22
incq %r13
cmpq 0x28(%rbx), %r13
jb 0x8c2d
movq 0x48(%rbx), %rbx
jmp 0x8b43
cmpq $0x0, 0x18(%rbx)
jne 0x8c73
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
movq %r14, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x4261
movq 0x28(%rbx), %rdi
callq 0x8b22
movq 0x30(%rbx), %rbx
jmp 0x8b43
cmpq $0x0, 0x18(%rbx)
je 0x8c96
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x80c5(%rip), %rdi      # 0x10d68
leaq 0x856e(%rip), %rcx      # 0x11218
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4261
cmpq $0x0, 0x18(%rbx)
jne 0x8cdc
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x809a(%rip), %rdi      # 0x10d68
leaq 0x8543(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x4261
cmpq $0x0, 0x20(%rbx)
je 0x8cfc
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x8ce6
cmpq $0x0, 0x30(%rbx)
je 0x8c8c
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x30(%rbx), %r14
jb 0x8d06
jmp 0x8c8c
cmpq $0x0, 0x18(%rbx)
jne 0x8d43
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x8033(%rip), %rdi      # 0x10d68
leaq 0x84dc(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x4261
cmpq $0x0, 0x20(%rbx)
je 0x8d63
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x8d4d
cmpq $0x0, 0x30(%rbx)
je 0x8c8c
xorl %r14d, %r14d
movq 0x38(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x30(%rbx), %r14
jb 0x8d71
jmp 0x8c8c
cmpq $0x0, 0x10(%rbx)
je 0x8c8c
xorl %r14d, %r14d
movq 0x18(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x10(%rbx), %r14
jb 0x8d9a
jmp 0x8c8c
cmpq $0x0, 0x18(%rbx)
jne 0x8dd7
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x7f9f(%rip), %rdi      # 0x10d68
leaq 0x8448(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x4261
cmpq $0x0, 0x20(%rbx)
je 0x8c8c
xorl %r14d, %r14d
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x20(%rbx), %r14
jb 0x8de5
jmp 0x8c8c
cmpq $0x0, 0x18(%rbx)
jne 0x8e22
movl 0x8(%rbx), %esi
movl 0xc(%rbx), %edx
leaq 0x7f54(%rip), %rdi      # 0x10d68
leaq 0x83fd(%rip), %rcx      # 0x11218
xorl %eax, %eax
callq 0x4261
movq 0x20(%rbx), %rdi
callq 0x8b22
cmpq $0x0, 0x28(%rbx)
je 0x8c8c
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x8b22
incq %r14
cmpq 0x28(%rbx), %r14
jb 0x8e39
jmp 0x8c8c