<commit_before>/* 
 * 
 * _GASM_PARSER_C_ 
 * 
 * GASM ASM PARSERS
 * 
 */


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "goblin_sim.h"


/* -------------------------------------------------- GASM_PARSER */
/* 
 * GASM_PARSER
 * 
 */
extern uint64_t gasm_parser( char *afile, uint64_t *inter, uint64_t nrows )
{
	/* vars */
	FILE *ifile	= NULL;
	uint64_t insts	= 0x00ll;
	/* ---- */

#ifdef GSIM_DEBUG
	GSIM_PRINT_FUNC_ENTRY();
#endif

	/* 
	 * open the file 
	 */
	ifile	= fopen( afile, "r" );	
	if( ifile == NULL ){ 
		GSIM_PRINT_ERROR( "GASM_ERROR : Could not open assembly file" );
		return 0x00ll;
	}

	rewind( ifile );


	/* 
	 * close the file
	 */
	fclose( ifile );	

#ifdef GSIM_DEBUG
	GSIM_PRINT_FUNC_EXIT();
#endif
	return insts;	
}


/* EOF */<commit_msg>working through the first portion of the parser <commit_after>/* 
 * 
 * _GASM_PARSER_C_ 
 * 
 * GASM ASM PARSERS
 * 
 */


#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "goblin_sim.h"


/* -------------------------------------------------- GASM_PARSER */
/* 
 * GASM_PARSER
 * 
 */
extern uint64_t gasm_parser( char *afile, uint64_t *inter, uint64_t nrows )
{
	/* vars */
	FILE *ifile	= NULL;
	char *buf	= NULL;
	uint64_t insts	= 0x00ll;
	uint64_t tmp	= 0x00ll;
	int imm		= 0;
	/* ---- */

#ifdef GSIM_DEBUG
	GSIM_PRINT_FUNC_ENTRY();
#endif

	/* 
	 * open the file 
	 */
	ifile	= fopen( afile, "r" );	
	if( ifile == NULL ){ 
		GSIM_PRINT_ERROR( "GASM_ERROR : Could not open assembly file" );
		return 0x00ll;
	}

	/* 
	 * rewind the file 
	 */
	rewind( ifile );

	buf = gsim_malloc( sizeof( char ) * 2048 );
	memset( buf, 0, sizeof( char ) * 2048 );

	/* 
	 * Parse the file
	 */
	while( !feof( ifile ) ){
	
		fgets( buf, 2048, ifile );

		if( (strlen( buf ) > 2 ) && (buf[0] != '#') ){ 

			/* 
			 * this buffer is an instruction 
			 */		
		}

		memset( buf, 0, sizeof( char ) * 2048 );
		imm = 0;
		tmp = 0x00ll;
	}

	/* 
	 * close the file
	 */
	fclose( ifile );	

#ifdef GSIM_DEBUG
	GSIM_PRINT_FUNC_EXIT();
#endif
	return insts;	
}


/* EOF */
{'fraction_non_alphanumeric': 0.19828815977175462, 'fraction_numerical': 0.02757964812173086, 'mean_word_length': 2.24191063174114, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, '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': '731106', 'n_tokens_mistral': 994, 'n_tokens_neox': 863, 'n_words': 201}