<commit_before>#include <stdlib.h>
#include <stdio.h>
#include <string.h>

void swap(char *source, int i, int j) {
    char saved = source[i];
    source[i] = source[j];
    source[j] = saved;
}

void generate_permutations(char* a, int n) {
    if (n == 0) {
        printf("%s\n", a);
    } else {
        for (int i = 0; i < n; i++) {
            generate_permutations(a, n-1);
            swap(a, n % 2 == 0 ? 0 : i, n);
        }
        generate_permutations(a, n-1);
    }<commit_msg>More illustrative use of passing addresses in C<commit_after>#include <stdlib.h>
#include <stdio.h>
#include <string.h>

void swap(char *i, char *j) {
    char saved = *i;
    *i = *j;
    *j = saved;
}

void generate_permutations(char* a, int n) {
    if (n == 0) {
        printf("%s\n", a);
    } else {
        for (int i = 0; i < n; i++) {
            generate_permutations(a, n-1);
            swap(&a[n % 2 == 0 ? 0 : i], &a[n]);
        }
        generate_permutations(a, n-1);
    }
{'fraction_non_alphanumeric': 0.1783893985728848, 'fraction_numerical': 0.014271151885830785, 'mean_word_length': 2.1174603174603175, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, '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': '6131890', 'n_tokens_mistral': 392, 'n_tokens_neox': 375, 'n_words': 102}