In the minimax.c file, inside the minimax function, you have two very similar for loops, at line 28 and 58.
consider extracting that whole code to another function, so that you don't need to write the same code twice, or, you can turn it into only one loop, and parameterising the differences between them.
i.e. instead of having two for loops, have one that does different things according to parameters.
so instead of
score = minimax(..., ..., ..., 0);
you can use
score = minimax(..., ..., ..., !is_max_turn);
and you can add both the if (score < min_val){ and if (score > max_val){ lines by turning them into one parameter val, and adding another condition like so:
if (is_max_turn && score > val) {
val = score;
best_move_index = i;
}
if (!is_max_turn && score < val){
val = score;
best_move_index = i;
}
This will surely make the entire file shorter, and easier to understand.