/******************************************************************************
*									      *
*  64x32 BIT MULTIPLY (UNSIGNED)					      *
*  01/12/07 (dkc)							      *
*									      *
******************************************************************************/
unsigned int carry(unsigned int a, unsigned int b, unsigned int sum);
void mul64_32(unsigned int a0, unsigned int a2, unsigned int m0,
	      unsigned int *product) {
unsigned int a1,a3,m1,temp;
unsigned int p0,p1,p2,p3,p4,p5,p6,p7;
unsigned int s1,s2,s3;
unsigned int c2,c3;
a1=a0&0xffff;
a0=a0>>16;
a3=a2&0xffff;
a2=a2>>16;
m1=m0&0xffff;
m0=m0>>16;
p0=a0*m0;
p1=a0*m1;
p2=a1*m0;
p3=a1*m1;
p4=a2*m0;
p5=a2*m1;
p6=a3*m0;
p7=a3*m1;

s3=p7+(p6<<16);
c3=carry(p7,(p6<<16),s3);
temp=s3+(p5<<16);
c3+=carry(s3,(p5<<16),temp);
s3=temp;

s2=p4+(p6>>16);
c2=carry(p4,(p6>>16),s2);
temp=s2+(p5>>16);
c2+=carry(s2,(p5>>16),temp);
s2=temp;
temp=s2+p3;
c2+=carry(s2,p3,temp);
s2=temp;
temp=s2+(p2<<16);
c2+=carry(s2,(p2<<16),temp);
s2=temp;
temp=s2+(p1<<16);
c2+=carry(s2,(p1<<16),temp);
s2=temp;

s1=p0+(p2>>16);
s1=s1+(p1>>16);

temp=s2+c3;
c2+=carry(s2,c3,temp);
s2=temp;

s1=s1+c2;

*product=s1;
*(product+1)=s2;
*(product+2)=s3;
return;
}