#include <stdio.h>

inline static
short mx41_psin(short n) 
{ 
  short x = n ^ 0x8000; // x is shifted 180 degrees
  n = (n * x) >> 13;    // take the halfwawe and ...
  return n ^ (x >> 15); // negate the expression if x is negative
}

main(void)
{
  int i;
  for(i= 0 ; i < 0x0FFFF; i += 256)
    printf("%d\n",mx41_psin(i) );
  return 0;
}
