<commit_before>#include "nva.h"
#include <stdio.h>
#include <assert.h>
#include <unistd.h>

int main(int argc, char **argv) {
	if (nva_init()) {
		fprintf (stderr, "PCI init failure!\n");
		return 1;
	}
	int c;
	int cnum =0;
	while ((c = getopt (argc, argv, "c:")) != -1)
		switch (c) {
			case 'c':
				sscanf(optarg, "%d", &cnum);
				break;
		}
	if (cnum >= nva_cardsnum) {
		if (nva_cardsnum)
			fprintf (stderr, "No such card.\n");
		else
			fprintf (stderr, "No cards found.\n");
		return 1;
	}
	int32_t a, b = 4, i;
	if (optind >= argc) {
		fprintf (stderr, "No address specified.\n");
		return 1;
	}
	sscanf (argv[optind], "%x", &a);
	if (optind + 1 < argc)
		sscanf (argv[optind + 1], "%x", &b);
	int ls = 1;
	for (i = 0; i < b; i+=4) {
		uint32_t x, y, z;
		x = nva_rd32(cnum, a+i);
		nva_wr32(cnum, a+i, -1);
		y = nva_rd32(cnum, a+i);
		nva_wr32(cnum, a+i, 0);
		z = nva_rd32(cnum, a+i);
		nva_wr32(cnum, a+i, x);
		if (x || y || z) {
			printf ("%06x: %08x %08x %08x\n", a+i, x, y, z);
			ls = 1;
		} else {
			if (ls)
				printf("...\n");
			ls = 0;
		}
	}
	return 0;
}<commit_msg>nvascan: print asterisk next to registers with changeable values<commit_after>#include "nva.h"
#include <stdio.h>
#include <assert.h>
#include <unistd.h>

int main(int argc, char **argv) {
	if (nva_init()) {
		fprintf (stderr, "PCI init failure!\n");
		return 1;
	}
	int c;
	int cnum =0;
	while ((c = getopt (argc, argv, "c:")) != -1)
		switch (c) {
			case 'c':
				sscanf(optarg, "%d", &cnum);
				break;
		}
	if (cnum >= nva_cardsnum) {
		if (nva_cardsnum)
			fprintf (stderr, "No such card.\n");
		else
			fprintf (stderr, "No cards found.\n");
		return 1;
	}
	int32_t a, b = 4, i;
	if (optind >= argc) {
		fprintf (stderr, "No address specified.\n");
		return 1;
	}
	sscanf (argv[optind], "%x", &a);
	if (optind + 1 < argc)
		sscanf (argv[optind + 1], "%x", &b);
	int ls = 1;
	for (i = 0; i < b; i+=4) {
		uint32_t x, y, z;
		x = nva_rd32(cnum, a+i);
		nva_wr32(cnum, a+i, -1);
		y = nva_rd32(cnum, a+i);
		nva_wr32(cnum, a+i, 0);
		z = nva_rd32(cnum, a+i);
		nva_wr32(cnum, a+i, x);
		if (x || y || z) {
			int cool = (x != y) || (y != z);
			printf ("%06x: %08x %08x %08x%s\n", a+i, x, y, z, cool?" *":"");
			ls = 1;
		} else {
			if (ls)
				printf("...\n");
			ls = 0;
		}
	}
	return 0;
}
{'fraction_non_alphanumeric': 0.21979938944614041, 'fraction_numerical': 0.03488879197557784, 'mean_word_length': 2.888135593220339, 'pattern_counts': {'":': 1, '<': 13, '<?xml version=': 0, '>': 13, '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': '160466', 'n_tokens_mistral': 1243, 'n_tokens_neox': 1109, 'n_words': 299}