#pragma On(Align_all_labels)
#pragma On(Align_labels)

#include <stdio.h>
#include <math.h>
#include <limits.h>

#define ROUND 1024
#define MAGNIFY 65536
#define PI _PI

main()
{
	double i,j;
	int x;

	printf("pragma On(Align_all_labels);\n\n");

	printf("int FX_sintbl[]={\n");
	for(i=0; i<ROUND; i+=8)
	{
		printf("\t");
		for(j=i; j<i+8; j++)
		{
			x=(int)(MAGNIFY * sin(j*PI*2/ROUND));
			printf("%6d,",x);
		}
		printf("\n");
	}
	x=(int)(MAGNIFY * sin(j*PI*2/ROUND));
	printf("\t%6d\n",x);
	printf("};\n\n");


	printf("int FX_costbl[]={\n");
	for(i=0; i<ROUND; i+=8)
	{
		printf("\t");
		for(j=i; j<i+8; j++)
		{
			x=(int)(MAGNIFY * cos(j*PI*2/ROUND));
			printf("%6d,",x);
		}
		printf("\n");
	}
	x=(int)(MAGNIFY * cos(j*PI*2/ROUND));
	printf("\t%6d\n",x);
	printf("};\n\n");


	printf("int FX_tantbl[]={\n");
	for(i=0; i<ROUND; i+=8)
	{
		printf("\t");
		for(j=i; j<i+8; j++)
		{
			if     (j==ROUND  /4)x=INT_MAX/2; /* もろにやると、でかすぎる */
			else if(j==ROUND*3/4)x=INT_MIN/2; /*           同上           */
		    else                 x=(int)(MAGNIFY * tan(j*PI*2/ROUND));
			printf("%6d,",x);
		}
		printf("\n");
	}
	x=(int)(MAGNIFY * tan(j*PI*2/ROUND));
	printf("\t%6d\n",x);
	printf("};\n");
}
