<commit_before>#ifndef NORCSID
static char rcsid[] = "$Header$";
#endif

#include <em_spec.h>
#include <em_flag.h>
#include "assert.h"
#include "param.h"
#include "tables.h"
#include "types.h"
#include <cg_pattern.h>
#include "data.h"
#include "result.h"
#include "extern.h"

/*
 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
 *
 *          This product is part of the Amsterdam Compiler Kit.
 *
 * Permission to use, sell, duplicate or disclose this software must be
 * obtained in writing. Requests for such permissions may be sent to
 *
 *      Dr. <NAME>
 *      Wiskundig Seminarium
 *      Vrije Universiteit
 *      Postbox 7161
 *      1007 MC Amsterdam
 *      The Netherlands
 *
 * Author: <NAME>
 */

#ifndef NDEBUG
#include <stdio.h>
extern char em_mnem[][4];
#endif

byte *trypat(bp,len) register byte *bp; {
	register patlen,i;
	result_t result;

	getint(patlen,bp);
	if (len == 3) {
		if (patlen < 3)
			return(0);
	} else {
		if (patlen != len)
			return(0);
	}
	for(i=0;i<patlen;i++)
		if (emp[i].em_instr != (*bp++&BMASK))
			return(0);
	for (i=0;i<patlen;i++)
		if (emp[i].em_optyp==OPNO)
			dollar[i].e_typ=EV_UNDEF;
		else if ((dollar[i].e_typ=argtyp(emp[i].em_instr))==EV_INT)
			dollar[i].e_v.e_con=emp[i].em_u.em_ioper;
		else
			dollar[i].e_v.e_str=emp[i].em_soper;
	getint(i,bp);
	if (i!=0) {
		result = compute(&enodes[i]);
		if (result.e_typ != EV_INT || result.e_v.e_con == 0)
			return(0);
	}
#ifndef NDEBUG
	if (Debug) {
		fprintf(stderr,"Matched:");
		for (i=0;i<patlen;i++)
			fprintf(stderr," %3.3s",em_mnem[emp[i].em_instr-sp_fmnem]);
		fprintf(stderr,"\n");
	}
#endif
	saveemp = emp;<commit_msg>Set saveemp before calling "compute". "compute" might need it!<commit_after>#ifndef NORCSID
static char rcsid[] = "$Header$";
#endif

#include <em_spec.h>
#include <em_flag.h>
#include "assert.h"
#include "param.h"
#include "tables.h"
#include "types.h"
#include <cg_pattern.h>
#include "data.h"
#include "result.h"
#include "extern.h"

/*
 * (c) copyright 1983 by the Vrije Universiteit, Amsterdam, The Netherlands.
 *
 *          This product is part of the Amsterdam Compiler Kit.
 *
 * Permission to use, sell, duplicate or disclose this software must be
 * obtained in writing. Requests for such permissions may be sent to
 *
 *      Dr. <NAME>
 *      Wiskundig Seminarium
 *      Vrije Universiteit
 *      Postbox 7161
 *      1007 MC Amsterdam
 *      The Netherlands
 *
 * Author: <NAME>
 */

#ifndef NDEBUG
#include <stdio.h>
extern char em_mnem[][4];
#endif

byte *trypat(bp,len) register byte *bp; {
	register patlen,i;
	result_t result;

	getint(patlen,bp);
	if (len == 3) {
		if (patlen < 3)
			return(0);
	} else {
		if (patlen != len)
			return(0);
	}
	for(i=0;i<patlen;i++)
		if (emp[i].em_instr != (*bp++&BMASK))
			return(0);
	for (i=0;i<patlen;i++)
		if (emp[i].em_optyp==OPNO)
			dollar[i].e_typ=EV_UNDEF;
		else if ((dollar[i].e_typ=argtyp(emp[i].em_instr))==EV_INT)
			dollar[i].e_v.e_con=emp[i].em_u.em_ioper;
		else
			dollar[i].e_v.e_str=emp[i].em_soper;
	getint(i,bp);
	if (i!=0) {
		struct emline *svp = saveemp;

		saveemp = emp;
		result = compute(&enodes[i]);
		if (result.e_typ != EV_INT || result.e_v.e_con == 0) {
			saveemp = svp;
			return(0);
		}
	}
#ifndef NDEBUG
	if (Debug) {
		fprintf(stderr,"Matched:");
		for (i=0;i<patlen;i++)
			fprintf(stderr," %3.3s",em_mnem[emp[i].em_instr-sp_fmnem]);
		fprintf(stderr,"\n");
	}
#endif
	saveemp = emp;
{'fraction_non_alphanumeric': 0.1709724238026125, 'fraction_numerical': 0.01509433962264151, 'mean_word_length': 3.779472954230236, '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': '1269382', 'n_tokens_mistral': 1524, 'n_tokens_neox': 1418, 'n_words': 321}