/*****************************************************************************/
/* */
/* 1024/32 BIT DIVIDE (UNSIGNED) */
/* 02/08/12 (dkc) */
/* */
/*****************************************************************************/
unsigned int carry(unsigned int a, unsigned int b, unsigned int sum);
unsigned int lmbd(unsigned int mode, unsigned int a);
void div1024_32(unsigned int a0, unsigned int a1, unsigned int a2,
unsigned int a3, unsigned int a4, unsigned int a5,
unsigned int a6, unsigned int a7, unsigned int a8,
unsigned int a9, unsigned int a10, unsigned int a11,
unsigned int a12, unsigned int a13, unsigned int a14,
unsigned int a15, unsigned int a16, unsigned int a17,
unsigned int a18, unsigned int a19, unsigned int a20,
unsigned int a21, unsigned int a22, unsigned int a23,
unsigned int a24, unsigned int a25, unsigned int a26,
unsigned int a27, unsigned int a28, unsigned int a29,
unsigned int a30, unsigned int a31,
unsigned int *quotient, unsigned int d31) {
unsigned int i,d0,d1,d2,d3,d4,d5,d6,dshift,ashift,count,flag;
unsigned int shift,c,c0,c1,c2,c3,c4,c5,c6,temp,temp0,temp1,temp2,temp3;
unsigned int temp4,temp5,temp6,temp7;
unsigned int d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,d18,d19,d20,d21,d22,d23;
unsigned int d24,d25,d26,d27,d28,d29,d30;
unsigned int c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17,c18,c19,c20,c21,c22,c23;
unsigned int c24,c25,c26,c27,c28,c29,c30;
unsigned int temp8,temp9,temp10,temp11,temp12,temp13,temp14,temp15;
unsigned int temp16,temp17,temp18,temp19,temp20,temp21,temp22,temp23;
unsigned int temp24,temp25,temp26,temp27,temp28,temp29,temp30,temp31;
if ((a0==0)&&(a1==0)&&(a2==0)&&(a3==0)&&(a4==0)&&(a5==0)&&(a6==0)&&(a7==0)&&
(a8==0)&&(a9==0)&&(a10==0)&&(a11==0)&&(a12==0)&&(a13==0)&&(a14==0)&&(a15==0)&&
(a16==0)&&(a17==0)&&(a18==0)&&(a19==0)&&(a20==0)&&(a21==0)&&(a22==0)&&(a23==0)&&
(a24==0)&&(a25==0)&&(a26==0)&&(a27==0)&&(a28==0)&&(a29==0)&&(a30==0)&&(a31<d31)) {
*quotient=0;
*(quotient+1)=0;
*(quotient+2)=0;
*(quotient+3)=0;
*(quotient+4)=0;
*(quotient+5)=0;
*(quotient+6)=0;
*(quotient+7)=0;
*(quotient+8)=0;
*(quotient+9)=0;
*(quotient+10)=0;
*(quotient+11)=0;
*(quotient+12)=0;
*(quotient+13)=0;
*(quotient+14)=0;
*(quotient+15)=0;
*(quotient+16)=0;
*(quotient+17)=0;
*(quotient+18)=0;
*(quotient+19)=0;
*(quotient+20)=0;
*(quotient+21)=0;
*(quotient+22)=0;
*(quotient+23)=0;
*(quotient+24)=0;
*(quotient+25)=0;
*(quotient+26)=0;
*(quotient+27)=0;
*(quotient+28)=0;
*(quotient+29)=0;
*(quotient+30)=0;
*(quotient+31)=0;
return;
}
dshift=lmbd(1,d31);
dshift+=992;
ashift=lmbd(1,a0);
if (a0==0)
ashift+=lmbd(1,a1);
if ((a0|a1)==0)
ashift+=lmbd(1,a2);
if ((a0|a1|a2)==0)
ashift+=lmbd(1,a3);
if ((a0|a1|a2|a3)==0)
ashift+=lmbd(1,a4);
if ((a0|a1|a2|a3|a4)==0)
ashift+=lmbd(1,a5);
if ((a0|a1|a2|a3|a4|a5)==0)
ashift+=lmbd(1,a6);
if ((a0|a1|a2|a3|a4|a5|a6)==0)
ashift+=lmbd(1,a7);
if ((a0|a1|a2|a3|a4|a5|a6|a7)==0)
ashift+=lmbd(1,a8);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8)==0)
ashift+=lmbd(1,a9);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9)==0)
ashift+=lmbd(1,a10);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10)==0)
ashift+=lmbd(1,a11);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11)==0)
ashift+=lmbd(1,a12);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12)==0)
ashift+=lmbd(1,a13);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13)==0)
ashift+=lmbd(1,a14);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14)==0)
ashift+=lmbd(1,a15);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15)==0)
ashift+=lmbd(1,a16);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16)==0)
ashift+=lmbd(1,a17);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17)==0)
ashift+=lmbd(1,a18);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18)==0)
ashift+=lmbd(1,a19);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19)==0)
ashift+=lmbd(1,a20);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20)==0)
ashift+=lmbd(1,a21);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21)==0)
ashift+=lmbd(1,a22);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22)==0)
ashift+=lmbd(1,a23);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23)==0)
ashift+=lmbd(1,a24);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24)==0)
ashift+=lmbd(1,a25);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24|a25)==0)
ashift+=lmbd(1,a26);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24|a25|a26)==0)
ashift+=lmbd(1,a27);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24|a25|a26|a27)==0)
ashift+=lmbd(1,a28);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24|a25|a26|a27|a28)==0)
ashift+=lmbd(1,a29);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24|a25|a26|a27|a28|a29)==0)
ashift+=lmbd(1,a30);
if ((a0|a1|a2|a3|a4|a5|a6|a7|a8|a9|a10|a11|a12|a13|a14|a15|a16|a17|a18|a19|a20|a21|a22|a23|a24|a25|a26|a27|a28|a29|a30)==0)
ashift+=lmbd(1,a31);
shift=dshift-ashift;
count=shift+1;
d0=0;
d1=0;
d2=0;
d3=0;
d4=0;
d5=0;
d6=0;
d7=0;
d8=0;
d9=0;
d10=0;
d11=0;
d12=0;
d13=0;
d14=0;
d15=0;
d16=0;
d17=0;
d18=0;
d19=0;
d20=0;
d21=0;
d22=0;
d23=0;
d24=0;
d25=0;
d26=0;
d27=0;
d28=0;
d29=0;
d30=0;
if (shift<32) {
if (shift!=0) {
d30=d31>>(32-shift);
d31=d31<<shift;
}
flag=31;
shift=32-shift;
}
else {
shift=shift-32;
d30=d31;
d31=0;
if (shift<32) {
if (shift!=0) {
d29=d30>>(32-shift);
d30=d30<<shift;
}
flag=30;
shift=32-shift;
}
else {
shift=shift-32;
d29=d30;
d30=0;
if (shift<32) {
if (shift!=0) {
d28=d29>>(32-shift);
d29=d29<<shift;
}
flag=29;
shift=32-shift;
}
else {
shift=shift-32;
d28=d29;
d29=0;
if (shift<32) {
if (shift!=0) {
d27=d28>>(32-shift);
d28=d28<<shift;
}
flag=28;
shift=32-shift;
}
else {
shift=shift-32;
d27=d28;
d28=0;
if (shift<32) {
if (shift!=0) {
d26=d27>>(32-shift);
d27=d27<<shift;
}
flag=27;
shift=32-shift;
}
else {
shift=shift-32;
d26=d27;
d27=0;
if (shift<32) {
if (shift!=0) {
d25=d26>>(32-shift);
d26=d26<<shift;
}
flag=26;
shift=32-shift;
}
else {
shift=shift-32;
d25=d26;
d26=0;
if (shift<32) {
if (shift!=0) {
d24=d25>>(32-shift);
d25=d25<<shift;
}
flag=25;
shift=32-shift;
}
else {
shift=shift-32;
d24=d25;
d25=0;
if (shift<32) {
if (shift!=0) {
d23=d24>>(32-shift);
d24=d24<<shift;
}
flag=24;
shift=32-shift;
}
else {
shift=shift-32;
d23=d24;
d24=0;
if (shift<32) {
if (shift!=0) {
d22=d23>>(32-shift);
d23=d23<<shift;
}
flag=23;
shift=32-shift;
}
else {
shift=shift-32;
d22=d23;
d23=0;
if (shift<32) {
if (shift!=0) {
d21=d22>>(32-shift);
d22=d22<<shift;
}
flag=22;
shift=32-shift;
}
else {
shift=shift-32;
d21=d22;
d22=0;
if (shift<32) {
if (shift!=0) {
d20=d21>>(32-shift);
d21=d21<<shift;
}
flag=21;
shift=32-shift;
}
else {
shift=shift-32;
d20=d21;
d21=0;
if (shift<32) {
if (shift!=0) {
d19=d20>>(32-shift);
d20=d20<<shift;
}
flag=20;
shift=32-shift;
}
else {
shift=shift-32;
d19=d20;
d20=0;
if (shift<32) {
if (shift!=0) {
d18=d19>>(32-shift);
d19=d19<<shift;
}
flag=19;
shift=32-shift;
}
else {
shift=shift-32;
d18=d19;
d19=0;
if (shift<32) {
if (shift!=0) {
d17=d18>>(32-shift);
d18=d18<<shift;
}
flag=18;
shift=32-shift;
}
else {
shift=shift-32;
d17=d18;
d18=0;
if (shift<32) {
if (shift!=0) {
d16=d17>>(32-shift);
d17=d17<<shift;
}
flag=17;
shift=32-shift;
}
else {
shift=shift-32;
d16=d17;
d17=0;
if (shift<32) {
if (shift!=0) {
d15=d16>>(32-shift);
d16=d16<<shift;
}
flag=16;
shift=32-shift;
}
else {
shift=shift-32;
d15=d16;
d16=0;
if (shift<32) {
if (shift!=0) {
d14=d15>>(32-shift);
d15=d15<<shift;
}
flag=15;
shift=32-shift;
}
else {
shift=shift-32;
d14=d15;
d15=0;
if (shift<32) {
if (shift!=0) {
d13=d14>>(32-shift);
d14=d14<<shift;
}
flag=14;
shift=32-shift;
}
else {
shift=shift-32;
d13=d14;
d14=0;
if (shift<32) {
if (shift!=0) {
d12=d13>>(32-shift);
d13=d13<<shift;
}
flag=13;
shift=32-shift;
}
else {
shift=shift-32;
d12=d13;
d13=0;
if (shift<32) {
if (shift!=0) {
d11=d12>>(32-shift);
d12=d12<<shift;
}
flag=12;
shift=32-shift;
}
else {
shift=shift-32;
d11=d12;
d12=0;
if (shift<32) {
if (shift!=0) {
d10=d11>>(32-shift);
d11=d11<<shift;
}
flag=11;
shift=32-shift;
}
else {
shift=shift-32;
d10=d11;
d11=0;
if (shift<32) {
if (shift!=0) {
d9=d10>>(32-shift);
d10=d10<<shift;
}
flag=10;
shift=32-shift;
}
else {
shift=shift-32;
d9=d10;
d10=0;
if (shift<32) {
if (shift!=0) {
d8=d9>>(32-shift);
d9=d9<<shift;
}
flag=9;
shift=32-shift;
}
else {
shift=shift-32;
d8=d9;
d9=0;
if (shift<32) {
if (shift!=0) {
d7=d8>>(32-shift);
d8=d8<<shift;
}
flag=8;
shift=32-shift;
}
else {
shift=shift-32;
d7=d8;
d8=0;
if (shift<32) {
if (shift!=0) {
d6=d7>>(32-shift);
d7=d7<<shift;
}
flag=7;
shift=32-shift;
}
else {
shift=shift-32;
d6=d7;
d7=0;
if (shift<32) {
if (shift!=0) {
d5=d6>>(32-shift);
d6=d6<<shift;
}
flag=6;
shift=32-shift;
}
else {
shift=shift-32;
d5=d6;
d6=0;
if (shift<32) {
if (shift!=0) {
d4=d5>>(32-shift);
d5=d5<<shift;
}
flag=5;
shift=32-shift;
}
else {
shift=shift-32;
d4=d5;
d5=0;
if (shift<32) {
if (shift!=0) {
d3=d4>>(32-shift);
d4=d4<<shift;
}
flag=4;
shift=32-shift;
}
else {
shift=shift-32;
d3=d4;
d4=0;
if (shift<32) {
if (shift!=0) {
d2=d3>>(32-shift);
d3=d3<<shift;
}
flag=3;
shift=32-shift;
}
else {
shift=shift-32;
d2=d3;
d3=0;
if (shift<32) {
if (shift!=0) {
d1=d2>>(32-shift);
d2=d2<<shift;
}
flag=2;
shift=32-shift;
}
else {
shift=shift-32;
d1=d2;
d2=0;
if (shift<32) {
if (shift!=0) {
d0=d1>>(32-shift);
d1=d1<<shift;
}
flag=1;
shift=32-shift;
}
else {
shift=shift-32;
d0=d1;
d1=0;
if (shift<32) {
if (shift!=0) {
d0=d0<<shift;
}
flag=0;
shift=32-shift;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
d0=~d0;
d1=~d1;
d2=~d2;
d3=~d3;
d4=~d4;
d5=~d5;
d6=~d6;
d7=~d7;
d8=~d8;
d9=~d9;
d10=~d10;
d11=~d11;
d12=~d12;
d13=~d13;
d14=~d14;
d15=~d15;
d16=~d16;
d17=~d17;
d18=~d18;
d19=~d19;
d20=~d20;
d21=~d21;
d22=~d22;
d23=~d23;
d24=~d24;
d25=~d25;
d26=~d26;
d27=~d27;
d28=~d28;
d29=~d29;
d30=~d30;
d31=~d31;
temp=d31+1;
c=carry(d31,1,temp);
d31=temp;
temp=d30+c;
c=carry(d30,1,temp);
d30=temp;
temp=d29+c;
c=carry(d29,1,temp);
d29=temp;
temp=d28+c;
c=carry(d28,1,temp);
d28=temp;
temp=d27+c;
c=carry(d27,1,temp);
d27=temp;
temp=d26+c;
c=carry(d26,1,temp);
d26=temp;
temp=d25+c;
c=carry(d25,1,temp);
d25=temp;
temp=d24+c;
c=carry(d24,1,temp);
d24=temp;
temp=d23+c;
c=carry(d23,1,temp);
d23=temp;
temp=d22+c;
c=carry(d22,1,temp);
d22=temp;
temp=d21+c;
c=carry(d21,1,temp);
d21=temp;
temp=d20+c;
c=carry(d20,1,temp);
d20=temp;
temp=d19+c;
c=carry(d19,1,temp);
d19=temp;
temp=d18+c;
c=carry(d18,1,temp);
d18=temp;
temp=d17+c;
c=carry(d17,1,temp);
d17=temp;
temp=d16+c;
c=carry(d16,1,temp);
d16=temp;
temp=d15+c;
c=carry(d15,1,temp);
d15=temp;
temp=d14+c;
c=carry(d14,1,temp);
d14=temp;
temp=d13+c;
c=carry(d13,1,temp);
d13=temp;
temp=d12+c;
c=carry(d12,1,temp);
d12=temp;
temp=d11+c;
c=carry(d11,1,temp);
d11=temp;
temp=d10+c;
c=carry(d10,1,temp);
d10=temp;
temp=d9+c;
c=carry(d9,1,temp);
d9=temp;
temp=d8+c;
c=carry(d8,1,temp);
d8=temp;
temp=d7+c;
c=carry(d7,1,temp);
d7=temp;
temp=d6+c;
c=carry(d6,1,temp);
d6=temp;
temp=d5+c;
c=carry(d5,1,temp);
d5=temp;
temp=d4+c;
c=carry(d4,1,temp);
d4=temp;
temp=d3+c;
c=carry(d3,1,temp);
d3=temp;
temp=d2+c;
c=carry(d2,c,temp);
d2=temp;
temp=d1+c;
c=carry(d1,c,temp);
d1=temp;
d0=d0+c;
for (i=0; i<count; i++) {
temp31=a31+d31;
c30=carry(a31,d31,temp31);
temp=a30+c30;
c29=carry(a30,c30,temp);
temp30=temp+d30;
c29+=carry(temp,d30,temp30);
temp=a29+c29;
c28=carry(a29,c29,temp);
temp29=temp+d29;
c28+=carry(temp,d29,temp29);
temp=a28+c28;
c27=carry(a28,c28,temp);
temp28=temp+d28;
c27+=carry(temp,d28,temp28);
temp=a27+c27;
c26=carry(a27,c27,temp);
temp27=temp+d27;
c26+=carry(temp,d27,temp27);
temp=a26+c26;
c25=carry(a26,c26,temp);
temp26=temp+d26;
c25+=carry(temp,d26,temp26);
temp=a25+c25;
c24=carry(a25,c25,temp);
temp25=temp+d25;
c24+=carry(temp,d25,temp25);
temp=a24+c24;
c23=carry(a24,c24,temp);
temp24=temp+d24;
c23+=carry(temp,d24,temp24);
temp=a23+c23;
c22=carry(a23,c23,temp);
temp23=temp+d23;
c22+=carry(temp,d23,temp23);
temp=a22+c22;
c21=carry(a22,c22,temp);
temp22=temp+d22;
c21+=carry(temp,d22,temp22);
temp=a21+c21;
c20=carry(a21,c21,temp);
temp21=temp+d21;
c20+=carry(temp,d21,temp21);
temp=a20+c20;
c19=carry(a20,c20,temp);
temp20=temp+d20;
c19+=carry(temp,d20,temp20);
temp=a19+c19;
c18=carry(a19,c19,temp);
temp19=temp+d19;
c18+=carry(temp,d19,temp19);
temp=a18+c18;
c17=carry(a18,c18,temp);
temp18=temp+d18;
c17+=carry(temp,d18,temp18);
temp=a17+c17;
c16=carry(a17,c17,temp);
temp17=temp+d17;
c16+=carry(temp,d17,temp17);
temp=a16+c16;
c15=carry(a16,c16,temp);
temp16=temp+d16;
c15+=carry(temp,d16,temp16);
temp=a15+c15;
c14=carry(a15,c15,temp);
temp15=temp+d15;
c14+=carry(temp,d15,temp15);
temp=a14+c14;
c13=carry(a14,c14,temp);
temp14=temp+d14;
c13+=carry(temp,d14,temp14);
temp=a13+c13;
c12=carry(a13,c13,temp);
temp13=temp+d13;
c12+=carry(temp,d13,temp13);
temp=a12+c12;
c11=carry(a12,c12,temp);
temp12=temp+d12;
c11+=carry(temp,d12,temp12);
temp=a11+c11;
c10=carry(a11,c11,temp);
temp11=temp+d11;
c10+=carry(temp,d11,temp11);
temp=a10+c10;
c9=carry(a10,c10,temp);
temp10=temp+d10;
c9+=carry(temp,d10,temp10);
temp=a9+c9;
c8=carry(a9,c9,temp);
temp9=temp+d9;
c8+=carry(temp,d9,temp9);
temp=a8+c8;
c7=carry(a8,c8,temp);
temp8=temp+d8;
c7+=carry(temp,d8,temp8);
temp=a7+c7;
c6=carry(a7,c7,temp);
temp7=temp+d7;
c6+=carry(temp,d7,temp7);
temp=a6+c6;
c5=carry(a6,c6,temp);
temp6=temp+d6;
c5+=carry(temp,d6,temp6);
temp=a5+c5;
c4=carry(a5,c5,temp);
temp5=temp+d5;
c4+=carry(temp,d5,temp5);
temp=a4+c4;
c3=carry(a4,c4,temp);
temp4=temp+d4;
c3+=carry(temp,d4,temp4);
temp=a3+c3;
c2=carry(a3,c3,temp);
temp3=temp+d3;
c2+=carry(temp,d3,temp3);
temp=a2+c2;
c1=carry(a2,c2,temp);
temp2=temp+d2;
c1+=carry(temp,d2,temp2);
temp=a1+c1;
c0=carry(a1,c1,temp);
temp1=temp+d1;
c0+=carry(temp,d1,temp1);
temp0=a0+d0+c0;
if ((temp0>>31)==0) {
a0=temp0<<1;
if ((temp1>>31)!=0)
c=1;
else
c=0;
a0=a0+c;
a1=temp1<<1;
if ((temp2>>31)!=0)
c=1;
else
c=0;
a1=a1+c;
a2=temp2<<1;
if ((temp3>>31)!=0)
c=1;
else
c=0;
a2=a2+c;
a3=temp3<<1;
if ((temp4>>31)!=0)
c=1;
else
c=0;
a3=a3+c;
a4=temp4<<1;
if ((temp5>>31)!=0)
c=1;
else
c=0;
a4=a4+c;
a5=temp5<<1;
if ((temp6>>31)!=0)
c=1;
else
c=0;
a5=a5+c;
a6=temp6<<1;
if ((temp7>>31)!=0)
c=1;
else
c=0;
a6=a6+c;
a7=temp7<<1;
if ((temp8>>31)!=0)
c=1;
else
c=0;
a7=a7+c;
a8=temp8<<1;
if ((temp9>>31)!=0)
c=1;
else
c=0;
a8=a8+c;
a9=temp9<<1;
if ((temp10>>31)!=0)
c=1;
else
c=0;
a9=a9+c;
a10=temp10<<1;
if ((temp11>>31)!=0)
c=1;
else
c=0;
a10=a10+c;
a11=temp11<<1;
if ((temp12>>31)!=0)
c=1;
else
c=0;
a11=a11+c;
a12=temp12<<1;
if ((temp13>>31)!=0)
c=1;
else
c=0;
a12=a12+c;
a13=temp13<<1;
if ((temp14>>31)!=0)
c=1;
else
c=0;
a13=a13+c;
a14=temp14<<1;
if ((temp15>>31)!=0)
c=1;
else
c=0;
a14=a14+c;
a15=temp15<<1;
if ((temp16>>31)!=0)
c=1;
else
c=0;
a15=a15+c;
a16=temp16<<1;
if ((temp17>>31)!=0)
c=1;
else
c=0;
a16=a16+c;
a17=temp17<<1;
if ((temp18>>31)!=0)
c=1;
else
c=0;
a17=a17+c;
a18=temp18<<1;
if ((temp19>>31)!=0)
c=1;
else
c=0;
a18=a18+c;
a19=temp19<<1;
if ((temp20>>31)!=0)
c=1;
else
c=0;
a19=a19+c;
a20=temp20<<1;
if ((temp21>>31)!=0)
c=1;
else
c=0;
a20=a20+c;
a21=temp21<<1;
if ((temp22>>31)!=0)
c=1;
else
c=0;
a21=a21+c;
a22=temp22<<1;
if ((temp23>>31)!=0)
c=1;
else
c=0;
a22=a22+c;
a23=temp23<<1;
if ((temp24>>31)!=0)
c=1;
else
c=0;
a23=a23+c;
a24=temp24<<1;
if ((temp25>>31)!=0)
c=1;
else
c=0;
a24=a24+c;
a25=temp25<<1;
if ((temp26>>31)!=0)
c=1;
else
c=0;
a25=a25+c;
a26=temp26<<1;
if ((temp27>>31)!=0)
c=1;
else
c=0;
a26=a26+c;
a27=temp27<<1;
if ((temp28>>31)!=0)
c=1;
else
c=0;
a27=a27+c;
a28=temp28<<1;
if ((temp29>>31)!=0)
c=1;
else
c=0;
a28=a28+c;
a29=temp29<<1;
if ((temp30>>31)!=0)
c=1;
else
c=0;
a29=a29+c;
a30=temp30<<1;
if ((temp31>>31)!=0)
c=1;
else
c=0;
a30=a30+c;
a31=temp31<<1;
a31=a31+1;
}
else {
a0=a0<<1;
if ((a1>>31)!=0)
c=1;
else
c=0;
a0=a0+c;
a1=a1<<1;
if ((a2>>31)!=0)
c=1;
else
c=0;
a1=a1+c;
a2=a2<<1;
if ((a3>>31)!=0)
c=1;
else
c=0;
a2=a2+c;
a3=a3<<1;
if ((a4>>31)!=0)
c=1;
else
c=0;
a3=a3+c;
a4=a4<<1;
if ((a5>>31)!=0)
c=1;
else
c=0;
a4=a4+c;
a5=a5<<1;
if ((a6>>31)!=0)
c=1;
else
c=0;
a5=a5+c;
a6=a6<<1;
if ((a7>>31)!=0)
c=1;
else
c=0;
a6=a6+c;
a7=a7<<1;
if ((a8>>31)!=0)
c=1;
else
c=0;
a7=a7+c;
a8=a8<<1;
if ((a9>>31)!=0)
c=1;
else
c=0;
a8=a8+c;
a9=a9<<1;
if ((a10>>31)!=0)
c=1;
else
c=0;
a9=a9+c;
a10=a10<<1;
if ((a11>>31)!=0)
c=1;
else
c=0;
a10=a10+c;
a11=a11<<1;
if ((a12>>31)!=0)
c=1;
else
c=0;
a11=a11+c;
a12=a12<<1;
if ((a13>>31)!=0)
c=1;
else
c=0;
a12=a12+c;
a13=a13<<1;
if ((a14>>31)!=0)
c=1;
else
c=0;
a13=a13+c;
a14=a14<<1;
if ((a15>>31)!=0)
c=1;
else
c=0;
a14=a14+c;
a15=a15<<1;
if ((a16>>31)!=0)
c=1;
else
c=0;
a15=a15+c;
a16=a16<<1;
if ((a17>>31)!=0)
c=1;
else
c=0;
a16=a16+c;
a17=a17<<1;
if ((a18>>31)!=0)
c=1;
else
c=0;
a17=a17+c;
a18=a18<<1;
if ((a19>>31)!=0)
c=1;
else
c=0;
a18=a18+c;
a19=a19<<1;
if ((a20>>31)!=0)
c=1;
else
c=0;
a19=a19+c;
a20=a20<<1;
if ((a21>>31)!=0)
c=1;
else
c=0;
a20=a20+c;
a21=a21<<1;
if ((a22>>31)!=0)
c=1;
else
c=0;
a21=a21+c;
a22=a22<<1;
if ((a23>>31)!=0)
c=1;
else
c=0;
a22=a22+c;
a23=a23<<1;
if ((a24>>31)!=0)
c=1;
else
c=0;
a23=a23+c;
a24=a24<<1;
if ((a25>>31)!=0)
c=1;
else
c=0;
a24=a24+c;
a25=a25<<1;
if ((a26>>31)!=0)
c=1;
else
c=0;
a25=a25+c;
a26=a26<<1;
if ((a27>>31)!=0)
c=1;
else
c=0;
a26=a26+c;
a27=a27<<1;
if ((a28>>31)!=0)
c=1;
else
c=0;
a27=a27+c;
a28=a28<<1;
if ((a29>>31)!=0)
c=1;
else
c=0;
a28=a28+c;
a29=a29<<1;
if ((a30>>31)!=0)
c=1;
else
c=0;
a29=a29+c;
a30=a30<<1;
if ((a31>>31)!=0)
c=1;
else
c=0;
a30=a30+c;
a31=a31<<1;
}
}
shift=shift-1;
if (flag==31) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=0;
a26=0;
a27=0;
a28=0;
a29=0;
a30=0;
a31=a31<<shift;
a31=a31>>shift;
} else
if (flag==30) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=0;
a26=0;
a27=0;
a28=0;
a29=0;
a30=a30<<shift;
a30=a30>>shift;
} else
if (flag==29) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=0;
a26=0;
a27=0;
a28=0;
a29=a29<<shift;
a29=a29>>shift;
} else
if (flag==28) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=0;
a26=0;
a27=0;
a28=a28<<shift;
a28=a28>>shift;
} else
if (flag==27) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=0;
a26=0;
a27=a27<<shift;
a27=a27>>shift;
} else
if (flag==26) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=0;
a26=a26<<shift;
a26=a26>>shift;
} else
if (flag==25) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=0;
a25=a25<<shift;
a25=a25>>shift;
} else
if (flag==24) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=0;
a24=a24<<shift;
a24=a24>>shift;
} else
if (flag==23) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=0;
a23=a23<<shift;
a23=a23>>shift;
} else
if (flag==22) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=0;
a22=a22<<shift;
a22=a22>>shift;
} else
if (flag==21) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=0;
a21=a21<<shift;
a21=a21>>shift;
} else
if (flag==20) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=0;
a20=a20<<shift;
a20=a20>>shift;
} else
if (flag==19) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=0;
a19=a19<<shift;
a19=a19>>shift;
} else
if (flag==18) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=0;
a18=a18<<shift;
a18=a18>>shift;
} else
if (flag==17) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=0;
a17=a17<<shift;
a17=a17>>shift;
} else
if (flag==16) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=0;
a16=a16<<shift;
a16=a16>>shift;
} else
if (flag==15) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=0;
a15=a15<<shift;
a15=a15>>shift;
} else
if (flag==14) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=0;
a14=a14<<shift;
a14=a14>>shift;
} else
if (flag==13) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=0;
a13=a13<<shift;
a13=a13>>shift;
} else
if (flag==12) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=0;
a12=a12<<shift;
a12=a12>>shift;
} else
if (flag==11) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=0;
a11=a11<<shift;
a11=a11>>shift;
} else
if (flag==10) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=0;
a10=a10<<shift;
a10=a10>>shift;
} else
if (flag==9) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=0;
a9=a9<<shift;
a9=a9>>shift;
} else
if (flag==8) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=0;
a8=a8<<shift;
a8=a8>>shift;
} else
if (flag==7) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=0;
a7=a7<<shift;
a7=a7>>shift;
} else
if (flag==6) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=0;
a6=a6<<shift;
a6=a6>>shift;
} else
if (flag==5) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=0;
a5=a5<<shift;
a5=a5>>shift;
} else
if (flag==4) {
a0=0;
a1=0;
a2=0;
a3=0;
a4=a4<<shift;
a4=a4>>shift;
} else
if (flag==3) {
a0=0;
a1=0;
a2=0;
a3=a3<<shift;
a3=a3>>shift;
}
else {
if (flag==2) {
a0=0;
a1=0;
a2=a2<<shift;
a2=a2>>shift;
}
else {
if (flag==1) {
a0=0;
a1=a1<<shift;
a1=a1>>shift;
}
else {
a0=a0<<shift;
a0=a0>>shift;
}
}
}
*quotient=a0;
*(quotient+1)=a1;
*(quotient+2)=a2;
*(quotient+3)=a3;
*(quotient+4)=a4;
*(quotient+5)=a5;
*(quotient+6)=a6;
*(quotient+7)=a7;
*(quotient+8)=a8;
*(quotient+9)=a9;
*(quotient+10)=a10;
*(quotient+11)=a11;
*(quotient+12)=a12;
*(quotient+13)=a13;
*(quotient+14)=a14;
*(quotient+15)=a15;
*(quotient+16)=a16;
*(quotient+17)=a17;
*(quotient+18)=a18;
*(quotient+19)=a19;
*(quotient+20)=a20;
*(quotient+21)=a21;
*(quotient+22)=a22;
*(quotient+23)=a23;
*(quotient+24)=a24;
*(quotient+25)=a25;
*(quotient+26)=a26;
*(quotient+27)=a27;
*(quotient+28)=a28;
*(quotient+29)=a29;
*(quotient+30)=a30;
*(quotient+31)=a31;
return;
}