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

char *read_from_stdin();
int next_int(int*);
char next_char();
int next_str(char*);

#define MAX_BUF_LEN (100<<10<<10)

char fread_buf[MAX_BUF_LEN];
int fread_buf_pointer = 0;

char *read_from_stdin() {
    int len = fread(fread_buf, sizeof(char), MAX_BUF_LEN, stdin);
    fread_buf[len] = '\0';
    return fread_buf;
}

// next integer, prefix blanks will be removed
int next_int(int *res) {
    *res = 0;
    char c = fread_buf[fread_buf_pointer++];
    while(!(c >= '0' && c <= '9' || c == '\0')) {
        c = fread_buf[fread_buf_pointer++];
    }
    if(c == '\0') {
        return 0;
    }
    while(c >= '0' && c <= '9') {
        *res = (*res)*10 + c - '0';
        c = fread_buf[fread_buf_pointer++];
    }
    return c;
}

// next char, only a-zA-Z
char next_char() {
    char c = fread_buf[fread_buf_pointer++];
    while(!(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '\0')) {
        c = fread_buf[fread_buf_pointer++];
    }
    return c;
}

int next_str(char *buf) {
    int i = 0;
    char c = fread_buf[fread_buf_pointer++];
    while(c == ' ' || c == '\n' || c == '\r' || c == '\t') {
        c = fread_buf[fread_buf_pointer++];
    }
    while(c != '\n' && c != '\0') {
        buf[i] = fread_buf[fread_buf_pointer++];
        c = buf[i++];
    }
    return c;
}

int main(){
    int n, code;
    read_from_stdin();<commit_msg>next_int can return negative integers<commit_after>#include <stdio.h>
#include <stdlib.h>

char *read_from_stdin();
int next_int(int*);
char next_char();
int next_str(char*);

#define MAX_BUF_LEN (100<<10<<10)

char fread_buf[MAX_BUF_LEN];
int fread_buf_pointer = 0;

char *read_from_stdin() {
    int len = fread(fread_buf, sizeof(char), MAX_BUF_LEN, stdin);
    fread_buf[len] = '\0';
    return fread_buf;
}

// next integer, prefix blanks will be removed
int next_int(int *res) {
    char c = fread_buf[fread_buf_pointer++];
    int is_pos = 1;
    while(!(c >= '0' && c <= '9' || c == '\0' || c == '-')) {
        c = fread_buf[fread_buf_pointer++];
    }
    if(c == '\0') {
        return 0;
    }
    if(c == '-') {
        is_pos = 0;
        c = fread_buf[fread_buf_pointer++];
    }
    *res = 0;
    while(c >= '0' && c <= '9') {
        *res = (*res)*10 + c - '0';
        c = fread_buf[fread_buf_pointer++];
    }
    if(!is_pos) {
        *res = -*res;
    }
    return c;
}

// next char, only a-zA-Z
char next_char() {
    char c = fread_buf[fread_buf_pointer++];
    while(!(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '\0')) {
        c = fread_buf[fread_buf_pointer++];
    }
    return c;
}

int next_str(char *buf) {
    int i = 0;
    char c = fread_buf[fread_buf_pointer++];
    while(c == ' ' || c == '\n' || c == '\r' || c == '\t') {
        c = fread_buf[fread_buf_pointer++];
    }
    while(c != '\n' && c != '\0') {
        buf[i] = fread_buf[fread_buf_pointer++];
        c = buf[i++];
    }
    return c;
}

int main(){
    int n, code;
    read_from_stdin();
{'fraction_non_alphanumeric': 0.2073778664007976, 'fraction_numerical': 0.015952143569292122, 'mean_word_length': 2.5453474676089516, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 15, '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': '5846048', 'n_tokens_mistral': 1278, 'n_tokens_neox': 1250, 'n_words': 271}