write crossover_fill function in C