#include bastard

/* PASS: Function Naming
   Attempts to come up with meaningful names for subroutines.
*/


struct INSNTYPES { /* used to determine ration of insn types in fn */
	int ARITH;
	int LOGIC;
	int FPU;
	int MOVE;
	int ARRAY;
	int SYSTEM;
} insn_types;

/*  -------------------------------------------------------------------main()
*/
int main()
{
	int cont;
	name_t *n;
	function_t f;
	/* get # of instructions in subroutine */
	/* make list of calls */
	/* for each in list of important calls */
	/* retain  the most important */
	/* if name exists, rename*/
	
	/* if ! funcname check other calls */
	/* else base instruction types, e.g. if 50% string then StringManip */
	Message("Generating names for autodetected functions\n");

	cont = DBTableFirst( FUNCTION, &f);
	while( cont ) {
		n = GetNameObject(f.rva);

		if ( !n || !( n->type & NAME_SYMBOL) ) {
			//printf("Naming %s...\n", f.name);
		}
		if (n) free(n);
		cont = DBTableNext(FUNCTION, &f);
	}
	
	return(0);
}
