<commit_before>define(`pushdefFUNC_NAME', `
	pushdef(`FUNC_NAME', `xc_`'PROCESSOR_TYPE`'_`'ifelse(`$2', `', `$1', `$2')')
')
dnl {{{ DECL_STRUCT_P_FUNC(1:type, 2:name, 3:comma=;)
define(`DECL_STRUCT_P_FUNC', `translit(
	pushdefFUNC_NAME(`$1', `$2')
	define(`DEFINED_'ifelse(`$2', `', `$1', `$2'), `')
	ifdef(`EXPORT_'ifelse(`$2', `', `$1', `$2'), `void', `static void inline')
	FUNC_NAME`'(
		IFDPRINT( `const $1 * const src, int indent')
		IFCALC(   `xc_processor_t *processor, const $1 * const src')
		IFSTORE(  `xc_processor_t *processor, $1 *dst, const $1 * const src')
		IFRESTORE(`xc_processor_t *processor, $1 *dst, const $1 * const src')
		IFDASM(   `xc_dasm_t *dasm, zval *dst, const $1 * const src')
		IFASM(    `$1 *dst, const $1 * const src')
		TSRMLS_DC
	)ifelse(`$3', `', `;')
	popdef(`FUNC_NAME')dnl
, `
', ` ')')
dnl }}}
dnl {{{ DEF_STRUCT_P_FUNC(1:type, 2:name, 3:body)
define(`DEF_STRUCT_P_FUNC', `
	pushdefFUNC_NAME(`$1', `$2')
/* {`{'{ FUNC_NAME */
	ifdef(`EXPORT_'ifelse(`$2', `', `$1', `$2'), `
		/* export: DECL_STRUCT_P_FUNC(`$1', `$2') :export */
	')
DECL_STRUCT_P_FUNC(`$1', `$2', 1)
	{
		pushdef(`ELEMENTS_DONE')
		IFAUTOCHECK(`
			/* {{{ init assert */
			ifdef(`SIZEOF_$1', , `m4_errprint(`Warning: missing SIZEOF_$1, safe to ignore')')
			ifdef(`COUNTOF_$1', , `m4_errprint(`Warning: missing COUNTOF_$1, safe to ignore')')
			dnl SIZEOF_x COUNTOF_x can be both defined or both not
			ifdef(`SIZEOF_$1', `
				ifdef(`COUNTOF_$1', , `m4_errprint(`AUTOCHECK WARN: missing COUNTOF_$1')')
			', `
				define(`SIZEOF_$1', 0)
			')
			ifdef(`COUNTOF_$1', `
				ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: missing SIZEOF_$1')')
			', `
				define(`COUNTOF_$1', 0)
			')
			int xc_autocheck_assert_size = SIZEOF_$1, assert_count = COUNTOF_$1;
			int xc_autocheck_done_size = 0, xc_autocheck_done_count = 0;
			ifdef(`ELEMENTSOF_$1', `
				const char *xc_autocheck_assert_names[] = { ELEMENTSOF_$1 };
				size_t xc_autocheck_assert_names_count = sizeof(xc_autocheck_assert_names) / sizeof(xc_autocheck_assert_names[0]);
			', `
				const char **xc_autocheck_assert_names = NULL;
				size_t xc_autocheck_assert_names_count = 0;
			')
			zend_bool xc_autocheck_skip = 0;
			HashTable xc_autocheck_done_names;
			zend_hash_init(&xc_autocheck_done_names, 0, NULL, NULL, 0);
			/* }}} */
			IFRESTORE(`assert(xc_is_shm(src));')
			IFCALCSTORE(`assert(!xc_is_shm(src));')
			do {
		')
		ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')')

		ifdef(`USEMEMCPY', `IFCOPY(`
			memcpy(dst, src, sizeof($1));
			do {
		')')

		IFDPRINT(`
			fprintf(stderr, "%s", "{\n");
			indent ++;
		')
		$3`'
		IFDPRINT(`
			indent --;
			INDENT()fprintf(stderr, "}\n");
		')
		IFAUTOCHECK(`
		/* {{{ autocheck */
		if (!xc_autocheck_skip) {
			int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", xc_autocheck_assert_names, xc_autocheck_assert_names_count, &xc_autocheck_done_names);

			if (xc_autocheck_done_count != assert_count) {
				fprintf(stderr
					, "count assertion failed at %s `#'%d FUNC_NAME`' : unexpected:%d - expecting:%d = %d != 0\n"
					, __FILE__, __LINE__
					, xc_autocheck_done_count, assert_count, xc_autocheck_done_count - assert_count
					);
			}
			if (xc_autocheck_done_size != xc_autocheck_assert_size) {
				fprintf(stderr
					, "size assertion failed at %s `#'%d FUNC_NAME`' : unexpected:%d - expecting:%d = %d != 0\n"
					, __FILE__, __LINE__
					, xc_autocheck_done_size, xc_autocheck_assert_size, xc_autocheck_done_size - xc_autocheck_assert_size
					);
			}
			if (name_check_errors || xc_autocheck_done_count != assert_count || xc_autocheck_done_size != xc_autocheck_assert_size) {
				assert(0);
			}
		}
		zend_hash_destroy(&xc_autocheck_done_names);
		/* }}} */
		')
		ifdef(`ELEMENTSOF_$1', `
			pushdef(`ELEMENTS_UNDONE', LIST_DIFF(defn(`ELEMENTSOF_$1'), defn(`ELEMENTS_DONE')))<commit_msg>fix build using old C<commit_after>define(`pushdefFUNC_NAME', `
	pushdef(`FUNC_NAME', `xc_`'PROCESSOR_TYPE`'_`'ifelse(`$2', `', `$1', `$2')')
')
dnl {{{ DECL_STRUCT_P_FUNC(1:type, 2:name, 3:comma=;)
define(`DECL_STRUCT_P_FUNC', `translit(
	pushdefFUNC_NAME(`$1', `$2')
	define(`DEFINED_'ifelse(`$2', `', `$1', `$2'), `')
	ifdef(`EXPORT_'ifelse(`$2', `', `$1', `$2'), `void', `static void inline')
	FUNC_NAME`'(
		IFDPRINT( `const $1 * const src, int indent')
		IFCALC(   `xc_processor_t *processor, const $1 * const src')
		IFSTORE(  `xc_processor_t *processor, $1 *dst, const $1 * const src')
		IFRESTORE(`xc_processor_t *processor, $1 *dst, const $1 * const src')
		IFDASM(   `xc_dasm_t *dasm, zval *dst, const $1 * const src')
		IFASM(    `$1 *dst, const $1 * const src')
		TSRMLS_DC
	)ifelse(`$3', `', `;')
	popdef(`FUNC_NAME')dnl
, `
', ` ')')
dnl }}}
dnl {{{ DEF_STRUCT_P_FUNC(1:type, 2:name, 3:body)
define(`DEF_STRUCT_P_FUNC', `
	pushdefFUNC_NAME(`$1', `$2')
/* {`{'{ FUNC_NAME */
	ifdef(`EXPORT_'ifelse(`$2', `', `$1', `$2'), `
		/* export: DECL_STRUCT_P_FUNC(`$1', `$2') :export */
	')
DECL_STRUCT_P_FUNC(`$1', `$2', 1)
	{
		pushdef(`ELEMENTS_DONE')
		IFAUTOCHECK(`
			/* {{{ init assert */
			ifdef(`SIZEOF_$1', , `m4_errprint(`Warning: missing SIZEOF_$1, safe to ignore')')
			ifdef(`COUNTOF_$1', , `m4_errprint(`Warning: missing COUNTOF_$1, safe to ignore')')
			dnl SIZEOF_x COUNTOF_x can be both defined or both not
			ifdef(`SIZEOF_$1', `
				ifdef(`COUNTOF_$1', , `m4_errprint(`AUTOCHECK WARN: missing COUNTOF_$1')')
			', `
				define(`SIZEOF_$1', 0)
			')
			ifdef(`COUNTOF_$1', `
				ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: missing SIZEOF_$1')')
			', `
				define(`COUNTOF_$1', 0)
			')
			int xc_autocheck_assert_size = SIZEOF_$1, assert_count = COUNTOF_$1;
			int xc_autocheck_done_size = 0, xc_autocheck_done_count = 0;
			ifdef(`ELEMENTSOF_$1', `
				const char *xc_autocheck_assert_names[] = { ELEMENTSOF_$1 };
				size_t xc_autocheck_assert_names_count = sizeof(xc_autocheck_assert_names) / sizeof(xc_autocheck_assert_names[0]);
			', `
				const char **xc_autocheck_assert_names = NULL;
				size_t xc_autocheck_assert_names_count = 0;
			')
			zend_bool xc_autocheck_skip = 0;
			HashTable xc_autocheck_done_names;
			zend_hash_init(&xc_autocheck_done_names, 0, NULL, NULL, 0);
			/* }}} */
			IFRESTORE(`assert(xc_is_shm(src));')
			IFCALCSTORE(`assert(!xc_is_shm(src));')
			do {
		')
		ifdef(`SIZEOF_$1', , `m4_errprint(`AUTOCHECK WARN: $1: missing structinfo, dont panic')')

		ifdef(`USEMEMCPY', `IFCOPY(`
			memcpy(dst, src, sizeof($1));
			do {
		')')

		IFDPRINT(`
			fprintf(stderr, "%s", "{\n");
			indent ++;
			{
		')
		$3`'
		IFDPRINT(`
			}
			indent --;
			INDENT()fprintf(stderr, "}\n");
		')
		IFAUTOCHECK(`
		/* {{{ autocheck */
		if (!xc_autocheck_skip) {
			int name_check_errors = xc_check_names(__FILE__, __LINE__, "FUNC_NAME", xc_autocheck_assert_names, xc_autocheck_assert_names_count, &xc_autocheck_done_names);

			if (xc_autocheck_done_count != assert_count) {
				fprintf(stderr
					, "count assertion failed at %s `#'%d FUNC_NAME`' : unexpected:%d - expecting:%d = %d != 0\n"
					, __FILE__, __LINE__
					, xc_autocheck_done_count, assert_count, xc_autocheck_done_count - assert_count
					);
			}
			if (xc_autocheck_done_size != xc_autocheck_assert_size) {
				fprintf(stderr
					, "size assertion failed at %s `#'%d FUNC_NAME`' : unexpected:%d - expecting:%d = %d != 0\n"
					, __FILE__, __LINE__
					, xc_autocheck_done_size, xc_autocheck_assert_size, xc_autocheck_done_size - xc_autocheck_assert_size
					);
			}
			if (name_check_errors || xc_autocheck_done_count != assert_count || xc_autocheck_done_size != xc_autocheck_assert_size) {
				assert(0);
			}
		}
		zend_hash_destroy(&xc_autocheck_done_names);
		/* }}} */
		')
		ifdef(`ELEMENTSOF_$1', `
			pushdef(`ELEMENTS_UNDONE', LIST_DIFF(defn(`ELEMENTSOF_$1'), defn(`ELEMENTS_DONE')))
{'fraction_non_alphanumeric': 0.18005115089514068, 'fraction_numerical': 0.019437340153452685, 'mean_word_length': 4.763448784082535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7515404', 'n_tokens_mistral': 3701, 'n_tokens_neox': 3282, 'n_words': 535}