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

#define MAX_DATA 0x8000
#define MAX_JUMP 0x1000

unsigned char *data;
size_t        *jump; // Used for JumpFuck
unsigned char  stor; // Storage, used for Extended Brainfuck

void bf_interp(char *file, size_t len)
{
	size_t ptr_pos;
	int tmp;
	size_t tmp_pos;
	int jumped;

	int jf   = ((size_t)options[OPT_JUMPFUCK].setting)   == 1;
	int ebf  = ((size_t)options[OPT_EXTBRAINI].setting)  == 1;

	data = (unsigned char *)malloc(MAX_DATA * sizeof(unsigned char));
	if(jf) jump = (size_t *)malloc(MAX_JUMP * sizeof(size_t));

	size_t i = 0;
	while(i < len)
	{
		if(jumped) jumped--;
		switch(file[i])
		{
			case '>':	if(ptr_pos >= (MAX_DATA - 1)) ptr_pos = 0;
						else                          ptr_pos++;
						i++;
						continue;

			case '<':	if(ptr_pos == 0) ptr_pos = MAX_DATA - 1;
						else             ptr_pos--;
						i++;
						continue;

			case '+':	data[ptr_pos]++;
						i++;
						continue;

			case '-':	data[ptr_pos]--;
						i++;
						continue;

			case '.':	putchar(data[ptr_pos]);
						i++;
						continue;<commit_msg>Clear data before running program<commit_after>#include <options.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <bf.h>

#define MAX_DATA 0x8000
#define MAX_JUMP 0x1000

unsigned char *data;
size_t        *jump; // Used for JumpFuck
unsigned char  stor; // Storage, used for Extended Brainfuck

void bf_interp(char *file, size_t len)
{
	size_t ptr_pos;
	int tmp;
	size_t tmp_pos;
	int jumped;

	int jf   = ((size_t)options[OPT_JUMPFUCK].setting)   == 1;
	int ebf  = ((size_t)options[OPT_EXTBRAINI].setting)  == 1;

	data = (unsigned char *)malloc(MAX_DATA);
	if(jf) jump = (size_t *)malloc(MAX_JUMP * sizeof(size_t));
	memset(data, 0, MAX_DATA);

	size_t i = 0;
	while(i < len)
	{
		if(jumped) jumped--;
		switch(file[i])
		{
			case '>':	if(ptr_pos >= (MAX_DATA - 1)) ptr_pos = 0;
						else                          ptr_pos++;
						i++;
						continue;

			case '<':	if(ptr_pos == 0) ptr_pos = MAX_DATA - 1;
						else             ptr_pos--;
						i++;
						continue;

			case '+':	data[ptr_pos]++;
						i++;
						continue;

			case '-':	data[ptr_pos]--;
						i++;
						continue;

			case '.':	putchar(data[ptr_pos]);
						i++;
						continue;
{'fraction_non_alphanumeric': 0.15611448395490027, 'fraction_numerical': 0.015177797051170859, 'mean_word_length': 2.6445497630331753, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, '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': '2025626', 'n_tokens_mistral': 1099, 'n_tokens_neox': 885, 'n_words': 210}