#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>

void Usage(void){
	printf("./command basename count\n");

}


int main(int argc, char **argv){
	uint32_t num1 = 0;
	uint32_t num2 = 0;
	uint32_t x, y, z;
	char *base;
	uint32_t baselen = 0;
	uint32_t count = 0;


	if(argc != 3){
		Usage();
		exit(1);
	}
	baselen = strlen(argv[1]);
	base = (char*)malloc(baselen+1);
	(void)sprintf(base, "%s", argv[1]);
	count = atoi(argv[2]);

//	char *filename = "test.txt";
//	FILE* fp;

//	if( (fp = fopen(filename, "w")) ){
		//fprintf(fp, "idx[512] = {\n"); // bufsize);
	    for(y=0; y<count; ++y){
			if(count<10)
				printf("\tuint %s%u = 0;\n", base, y);
				//fprintf(fp, "\t%s%u = 0;\n", base, y);
			else
				printf("\tuint %s0%u = 0;\n", base, y);
				//fprintf(fp, "\t%s0%u = 0;\n", base, y);
			//if(num1%32 == 0 && y+z != 0){
			//	fprintf(fp, "\n\t\t");
			//}

		}
//	}else{
//            printf("Error opening file!\n");
//    }
//        fclose(fp);

	free(base);

	return 0;
}