<commit_before>#include <stdbool.h>
#include <string.h>

void printArray(int arraySize, int * array){
  int i;
  for (i = 0; i < arraySize; i++) {
    printf("%d ", array[i]);
  }

  printf("\n");
}

int * insertion(int arraySize, int * array){

  if(arraySize == 1){
    printArray(arraySize, array);
    return array;
  }

  int i, numberToInsert, currentNumber;
  i = arraySize - 2;
  numberToInsert = array[i + 1];
  currentNumber = array[i];

  while(currentNumber > numberToInsert){
    array[i + 1] = currentNumber;
    printArray(arraySize, array);

    if(i <= 0) {
      currentNumber = numberToInsert - 1;
    }
    else{
      i--;
      currentNumber = array[i];
    }
  }

  if(arraySize > 2){
    array[i + 1] = numberToInsert;
  }else{
    array[i] = numberToInsert;
  }

  printArray(arraySize, array);

  return array;
}<commit_msg>Done. Not sure if done right.<commit_after>#include <stdbool.h>
#include <string.h>

void printArray(int arraySize, int * array){
  int i;
  for (i = 0; i < arraySize; i++) {
    printf("%d ", array[i]);
  }

  printf("\n");
}

int * insertion(int arraySize, int * array){

  if(arraySize == 1){
    printArray(arraySize, array);
    return array;
  }

  bool done = false;
  int i, numberToInsert, currentNumber;
  i = arraySize - 2;
  numberToInsert = array[i + 1];
  currentNumber = array[i];

  while(currentNumber > numberToInsert){
    array[i + 1] = currentNumber;
    printArray(arraySize, array);

    if(i <= 0) {
      array[0] = numberToInsert;
      array[1] = currentNumber;

      done = true;
      currentNumber = numberToInsert - 1;
    }
    else{
      i--;
      currentNumber = array[i];
    }
  }

  if(done == false){
    array[i + 1] = numberToInsert;
  }

  printArray(arraySize, array);

  return array;
}

// int main(void) {
//
//  int _ar_size;
//  scanf("%d", &_ar_size);
//  int _ar[_ar_size], _ar_i;
//  for(_ar_i = 0; _ar_i < _ar_size; _ar_i++) {
//    scanf("%d", &_ar[_ar_i]);
//  }
//
//  insertion(_ar_size, _ar);
// }
{'fraction_non_alphanumeric': 0.16450648055832504, 'fraction_numerical': 0.009970089730807577, 'mean_word_length': 2.7796610169491527, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1795352', 'n_tokens_mistral': 778, 'n_tokens_neox': 739, 'n_words': 171}