Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $func = function ($n) {
- if (count($n) > 68) {
- $lhs = new phpseclib\Math\BigInteger\Engines\PHP64();
- $rhs = new phpseclib\Math\BigInteger\Engines\PHP64();
- $lhs->value = $n;
- $rhs->value = [1330518375,1687097210,107790915,803773754,421426611,709350928,890140083,242061813,968576869,1026124511,2029957702,581823486,1091768858,680777292,1357714061,1845861056,1269739609,1903995181,2020025100,713237830,639921968,1029612856,1893753121,1261416015,189209560,1747580247,518119577,159731173,887379740,1895454060,1310090219,497577847,706259876,1];
- list(, $temp) = $lhs->divide($rhs);
- return $temp->value;
- }
- $lsd = array_slice($n, 0, 51);
- $msd = array_slice($n, 51);
- for ($i = count($msd) - 1; $i >= 0; --$i) {
- if ($msd[$i]) {
- break;
- }
- unset($msd[$i]);
- }
- $length = count($msd);
- if (!$length) {
- $temp = [];
- }else{
- $temp = array_fill(0, $length + 34, 0);
- $carry = 0;
- $subtemp = $msd[0] * 1961628378;$carry = $subtemp >> 31;$temp[0] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1225269599 + $carry;$carry = $subtemp >> 31;$temp[1] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1886773111 + $carry;$carry = $subtemp >> 31;$temp[2] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 262878578 + $carry;$carry = $subtemp >> 31;$temp[3] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1019643823 + $carry;$carry = $subtemp >> 31;$temp[4] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 390506182 + $carry;$carry = $subtemp >> 31;$temp[5] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 512328063 + $carry;$carry = $subtemp >> 31;$temp[6] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1643370050 + $carry;$carry = $subtemp >> 31;$temp[7] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 549395608 + $carry;$carry = $subtemp >> 31;$temp[8] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 869630770 + $carry;$carry = $subtemp >> 31;$temp[9] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 995051263 + $carry;$carry = $subtemp >> 31;$temp[10] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 709550821 + $carry;$carry = $subtemp >> 31;$temp[11] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1451421517 + $carry;$carry = $subtemp >> 31;$temp[12] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 229714673 + $carry;$carry = $subtemp >> 31;$temp[13] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 788366909 + $carry;$carry = $subtemp >> 31;$temp[14] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 736572995 + $carry;$carry = $subtemp >> 31;$temp[15] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 611429679 + $carry;$carry = $subtemp >> 31;$temp[16] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 438414905 + $carry;$carry = $subtemp >> 31;$temp[17] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 660741153 + $carry;$carry = $subtemp >> 31;$temp[18] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 746718725 + $carry;$carry = $subtemp >> 31;$temp[19] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 241019924 + $carry;$carry = $subtemp >> 31;$temp[20] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1690780066 + $carry;$carry = $subtemp >> 31;$temp[21] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 739041667 + $carry;$carry = $subtemp >> 31;$temp[22] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 96239852 + $carry;$carry = $subtemp >> 31;$temp[23] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 931872350 + $carry;$carry = $subtemp >> 31;$temp[24] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 563539653 + $carry;$carry = $subtemp >> 31;$temp[25] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1296940011 + $carry;$carry = $subtemp >> 31;$temp[26] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1653466991 + $carry;$carry = $subtemp >> 31;$temp[27] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1923158363 + $carry;$carry = $subtemp >> 31;$temp[28] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1119279087 + $carry;$carry = $subtemp >> 31;$temp[29] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 599366276 + $carry;$carry = $subtemp >> 31;$temp[30] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1636825155 + $carry;$carry = $subtemp >> 31;$temp[31] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 65753270 + $carry;$carry = $subtemp >> 31;$temp[32] = $subtemp - 2147483648 * $carry;
- $subtemp = $msd[0] * 1 + $carry;$carry = $subtemp >> 31;$temp[33] = $subtemp - 2147483648 * $carry;$temp[34] = $carry;
- for ($i = 1; $i < $length; ++$i) {$k = $i;
- $subtemp = $temp[$k] + $msd[$i] * 1961628378;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1225269599 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1886773111 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 262878578 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1019643823 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 390506182 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 512328063 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1643370050 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 549395608 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 869630770 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 995051263 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 709550821 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1451421517 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 229714673 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 788366909 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 736572995 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 611429679 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 438414905 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 660741153 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 746718725 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 241019924 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1690780066 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 739041667 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 96239852 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 931872350 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 563539653 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1296940011 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1653466991 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1923158363 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1119279087 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 599366276 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1636825155 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 65753270 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp[$k] + $msd[$i] * 1 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$temp[++$k] = $carry; $carry = 0;}}
- $length = max(count($lsd), count($temp));
- $n = array_pad($lsd, $length + 1, 0);
- $_temp = array_pad($temp, $length, 0);
- $carry = 0;
- for ($i = 0, $j = 1; $j < $length; $i+=2, $j+=2) {
- $sum = ($n[$j] + $_temp[$j]) * 2147483648
- + $n[$i] + $_temp[$i] +
- $carry;
- $carry = $sum >= 4611686018427387904;
- $sum = $carry ? $sum - 4611686018427387904 : $sum;$upper = $sum >> 31; $n[$i] = $sum - 2147483648 * $upper;
- $n[$j] = $upper;
- }
- if ($j == $length) {
- $sum = $n[$i] + $_temp[$i] + $carry;
- $carry = $sum >= 2147483648;
- $n[$i] = $carry ? $sum - 2147483648 : $sum;
- }
- if ($carry) {
- for (; $n[$i] == 2147483647; ++$i) {
- $n[$i] = 0;
- }
- ++$n[$i];
- }
- for ($i = count($n) - 1; $i >= 0; --$i) {
- if ($n[$i]) {
- break;
- }
- unset($n[$i]);
- }$temp = array_slice($n, 33);
- $length = count($temp);
- if (!$length) {
- $temp2 = [];
- }else{
- $temp2 = array_fill(0, $length + 18, 0);
- $carry = 0;
- $subtemp = $temp[0] * 136807402;$carry = $subtemp >> 31;$temp2[0] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 2085220265 + $carry;$carry = $subtemp >> 31;$temp2[1] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 243828363 + $carry;$carry = $subtemp >> 31;$temp2[2] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1233330850 + $carry;$carry = $subtemp >> 31;$temp2[3] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 627789668 + $carry;$carry = $subtemp >> 31;$temp2[4] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1170394820 + $carry;$carry = $subtemp >> 31;$temp2[5] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 507022096 + $carry;$carry = $subtemp >> 31;$temp2[6] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1930100676 + $carry;$carry = $subtemp >> 31;$temp2[7] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 564882704 + $carry;$carry = $subtemp >> 31;$temp2[8] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1130887738 + $carry;$carry = $subtemp >> 31;$temp2[9] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 885673170 + $carry;$carry = $subtemp >> 31;$temp2[10] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1000184617 + $carry;$carry = $subtemp >> 31;$temp2[11] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 837836496 + $carry;$carry = $subtemp >> 31;$temp2[12] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 622749243 + $carry;$carry = $subtemp >> 31;$temp2[13] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1946630547 + $carry;$carry = $subtemp >> 31;$temp2[14] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 751064138 + $carry;$carry = $subtemp >> 31;$temp2[15] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 761350993 + $carry;$carry = $subtemp >> 31;$temp2[16] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1616012784 + $carry;$carry = $subtemp >> 31;$temp2[17] = $subtemp - 2147483648 * $carry;$temp2[18] = $carry;
- for ($i = 1; $i < $length; ++$i) {$k = $i;
- $subtemp = $temp2[$k] + $temp[$i] * 136807402;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 2085220265 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 243828363 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1233330850 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 627789668 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1170394820 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 507022096 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1930100676 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 564882704 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1130887738 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 885673170 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1000184617 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 837836496 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 622749243 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1946630547 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 751064138 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 761350993 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1616012784 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$temp2[++$k] = $carry; $carry = 0;}}
- for ($i = count($temp2) - 1; $i >= 0; --$i) {
- if ($temp2[$i]) {
- break;
- }
- unset($temp2[$i]);
- }$temp = array_slice($temp2, 18);
- $length = count($temp);
- if (!$length) {
- $temp2 = [];
- }else{
- $temp2 = array_fill(0, $length + 34, 0);
- $carry = 0;
- $subtemp = $temp[0] * 1330518375;$carry = $subtemp >> 31;$temp2[0] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1687097210 + $carry;$carry = $subtemp >> 31;$temp2[1] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 107790915 + $carry;$carry = $subtemp >> 31;$temp2[2] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 803773754 + $carry;$carry = $subtemp >> 31;$temp2[3] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 421426611 + $carry;$carry = $subtemp >> 31;$temp2[4] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 709350928 + $carry;$carry = $subtemp >> 31;$temp2[5] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 890140083 + $carry;$carry = $subtemp >> 31;$temp2[6] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 242061813 + $carry;$carry = $subtemp >> 31;$temp2[7] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 968576869 + $carry;$carry = $subtemp >> 31;$temp2[8] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1026124511 + $carry;$carry = $subtemp >> 31;$temp2[9] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 2029957702 + $carry;$carry = $subtemp >> 31;$temp2[10] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 581823486 + $carry;$carry = $subtemp >> 31;$temp2[11] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1091768858 + $carry;$carry = $subtemp >> 31;$temp2[12] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 680777292 + $carry;$carry = $subtemp >> 31;$temp2[13] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1357714061 + $carry;$carry = $subtemp >> 31;$temp2[14] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1845861056 + $carry;$carry = $subtemp >> 31;$temp2[15] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1269739609 + $carry;$carry = $subtemp >> 31;$temp2[16] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1903995181 + $carry;$carry = $subtemp >> 31;$temp2[17] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 2020025100 + $carry;$carry = $subtemp >> 31;$temp2[18] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 713237830 + $carry;$carry = $subtemp >> 31;$temp2[19] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 639921968 + $carry;$carry = $subtemp >> 31;$temp2[20] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1029612856 + $carry;$carry = $subtemp >> 31;$temp2[21] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1893753121 + $carry;$carry = $subtemp >> 31;$temp2[22] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1261416015 + $carry;$carry = $subtemp >> 31;$temp2[23] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 189209560 + $carry;$carry = $subtemp >> 31;$temp2[24] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1747580247 + $carry;$carry = $subtemp >> 31;$temp2[25] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 518119577 + $carry;$carry = $subtemp >> 31;$temp2[26] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 159731173 + $carry;$carry = $subtemp >> 31;$temp2[27] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 887379740 + $carry;$carry = $subtemp >> 31;$temp2[28] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1895454060 + $carry;$carry = $subtemp >> 31;$temp2[29] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1310090219 + $carry;$carry = $subtemp >> 31;$temp2[30] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 497577847 + $carry;$carry = $subtemp >> 31;$temp2[31] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 706259876 + $carry;$carry = $subtemp >> 31;$temp2[32] = $subtemp - 2147483648 * $carry;
- $subtemp = $temp[0] * 1 + $carry;$carry = $subtemp >> 31;$temp2[33] = $subtemp - 2147483648 * $carry;$temp2[34] = $carry;
- for ($i = 1; $i < $length; ++$i) {$k = $i;
- $subtemp = $temp2[$k] + $temp[$i] * 1330518375;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1687097210 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 107790915 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 803773754 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 421426611 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 709350928 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 890140083 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 242061813 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 968576869 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1026124511 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 2029957702 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 581823486 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1091768858 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 680777292 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1357714061 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1845861056 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1269739609 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1903995181 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 2020025100 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 713237830 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 639921968 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1029612856 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1893753121 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1261416015 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 189209560 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1747580247 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 518119577 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 159731173 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 887379740 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1895454060 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1310090219 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 497577847 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 706259876 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
- $subtemp = $temp2[$k] + $temp[$i] * 1 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$temp2[++$k] = $carry; $carry = 0;}}
- for ($i = count($temp2) - 1; $i >= 0; --$i) {
- if ($temp2[$i]) {
- break;
- }
- unset($temp2[$i]);
- }
- $temp = $n;
- $carry = 0;
- $size = count($temp2);
- for ($i = 0, $j = 1; $j < $size; $i+= 2, $j+= 2) {
- $sum = ($n[$j] - $temp2[$j]) * 2147483648 + $n[$i]
- - $temp2[$i]
- - $carry;
- $carry = $sum < 0;
- if ($carry) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;$temp[$i] = $sum - 2147483648 * $subtemp;
- $temp[$j] = $subtemp;
- }
- if ($j == $size) {
- $sum = $n[$i] - $temp2[$i] - $carry;
- $carry = $sum < 0;
- $temp[$i] = $carry ? $sum + 2147483648 : $sum;
- ++$i;
- }
- if ($carry) {
- for (; !$temp[$i]; ++$i) {
- $temp[$i] = 2147483647;
- }
- --$temp[$i];
- }
- for ($i = count($temp) - 1; $i >= 0; --$i) {
- if ($temp[$i]) {
- break;
- }
- unset($temp[$i]);
- }loop_5ba92a04757fa:
- $clength = count($temp);
- switch (true) {
- case $clength < 34:
- goto end_5ba92a04757fa;
- case $clength > 34:
- case $temp[33] > 1:
- goto subcode_5ba92a04757fa;
- case $temp[33] < 1:
- goto end_5ba92a04757fa;
- case $temp[32] > 706259876:
- goto subcode_5ba92a04757fa;
- case $temp[32] < 706259876:
- goto end_5ba92a04757fa;
- case $temp[31] > 497577847:
- goto subcode_5ba92a04757fa;
- case $temp[31] < 497577847:
- goto end_5ba92a04757fa;
- case $temp[30] > 1310090219:
- goto subcode_5ba92a04757fa;
- case $temp[30] < 1310090219:
- goto end_5ba92a04757fa;
- case $temp[29] > 1895454060:
- goto subcode_5ba92a04757fa;
- case $temp[29] < 1895454060:
- goto end_5ba92a04757fa;
- case $temp[28] > 887379740:
- goto subcode_5ba92a04757fa;
- case $temp[28] < 887379740:
- goto end_5ba92a04757fa;
- case $temp[27] > 159731173:
- goto subcode_5ba92a04757fa;
- case $temp[27] < 159731173:
- goto end_5ba92a04757fa;
- case $temp[26] > 518119577:
- goto subcode_5ba92a04757fa;
- case $temp[26] < 518119577:
- goto end_5ba92a04757fa;
- case $temp[25] > 1747580247:
- goto subcode_5ba92a04757fa;
- case $temp[25] < 1747580247:
- goto end_5ba92a04757fa;
- case $temp[24] > 189209560:
- goto subcode_5ba92a04757fa;
- case $temp[24] < 189209560:
- goto end_5ba92a04757fa;
- case $temp[23] > 1261416015:
- goto subcode_5ba92a04757fa;
- case $temp[23] < 1261416015:
- goto end_5ba92a04757fa;
- case $temp[22] > 1893753121:
- goto subcode_5ba92a04757fa;
- case $temp[22] < 1893753121:
- goto end_5ba92a04757fa;
- case $temp[21] > 1029612856:
- goto subcode_5ba92a04757fa;
- case $temp[21] < 1029612856:
- goto end_5ba92a04757fa;
- case $temp[20] > 639921968:
- goto subcode_5ba92a04757fa;
- case $temp[20] < 639921968:
- goto end_5ba92a04757fa;
- case $temp[19] > 713237830:
- goto subcode_5ba92a04757fa;
- case $temp[19] < 713237830:
- goto end_5ba92a04757fa;
- case $temp[18] > 2020025100:
- goto subcode_5ba92a04757fa;
- case $temp[18] < 2020025100:
- goto end_5ba92a04757fa;
- case $temp[17] > 1903995181:
- goto subcode_5ba92a04757fa;
- case $temp[17] < 1903995181:
- goto end_5ba92a04757fa;
- case $temp[16] > 1269739609:
- goto subcode_5ba92a04757fa;
- case $temp[16] < 1269739609:
- goto end_5ba92a04757fa;
- case $temp[15] > 1845861056:
- goto subcode_5ba92a04757fa;
- case $temp[15] < 1845861056:
- goto end_5ba92a04757fa;
- case $temp[14] > 1357714061:
- goto subcode_5ba92a04757fa;
- case $temp[14] < 1357714061:
- goto end_5ba92a04757fa;
- case $temp[13] > 680777292:
- goto subcode_5ba92a04757fa;
- case $temp[13] < 680777292:
- goto end_5ba92a04757fa;
- case $temp[12] > 1091768858:
- goto subcode_5ba92a04757fa;
- case $temp[12] < 1091768858:
- goto end_5ba92a04757fa;
- case $temp[11] > 581823486:
- goto subcode_5ba92a04757fa;
- case $temp[11] < 581823486:
- goto end_5ba92a04757fa;
- case $temp[10] > 2029957702:
- goto subcode_5ba92a04757fa;
- case $temp[10] < 2029957702:
- goto end_5ba92a04757fa;
- case $temp[9] > 1026124511:
- goto subcode_5ba92a04757fa;
- case $temp[9] < 1026124511:
- goto end_5ba92a04757fa;
- case $temp[8] > 968576869:
- goto subcode_5ba92a04757fa;
- case $temp[8] < 968576869:
- goto end_5ba92a04757fa;
- case $temp[7] > 242061813:
- goto subcode_5ba92a04757fa;
- case $temp[7] < 242061813:
- goto end_5ba92a04757fa;
- case $temp[6] > 890140083:
- goto subcode_5ba92a04757fa;
- case $temp[6] < 890140083:
- goto end_5ba92a04757fa;
- case $temp[5] > 709350928:
- goto subcode_5ba92a04757fa;
- case $temp[5] < 709350928:
- goto end_5ba92a04757fa;
- case $temp[4] > 421426611:
- goto subcode_5ba92a04757fa;
- case $temp[4] < 421426611:
- goto end_5ba92a04757fa;
- case $temp[3] > 803773754:
- goto subcode_5ba92a04757fa;
- case $temp[3] < 803773754:
- goto end_5ba92a04757fa;
- case $temp[2] > 107790915:
- goto subcode_5ba92a04757fa;
- case $temp[2] < 107790915:
- goto end_5ba92a04757fa;
- case $temp[1] > 1687097210:
- goto subcode_5ba92a04757fa;
- case $temp[1] < 1687097210:
- goto end_5ba92a04757fa;
- case $temp[0] > 1330518375:
- goto subcode_5ba92a04757fa;
- case $temp[0] < 1330518375:
- goto end_5ba92a04757fa;
- default:
- // do subcode
- }
- subcode_5ba92a04757fa:$temp2 = $temp;$sum = $temp[1] * 2147483648 + $temp[0] - 3623013672391940455;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[0] = $sum - 2147483648 * $subtemp;
- $temp2[1] = $subtemp;$sum = $temp[3] * 2147483648 + $temp[2] - 1726090993514365507 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[2] = $sum - 2147483648 * $subtemp;
- $temp2[3] = $subtemp;$sum = $temp[5] * 2147483648 + $temp[4] - 1523319518995051955 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[4] = $sum - 2147483648 * $subtemp;
- $temp2[5] = $subtemp;$sum = $temp[7] * 2147483648 + $temp[6] - 519823786112873907 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[6] = $sum - 2147483648 * $subtemp;
- $temp2[7] = $subtemp;$sum = $temp[9] * 2147483648 + $temp[8] - 2203585609153072997 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[8] = $sum - 2147483648 * $subtemp;
- $temp2[9] = $subtemp;$sum = $temp[11] * 2147483648 + $temp[10] - 1249456424237314630 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[10] = $sum - 2147483648 * $subtemp;
- $temp2[11] = $subtemp;$sum = $temp[13] * 2147483648 + $temp[12] - 1461958103591490074 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[12] = $sum - 2147483648 * $subtemp;
- $temp2[13] = $subtemp;$sum = $temp[15] * 2147483648 + $temp[14] - 3963956435597726349 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[14] = $sum - 2147483648 * $subtemp;
- $temp2[15] = $subtemp;$sum = $temp[17] * 2147483648 + $temp[16] - 4088798518338039897 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[16] = $sum - 2147483648 * $subtemp;
- $temp2[17] = $subtemp;$sum = $temp[19] * 2147483648 + $temp[18] - 1531666579080028940 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[18] = $sum - 2147483648 * $subtemp;
- $temp2[19] = $subtemp;$sum = $temp[21] * 2147483648 + $temp[20] - 2211076772670500656 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[20] = $sum - 2147483648 * $subtemp;
- $temp2[21] = $subtemp;$sum = $temp[23] * 2147483648 + $temp[22] - 2708870267431575841 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[22] = $sum - 2147483648 * $subtemp;
- $temp2[23] = $subtemp;$sum = $temp[25] * 2147483648 + $temp[24] - 3752900004189510616 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[24] = $sum - 2147483648 * $subtemp;
- $temp2[25] = $subtemp;$sum = $temp[27] * 2147483648 + $temp[26] - 343020082611478681 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[26] = $sum - 2147483648 * $subtemp;
- $temp2[27] = $subtemp;$sum = $temp[29] * 2147483648 + $temp[28] - 4070456600272590620 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[28] = $sum - 2147483648 * $subtemp;
- $temp2[29] = $subtemp;$sum = $temp[31] * 2147483648 + $temp[30] - 1068540291349636075 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[30] = $sum - 2147483648 * $subtemp;
- $temp2[31] = $subtemp;$sum = $temp[33] * 2147483648 + $temp[32] - 2853743524 - $carry;
- if ($carry = $sum < 0) {
- $sum+= 4611686018427387904;
- }
- $subtemp = $sum >> 31;
- $temp2[32] = $sum - 2147483648 * $subtemp;
- $temp2[33] = $subtemp;$i = 34;
- if ($carry) {
- for (; !$temp2[$i]; ++$i) {
- $temp2[$i] = 2147483647;
- }
- --$temp2[$i];
- }
- for ($i = count($temp2) - 1; $i >= 0; --$i) {
- if ($temp2[$i]) {
- break;
- }
- unset($temp2[$i]);
- }$temp = $temp2;
- goto loop_5ba92a04757fa;
- end_5ba92a04757fa:return $temp;};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement