Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 39.51 KB | None | 0 0
  1. $func = function ($n) {
  2. if (count($n) > 68) {
  3. $lhs = new phpseclib\Math\BigInteger\Engines\PHP64();
  4. $rhs = new phpseclib\Math\BigInteger\Engines\PHP64();
  5. $lhs->value = $n;
  6. $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];
  7. list(, $temp) = $lhs->divide($rhs);
  8. return $temp->value;
  9. }
  10.  
  11. $lsd = array_slice($n, 0, 51);
  12. $msd = array_slice($n, 51);
  13. for ($i = count($msd) - 1; $i >= 0; --$i) {
  14. if ($msd[$i]) {
  15. break;
  16. }
  17. unset($msd[$i]);
  18. }
  19. $length = count($msd);
  20. if (!$length) {
  21. $temp = [];
  22. }else{
  23. $temp = array_fill(0, $length + 34, 0);
  24. $carry = 0;
  25. $subtemp = $msd[0] * 1961628378;$carry = $subtemp >> 31;$temp[0] = $subtemp - 2147483648 * $carry;
  26. $subtemp = $msd[0] * 1225269599 + $carry;$carry = $subtemp >> 31;$temp[1] = $subtemp - 2147483648 * $carry;
  27. $subtemp = $msd[0] * 1886773111 + $carry;$carry = $subtemp >> 31;$temp[2] = $subtemp - 2147483648 * $carry;
  28. $subtemp = $msd[0] * 262878578 + $carry;$carry = $subtemp >> 31;$temp[3] = $subtemp - 2147483648 * $carry;
  29. $subtemp = $msd[0] * 1019643823 + $carry;$carry = $subtemp >> 31;$temp[4] = $subtemp - 2147483648 * $carry;
  30. $subtemp = $msd[0] * 390506182 + $carry;$carry = $subtemp >> 31;$temp[5] = $subtemp - 2147483648 * $carry;
  31. $subtemp = $msd[0] * 512328063 + $carry;$carry = $subtemp >> 31;$temp[6] = $subtemp - 2147483648 * $carry;
  32. $subtemp = $msd[0] * 1643370050 + $carry;$carry = $subtemp >> 31;$temp[7] = $subtemp - 2147483648 * $carry;
  33. $subtemp = $msd[0] * 549395608 + $carry;$carry = $subtemp >> 31;$temp[8] = $subtemp - 2147483648 * $carry;
  34. $subtemp = $msd[0] * 869630770 + $carry;$carry = $subtemp >> 31;$temp[9] = $subtemp - 2147483648 * $carry;
  35. $subtemp = $msd[0] * 995051263 + $carry;$carry = $subtemp >> 31;$temp[10] = $subtemp - 2147483648 * $carry;
  36. $subtemp = $msd[0] * 709550821 + $carry;$carry = $subtemp >> 31;$temp[11] = $subtemp - 2147483648 * $carry;
  37. $subtemp = $msd[0] * 1451421517 + $carry;$carry = $subtemp >> 31;$temp[12] = $subtemp - 2147483648 * $carry;
  38. $subtemp = $msd[0] * 229714673 + $carry;$carry = $subtemp >> 31;$temp[13] = $subtemp - 2147483648 * $carry;
  39. $subtemp = $msd[0] * 788366909 + $carry;$carry = $subtemp >> 31;$temp[14] = $subtemp - 2147483648 * $carry;
  40. $subtemp = $msd[0] * 736572995 + $carry;$carry = $subtemp >> 31;$temp[15] = $subtemp - 2147483648 * $carry;
  41. $subtemp = $msd[0] * 611429679 + $carry;$carry = $subtemp >> 31;$temp[16] = $subtemp - 2147483648 * $carry;
  42. $subtemp = $msd[0] * 438414905 + $carry;$carry = $subtemp >> 31;$temp[17] = $subtemp - 2147483648 * $carry;
  43. $subtemp = $msd[0] * 660741153 + $carry;$carry = $subtemp >> 31;$temp[18] = $subtemp - 2147483648 * $carry;
  44. $subtemp = $msd[0] * 746718725 + $carry;$carry = $subtemp >> 31;$temp[19] = $subtemp - 2147483648 * $carry;
  45. $subtemp = $msd[0] * 241019924 + $carry;$carry = $subtemp >> 31;$temp[20] = $subtemp - 2147483648 * $carry;
  46. $subtemp = $msd[0] * 1690780066 + $carry;$carry = $subtemp >> 31;$temp[21] = $subtemp - 2147483648 * $carry;
  47. $subtemp = $msd[0] * 739041667 + $carry;$carry = $subtemp >> 31;$temp[22] = $subtemp - 2147483648 * $carry;
  48. $subtemp = $msd[0] * 96239852 + $carry;$carry = $subtemp >> 31;$temp[23] = $subtemp - 2147483648 * $carry;
  49. $subtemp = $msd[0] * 931872350 + $carry;$carry = $subtemp >> 31;$temp[24] = $subtemp - 2147483648 * $carry;
  50. $subtemp = $msd[0] * 563539653 + $carry;$carry = $subtemp >> 31;$temp[25] = $subtemp - 2147483648 * $carry;
  51. $subtemp = $msd[0] * 1296940011 + $carry;$carry = $subtemp >> 31;$temp[26] = $subtemp - 2147483648 * $carry;
  52. $subtemp = $msd[0] * 1653466991 + $carry;$carry = $subtemp >> 31;$temp[27] = $subtemp - 2147483648 * $carry;
  53. $subtemp = $msd[0] * 1923158363 + $carry;$carry = $subtemp >> 31;$temp[28] = $subtemp - 2147483648 * $carry;
  54. $subtemp = $msd[0] * 1119279087 + $carry;$carry = $subtemp >> 31;$temp[29] = $subtemp - 2147483648 * $carry;
  55. $subtemp = $msd[0] * 599366276 + $carry;$carry = $subtemp >> 31;$temp[30] = $subtemp - 2147483648 * $carry;
  56. $subtemp = $msd[0] * 1636825155 + $carry;$carry = $subtemp >> 31;$temp[31] = $subtemp - 2147483648 * $carry;
  57. $subtemp = $msd[0] * 65753270 + $carry;$carry = $subtemp >> 31;$temp[32] = $subtemp - 2147483648 * $carry;
  58. $subtemp = $msd[0] * 1 + $carry;$carry = $subtemp >> 31;$temp[33] = $subtemp - 2147483648 * $carry;$temp[34] = $carry;
  59. for ($i = 1; $i < $length; ++$i) {$k = $i;
  60. $subtemp = $temp[$k] + $msd[$i] * 1961628378;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  61. $subtemp = $temp[$k] + $msd[$i] * 1225269599 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  62. $subtemp = $temp[$k] + $msd[$i] * 1886773111 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  63. $subtemp = $temp[$k] + $msd[$i] * 262878578 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  64. $subtemp = $temp[$k] + $msd[$i] * 1019643823 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  65. $subtemp = $temp[$k] + $msd[$i] * 390506182 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  66. $subtemp = $temp[$k] + $msd[$i] * 512328063 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  67. $subtemp = $temp[$k] + $msd[$i] * 1643370050 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  68. $subtemp = $temp[$k] + $msd[$i] * 549395608 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  69. $subtemp = $temp[$k] + $msd[$i] * 869630770 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  70. $subtemp = $temp[$k] + $msd[$i] * 995051263 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  71. $subtemp = $temp[$k] + $msd[$i] * 709550821 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  72. $subtemp = $temp[$k] + $msd[$i] * 1451421517 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  73. $subtemp = $temp[$k] + $msd[$i] * 229714673 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  74. $subtemp = $temp[$k] + $msd[$i] * 788366909 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  75. $subtemp = $temp[$k] + $msd[$i] * 736572995 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  76. $subtemp = $temp[$k] + $msd[$i] * 611429679 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  77. $subtemp = $temp[$k] + $msd[$i] * 438414905 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  78. $subtemp = $temp[$k] + $msd[$i] * 660741153 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  79. $subtemp = $temp[$k] + $msd[$i] * 746718725 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  80. $subtemp = $temp[$k] + $msd[$i] * 241019924 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  81. $subtemp = $temp[$k] + $msd[$i] * 1690780066 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  82. $subtemp = $temp[$k] + $msd[$i] * 739041667 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  83. $subtemp = $temp[$k] + $msd[$i] * 96239852 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  84. $subtemp = $temp[$k] + $msd[$i] * 931872350 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  85. $subtemp = $temp[$k] + $msd[$i] * 563539653 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  86. $subtemp = $temp[$k] + $msd[$i] * 1296940011 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  87. $subtemp = $temp[$k] + $msd[$i] * 1653466991 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  88. $subtemp = $temp[$k] + $msd[$i] * 1923158363 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  89. $subtemp = $temp[$k] + $msd[$i] * 1119279087 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  90. $subtemp = $temp[$k] + $msd[$i] * 599366276 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  91. $subtemp = $temp[$k] + $msd[$i] * 1636825155 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  92. $subtemp = $temp[$k] + $msd[$i] * 65753270 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$k++;
  93. $subtemp = $temp[$k] + $msd[$i] * 1 + $carry;$carry = $subtemp >> 31;$temp[$k] = $subtemp - 2147483648 * $carry;$temp[++$k] = $carry; $carry = 0;}}
  94. $length = max(count($lsd), count($temp));
  95. $n = array_pad($lsd, $length + 1, 0);
  96. $_temp = array_pad($temp, $length, 0);
  97. $carry = 0;
  98. for ($i = 0, $j = 1; $j < $length; $i+=2, $j+=2) {
  99. $sum = ($n[$j] + $_temp[$j]) * 2147483648
  100. + $n[$i] + $_temp[$i] +
  101. $carry;
  102. $carry = $sum >= 4611686018427387904;
  103. $sum = $carry ? $sum - 4611686018427387904 : $sum;$upper = $sum >> 31; $n[$i] = $sum - 2147483648 * $upper;
  104. $n[$j] = $upper;
  105. }
  106. if ($j == $length) {
  107. $sum = $n[$i] + $_temp[$i] + $carry;
  108. $carry = $sum >= 2147483648;
  109. $n[$i] = $carry ? $sum - 2147483648 : $sum;
  110. }
  111. if ($carry) {
  112. for (; $n[$i] == 2147483647; ++$i) {
  113. $n[$i] = 0;
  114. }
  115. ++$n[$i];
  116. }
  117. for ($i = count($n) - 1; $i >= 0; --$i) {
  118. if ($n[$i]) {
  119. break;
  120. }
  121. unset($n[$i]);
  122. }$temp = array_slice($n, 33);
  123. $length = count($temp);
  124. if (!$length) {
  125. $temp2 = [];
  126. }else{
  127. $temp2 = array_fill(0, $length + 18, 0);
  128. $carry = 0;
  129. $subtemp = $temp[0] * 136807402;$carry = $subtemp >> 31;$temp2[0] = $subtemp - 2147483648 * $carry;
  130. $subtemp = $temp[0] * 2085220265 + $carry;$carry = $subtemp >> 31;$temp2[1] = $subtemp - 2147483648 * $carry;
  131. $subtemp = $temp[0] * 243828363 + $carry;$carry = $subtemp >> 31;$temp2[2] = $subtemp - 2147483648 * $carry;
  132. $subtemp = $temp[0] * 1233330850 + $carry;$carry = $subtemp >> 31;$temp2[3] = $subtemp - 2147483648 * $carry;
  133. $subtemp = $temp[0] * 627789668 + $carry;$carry = $subtemp >> 31;$temp2[4] = $subtemp - 2147483648 * $carry;
  134. $subtemp = $temp[0] * 1170394820 + $carry;$carry = $subtemp >> 31;$temp2[5] = $subtemp - 2147483648 * $carry;
  135. $subtemp = $temp[0] * 507022096 + $carry;$carry = $subtemp >> 31;$temp2[6] = $subtemp - 2147483648 * $carry;
  136. $subtemp = $temp[0] * 1930100676 + $carry;$carry = $subtemp >> 31;$temp2[7] = $subtemp - 2147483648 * $carry;
  137. $subtemp = $temp[0] * 564882704 + $carry;$carry = $subtemp >> 31;$temp2[8] = $subtemp - 2147483648 * $carry;
  138. $subtemp = $temp[0] * 1130887738 + $carry;$carry = $subtemp >> 31;$temp2[9] = $subtemp - 2147483648 * $carry;
  139. $subtemp = $temp[0] * 885673170 + $carry;$carry = $subtemp >> 31;$temp2[10] = $subtemp - 2147483648 * $carry;
  140. $subtemp = $temp[0] * 1000184617 + $carry;$carry = $subtemp >> 31;$temp2[11] = $subtemp - 2147483648 * $carry;
  141. $subtemp = $temp[0] * 837836496 + $carry;$carry = $subtemp >> 31;$temp2[12] = $subtemp - 2147483648 * $carry;
  142. $subtemp = $temp[0] * 622749243 + $carry;$carry = $subtemp >> 31;$temp2[13] = $subtemp - 2147483648 * $carry;
  143. $subtemp = $temp[0] * 1946630547 + $carry;$carry = $subtemp >> 31;$temp2[14] = $subtemp - 2147483648 * $carry;
  144. $subtemp = $temp[0] * 751064138 + $carry;$carry = $subtemp >> 31;$temp2[15] = $subtemp - 2147483648 * $carry;
  145. $subtemp = $temp[0] * 761350993 + $carry;$carry = $subtemp >> 31;$temp2[16] = $subtemp - 2147483648 * $carry;
  146. $subtemp = $temp[0] * 1616012784 + $carry;$carry = $subtemp >> 31;$temp2[17] = $subtemp - 2147483648 * $carry;$temp2[18] = $carry;
  147. for ($i = 1; $i < $length; ++$i) {$k = $i;
  148. $subtemp = $temp2[$k] + $temp[$i] * 136807402;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  149. $subtemp = $temp2[$k] + $temp[$i] * 2085220265 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  150. $subtemp = $temp2[$k] + $temp[$i] * 243828363 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  151. $subtemp = $temp2[$k] + $temp[$i] * 1233330850 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  152. $subtemp = $temp2[$k] + $temp[$i] * 627789668 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  153. $subtemp = $temp2[$k] + $temp[$i] * 1170394820 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  154. $subtemp = $temp2[$k] + $temp[$i] * 507022096 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  155. $subtemp = $temp2[$k] + $temp[$i] * 1930100676 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  156. $subtemp = $temp2[$k] + $temp[$i] * 564882704 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  157. $subtemp = $temp2[$k] + $temp[$i] * 1130887738 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  158. $subtemp = $temp2[$k] + $temp[$i] * 885673170 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  159. $subtemp = $temp2[$k] + $temp[$i] * 1000184617 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  160. $subtemp = $temp2[$k] + $temp[$i] * 837836496 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  161. $subtemp = $temp2[$k] + $temp[$i] * 622749243 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  162. $subtemp = $temp2[$k] + $temp[$i] * 1946630547 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  163. $subtemp = $temp2[$k] + $temp[$i] * 751064138 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  164. $subtemp = $temp2[$k] + $temp[$i] * 761350993 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  165. $subtemp = $temp2[$k] + $temp[$i] * 1616012784 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$temp2[++$k] = $carry; $carry = 0;}}
  166. for ($i = count($temp2) - 1; $i >= 0; --$i) {
  167. if ($temp2[$i]) {
  168. break;
  169. }
  170. unset($temp2[$i]);
  171. }$temp = array_slice($temp2, 18);
  172. $length = count($temp);
  173. if (!$length) {
  174. $temp2 = [];
  175. }else{
  176. $temp2 = array_fill(0, $length + 34, 0);
  177. $carry = 0;
  178. $subtemp = $temp[0] * 1330518375;$carry = $subtemp >> 31;$temp2[0] = $subtemp - 2147483648 * $carry;
  179. $subtemp = $temp[0] * 1687097210 + $carry;$carry = $subtemp >> 31;$temp2[1] = $subtemp - 2147483648 * $carry;
  180. $subtemp = $temp[0] * 107790915 + $carry;$carry = $subtemp >> 31;$temp2[2] = $subtemp - 2147483648 * $carry;
  181. $subtemp = $temp[0] * 803773754 + $carry;$carry = $subtemp >> 31;$temp2[3] = $subtemp - 2147483648 * $carry;
  182. $subtemp = $temp[0] * 421426611 + $carry;$carry = $subtemp >> 31;$temp2[4] = $subtemp - 2147483648 * $carry;
  183. $subtemp = $temp[0] * 709350928 + $carry;$carry = $subtemp >> 31;$temp2[5] = $subtemp - 2147483648 * $carry;
  184. $subtemp = $temp[0] * 890140083 + $carry;$carry = $subtemp >> 31;$temp2[6] = $subtemp - 2147483648 * $carry;
  185. $subtemp = $temp[0] * 242061813 + $carry;$carry = $subtemp >> 31;$temp2[7] = $subtemp - 2147483648 * $carry;
  186. $subtemp = $temp[0] * 968576869 + $carry;$carry = $subtemp >> 31;$temp2[8] = $subtemp - 2147483648 * $carry;
  187. $subtemp = $temp[0] * 1026124511 + $carry;$carry = $subtemp >> 31;$temp2[9] = $subtemp - 2147483648 * $carry;
  188. $subtemp = $temp[0] * 2029957702 + $carry;$carry = $subtemp >> 31;$temp2[10] = $subtemp - 2147483648 * $carry;
  189. $subtemp = $temp[0] * 581823486 + $carry;$carry = $subtemp >> 31;$temp2[11] = $subtemp - 2147483648 * $carry;
  190. $subtemp = $temp[0] * 1091768858 + $carry;$carry = $subtemp >> 31;$temp2[12] = $subtemp - 2147483648 * $carry;
  191. $subtemp = $temp[0] * 680777292 + $carry;$carry = $subtemp >> 31;$temp2[13] = $subtemp - 2147483648 * $carry;
  192. $subtemp = $temp[0] * 1357714061 + $carry;$carry = $subtemp >> 31;$temp2[14] = $subtemp - 2147483648 * $carry;
  193. $subtemp = $temp[0] * 1845861056 + $carry;$carry = $subtemp >> 31;$temp2[15] = $subtemp - 2147483648 * $carry;
  194. $subtemp = $temp[0] * 1269739609 + $carry;$carry = $subtemp >> 31;$temp2[16] = $subtemp - 2147483648 * $carry;
  195. $subtemp = $temp[0] * 1903995181 + $carry;$carry = $subtemp >> 31;$temp2[17] = $subtemp - 2147483648 * $carry;
  196. $subtemp = $temp[0] * 2020025100 + $carry;$carry = $subtemp >> 31;$temp2[18] = $subtemp - 2147483648 * $carry;
  197. $subtemp = $temp[0] * 713237830 + $carry;$carry = $subtemp >> 31;$temp2[19] = $subtemp - 2147483648 * $carry;
  198. $subtemp = $temp[0] * 639921968 + $carry;$carry = $subtemp >> 31;$temp2[20] = $subtemp - 2147483648 * $carry;
  199. $subtemp = $temp[0] * 1029612856 + $carry;$carry = $subtemp >> 31;$temp2[21] = $subtemp - 2147483648 * $carry;
  200. $subtemp = $temp[0] * 1893753121 + $carry;$carry = $subtemp >> 31;$temp2[22] = $subtemp - 2147483648 * $carry;
  201. $subtemp = $temp[0] * 1261416015 + $carry;$carry = $subtemp >> 31;$temp2[23] = $subtemp - 2147483648 * $carry;
  202. $subtemp = $temp[0] * 189209560 + $carry;$carry = $subtemp >> 31;$temp2[24] = $subtemp - 2147483648 * $carry;
  203. $subtemp = $temp[0] * 1747580247 + $carry;$carry = $subtemp >> 31;$temp2[25] = $subtemp - 2147483648 * $carry;
  204. $subtemp = $temp[0] * 518119577 + $carry;$carry = $subtemp >> 31;$temp2[26] = $subtemp - 2147483648 * $carry;
  205. $subtemp = $temp[0] * 159731173 + $carry;$carry = $subtemp >> 31;$temp2[27] = $subtemp - 2147483648 * $carry;
  206. $subtemp = $temp[0] * 887379740 + $carry;$carry = $subtemp >> 31;$temp2[28] = $subtemp - 2147483648 * $carry;
  207. $subtemp = $temp[0] * 1895454060 + $carry;$carry = $subtemp >> 31;$temp2[29] = $subtemp - 2147483648 * $carry;
  208. $subtemp = $temp[0] * 1310090219 + $carry;$carry = $subtemp >> 31;$temp2[30] = $subtemp - 2147483648 * $carry;
  209. $subtemp = $temp[0] * 497577847 + $carry;$carry = $subtemp >> 31;$temp2[31] = $subtemp - 2147483648 * $carry;
  210. $subtemp = $temp[0] * 706259876 + $carry;$carry = $subtemp >> 31;$temp2[32] = $subtemp - 2147483648 * $carry;
  211. $subtemp = $temp[0] * 1 + $carry;$carry = $subtemp >> 31;$temp2[33] = $subtemp - 2147483648 * $carry;$temp2[34] = $carry;
  212. for ($i = 1; $i < $length; ++$i) {$k = $i;
  213. $subtemp = $temp2[$k] + $temp[$i] * 1330518375;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  214. $subtemp = $temp2[$k] + $temp[$i] * 1687097210 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  215. $subtemp = $temp2[$k] + $temp[$i] * 107790915 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  216. $subtemp = $temp2[$k] + $temp[$i] * 803773754 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  217. $subtemp = $temp2[$k] + $temp[$i] * 421426611 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  218. $subtemp = $temp2[$k] + $temp[$i] * 709350928 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  219. $subtemp = $temp2[$k] + $temp[$i] * 890140083 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  220. $subtemp = $temp2[$k] + $temp[$i] * 242061813 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  221. $subtemp = $temp2[$k] + $temp[$i] * 968576869 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  222. $subtemp = $temp2[$k] + $temp[$i] * 1026124511 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  223. $subtemp = $temp2[$k] + $temp[$i] * 2029957702 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  224. $subtemp = $temp2[$k] + $temp[$i] * 581823486 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  225. $subtemp = $temp2[$k] + $temp[$i] * 1091768858 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  226. $subtemp = $temp2[$k] + $temp[$i] * 680777292 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  227. $subtemp = $temp2[$k] + $temp[$i] * 1357714061 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  228. $subtemp = $temp2[$k] + $temp[$i] * 1845861056 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  229. $subtemp = $temp2[$k] + $temp[$i] * 1269739609 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  230. $subtemp = $temp2[$k] + $temp[$i] * 1903995181 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  231. $subtemp = $temp2[$k] + $temp[$i] * 2020025100 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  232. $subtemp = $temp2[$k] + $temp[$i] * 713237830 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  233. $subtemp = $temp2[$k] + $temp[$i] * 639921968 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  234. $subtemp = $temp2[$k] + $temp[$i] * 1029612856 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  235. $subtemp = $temp2[$k] + $temp[$i] * 1893753121 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  236. $subtemp = $temp2[$k] + $temp[$i] * 1261416015 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  237. $subtemp = $temp2[$k] + $temp[$i] * 189209560 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  238. $subtemp = $temp2[$k] + $temp[$i] * 1747580247 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  239. $subtemp = $temp2[$k] + $temp[$i] * 518119577 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  240. $subtemp = $temp2[$k] + $temp[$i] * 159731173 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  241. $subtemp = $temp2[$k] + $temp[$i] * 887379740 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  242. $subtemp = $temp2[$k] + $temp[$i] * 1895454060 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  243. $subtemp = $temp2[$k] + $temp[$i] * 1310090219 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  244. $subtemp = $temp2[$k] + $temp[$i] * 497577847 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  245. $subtemp = $temp2[$k] + $temp[$i] * 706259876 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$k++;
  246. $subtemp = $temp2[$k] + $temp[$i] * 1 + $carry;$carry = $subtemp >> 31;$temp2[$k] = $subtemp - 2147483648 * $carry;$temp2[++$k] = $carry; $carry = 0;}}
  247. for ($i = count($temp2) - 1; $i >= 0; --$i) {
  248. if ($temp2[$i]) {
  249. break;
  250. }
  251. unset($temp2[$i]);
  252. }
  253. $temp = $n;
  254. $carry = 0;
  255. $size = count($temp2);
  256. for ($i = 0, $j = 1; $j < $size; $i+= 2, $j+= 2) {
  257. $sum = ($n[$j] - $temp2[$j]) * 2147483648 + $n[$i]
  258. - $temp2[$i]
  259. - $carry;
  260. $carry = $sum < 0;
  261. if ($carry) {
  262. $sum+= 4611686018427387904;
  263. }
  264. $subtemp = $sum >> 31;$temp[$i] = $sum - 2147483648 * $subtemp;
  265. $temp[$j] = $subtemp;
  266. }
  267. if ($j == $size) {
  268. $sum = $n[$i] - $temp2[$i] - $carry;
  269. $carry = $sum < 0;
  270. $temp[$i] = $carry ? $sum + 2147483648 : $sum;
  271. ++$i;
  272. }
  273.  
  274. if ($carry) {
  275. for (; !$temp[$i]; ++$i) {
  276. $temp[$i] = 2147483647;
  277. }
  278. --$temp[$i];
  279. }
  280. for ($i = count($temp) - 1; $i >= 0; --$i) {
  281. if ($temp[$i]) {
  282. break;
  283. }
  284. unset($temp[$i]);
  285. }loop_5ba92a04757fa:
  286. $clength = count($temp);
  287. switch (true) {
  288. case $clength < 34:
  289. goto end_5ba92a04757fa;
  290. case $clength > 34:
  291. case $temp[33] > 1:
  292. goto subcode_5ba92a04757fa;
  293. case $temp[33] < 1:
  294. goto end_5ba92a04757fa;
  295. case $temp[32] > 706259876:
  296. goto subcode_5ba92a04757fa;
  297. case $temp[32] < 706259876:
  298. goto end_5ba92a04757fa;
  299. case $temp[31] > 497577847:
  300. goto subcode_5ba92a04757fa;
  301. case $temp[31] < 497577847:
  302. goto end_5ba92a04757fa;
  303. case $temp[30] > 1310090219:
  304. goto subcode_5ba92a04757fa;
  305. case $temp[30] < 1310090219:
  306. goto end_5ba92a04757fa;
  307. case $temp[29] > 1895454060:
  308. goto subcode_5ba92a04757fa;
  309. case $temp[29] < 1895454060:
  310. goto end_5ba92a04757fa;
  311. case $temp[28] > 887379740:
  312. goto subcode_5ba92a04757fa;
  313. case $temp[28] < 887379740:
  314. goto end_5ba92a04757fa;
  315. case $temp[27] > 159731173:
  316. goto subcode_5ba92a04757fa;
  317. case $temp[27] < 159731173:
  318. goto end_5ba92a04757fa;
  319. case $temp[26] > 518119577:
  320. goto subcode_5ba92a04757fa;
  321. case $temp[26] < 518119577:
  322. goto end_5ba92a04757fa;
  323. case $temp[25] > 1747580247:
  324. goto subcode_5ba92a04757fa;
  325. case $temp[25] < 1747580247:
  326. goto end_5ba92a04757fa;
  327. case $temp[24] > 189209560:
  328. goto subcode_5ba92a04757fa;
  329. case $temp[24] < 189209560:
  330. goto end_5ba92a04757fa;
  331. case $temp[23] > 1261416015:
  332. goto subcode_5ba92a04757fa;
  333. case $temp[23] < 1261416015:
  334. goto end_5ba92a04757fa;
  335. case $temp[22] > 1893753121:
  336. goto subcode_5ba92a04757fa;
  337. case $temp[22] < 1893753121:
  338. goto end_5ba92a04757fa;
  339. case $temp[21] > 1029612856:
  340. goto subcode_5ba92a04757fa;
  341. case $temp[21] < 1029612856:
  342. goto end_5ba92a04757fa;
  343. case $temp[20] > 639921968:
  344. goto subcode_5ba92a04757fa;
  345. case $temp[20] < 639921968:
  346. goto end_5ba92a04757fa;
  347. case $temp[19] > 713237830:
  348. goto subcode_5ba92a04757fa;
  349. case $temp[19] < 713237830:
  350. goto end_5ba92a04757fa;
  351. case $temp[18] > 2020025100:
  352. goto subcode_5ba92a04757fa;
  353. case $temp[18] < 2020025100:
  354. goto end_5ba92a04757fa;
  355. case $temp[17] > 1903995181:
  356. goto subcode_5ba92a04757fa;
  357. case $temp[17] < 1903995181:
  358. goto end_5ba92a04757fa;
  359. case $temp[16] > 1269739609:
  360. goto subcode_5ba92a04757fa;
  361. case $temp[16] < 1269739609:
  362. goto end_5ba92a04757fa;
  363. case $temp[15] > 1845861056:
  364. goto subcode_5ba92a04757fa;
  365. case $temp[15] < 1845861056:
  366. goto end_5ba92a04757fa;
  367. case $temp[14] > 1357714061:
  368. goto subcode_5ba92a04757fa;
  369. case $temp[14] < 1357714061:
  370. goto end_5ba92a04757fa;
  371. case $temp[13] > 680777292:
  372. goto subcode_5ba92a04757fa;
  373. case $temp[13] < 680777292:
  374. goto end_5ba92a04757fa;
  375. case $temp[12] > 1091768858:
  376. goto subcode_5ba92a04757fa;
  377. case $temp[12] < 1091768858:
  378. goto end_5ba92a04757fa;
  379. case $temp[11] > 581823486:
  380. goto subcode_5ba92a04757fa;
  381. case $temp[11] < 581823486:
  382. goto end_5ba92a04757fa;
  383. case $temp[10] > 2029957702:
  384. goto subcode_5ba92a04757fa;
  385. case $temp[10] < 2029957702:
  386. goto end_5ba92a04757fa;
  387. case $temp[9] > 1026124511:
  388. goto subcode_5ba92a04757fa;
  389. case $temp[9] < 1026124511:
  390. goto end_5ba92a04757fa;
  391. case $temp[8] > 968576869:
  392. goto subcode_5ba92a04757fa;
  393. case $temp[8] < 968576869:
  394. goto end_5ba92a04757fa;
  395. case $temp[7] > 242061813:
  396. goto subcode_5ba92a04757fa;
  397. case $temp[7] < 242061813:
  398. goto end_5ba92a04757fa;
  399. case $temp[6] > 890140083:
  400. goto subcode_5ba92a04757fa;
  401. case $temp[6] < 890140083:
  402. goto end_5ba92a04757fa;
  403. case $temp[5] > 709350928:
  404. goto subcode_5ba92a04757fa;
  405. case $temp[5] < 709350928:
  406. goto end_5ba92a04757fa;
  407. case $temp[4] > 421426611:
  408. goto subcode_5ba92a04757fa;
  409. case $temp[4] < 421426611:
  410. goto end_5ba92a04757fa;
  411. case $temp[3] > 803773754:
  412. goto subcode_5ba92a04757fa;
  413. case $temp[3] < 803773754:
  414. goto end_5ba92a04757fa;
  415. case $temp[2] > 107790915:
  416. goto subcode_5ba92a04757fa;
  417. case $temp[2] < 107790915:
  418. goto end_5ba92a04757fa;
  419. case $temp[1] > 1687097210:
  420. goto subcode_5ba92a04757fa;
  421. case $temp[1] < 1687097210:
  422. goto end_5ba92a04757fa;
  423. case $temp[0] > 1330518375:
  424. goto subcode_5ba92a04757fa;
  425. case $temp[0] < 1330518375:
  426. goto end_5ba92a04757fa;
  427. default:
  428. // do subcode
  429. }
  430.  
  431. subcode_5ba92a04757fa:$temp2 = $temp;$sum = $temp[1] * 2147483648 + $temp[0] - 3623013672391940455;
  432. if ($carry = $sum < 0) {
  433. $sum+= 4611686018427387904;
  434. }
  435. $subtemp = $sum >> 31;
  436. $temp2[0] = $sum - 2147483648 * $subtemp;
  437. $temp2[1] = $subtemp;$sum = $temp[3] * 2147483648 + $temp[2] - 1726090993514365507 - $carry;
  438. if ($carry = $sum < 0) {
  439. $sum+= 4611686018427387904;
  440. }
  441. $subtemp = $sum >> 31;
  442. $temp2[2] = $sum - 2147483648 * $subtemp;
  443. $temp2[3] = $subtemp;$sum = $temp[5] * 2147483648 + $temp[4] - 1523319518995051955 - $carry;
  444. if ($carry = $sum < 0) {
  445. $sum+= 4611686018427387904;
  446. }
  447. $subtemp = $sum >> 31;
  448. $temp2[4] = $sum - 2147483648 * $subtemp;
  449. $temp2[5] = $subtemp;$sum = $temp[7] * 2147483648 + $temp[6] - 519823786112873907 - $carry;
  450. if ($carry = $sum < 0) {
  451. $sum+= 4611686018427387904;
  452. }
  453. $subtemp = $sum >> 31;
  454. $temp2[6] = $sum - 2147483648 * $subtemp;
  455. $temp2[7] = $subtemp;$sum = $temp[9] * 2147483648 + $temp[8] - 2203585609153072997 - $carry;
  456. if ($carry = $sum < 0) {
  457. $sum+= 4611686018427387904;
  458. }
  459. $subtemp = $sum >> 31;
  460. $temp2[8] = $sum - 2147483648 * $subtemp;
  461. $temp2[9] = $subtemp;$sum = $temp[11] * 2147483648 + $temp[10] - 1249456424237314630 - $carry;
  462. if ($carry = $sum < 0) {
  463. $sum+= 4611686018427387904;
  464. }
  465. $subtemp = $sum >> 31;
  466. $temp2[10] = $sum - 2147483648 * $subtemp;
  467. $temp2[11] = $subtemp;$sum = $temp[13] * 2147483648 + $temp[12] - 1461958103591490074 - $carry;
  468. if ($carry = $sum < 0) {
  469. $sum+= 4611686018427387904;
  470. }
  471. $subtemp = $sum >> 31;
  472. $temp2[12] = $sum - 2147483648 * $subtemp;
  473. $temp2[13] = $subtemp;$sum = $temp[15] * 2147483648 + $temp[14] - 3963956435597726349 - $carry;
  474. if ($carry = $sum < 0) {
  475. $sum+= 4611686018427387904;
  476. }
  477. $subtemp = $sum >> 31;
  478. $temp2[14] = $sum - 2147483648 * $subtemp;
  479. $temp2[15] = $subtemp;$sum = $temp[17] * 2147483648 + $temp[16] - 4088798518338039897 - $carry;
  480. if ($carry = $sum < 0) {
  481. $sum+= 4611686018427387904;
  482. }
  483. $subtemp = $sum >> 31;
  484. $temp2[16] = $sum - 2147483648 * $subtemp;
  485. $temp2[17] = $subtemp;$sum = $temp[19] * 2147483648 + $temp[18] - 1531666579080028940 - $carry;
  486. if ($carry = $sum < 0) {
  487. $sum+= 4611686018427387904;
  488. }
  489. $subtemp = $sum >> 31;
  490. $temp2[18] = $sum - 2147483648 * $subtemp;
  491. $temp2[19] = $subtemp;$sum = $temp[21] * 2147483648 + $temp[20] - 2211076772670500656 - $carry;
  492. if ($carry = $sum < 0) {
  493. $sum+= 4611686018427387904;
  494. }
  495. $subtemp = $sum >> 31;
  496. $temp2[20] = $sum - 2147483648 * $subtemp;
  497. $temp2[21] = $subtemp;$sum = $temp[23] * 2147483648 + $temp[22] - 2708870267431575841 - $carry;
  498. if ($carry = $sum < 0) {
  499. $sum+= 4611686018427387904;
  500. }
  501. $subtemp = $sum >> 31;
  502. $temp2[22] = $sum - 2147483648 * $subtemp;
  503. $temp2[23] = $subtemp;$sum = $temp[25] * 2147483648 + $temp[24] - 3752900004189510616 - $carry;
  504. if ($carry = $sum < 0) {
  505. $sum+= 4611686018427387904;
  506. }
  507. $subtemp = $sum >> 31;
  508. $temp2[24] = $sum - 2147483648 * $subtemp;
  509. $temp2[25] = $subtemp;$sum = $temp[27] * 2147483648 + $temp[26] - 343020082611478681 - $carry;
  510. if ($carry = $sum < 0) {
  511. $sum+= 4611686018427387904;
  512. }
  513. $subtemp = $sum >> 31;
  514. $temp2[26] = $sum - 2147483648 * $subtemp;
  515. $temp2[27] = $subtemp;$sum = $temp[29] * 2147483648 + $temp[28] - 4070456600272590620 - $carry;
  516. if ($carry = $sum < 0) {
  517. $sum+= 4611686018427387904;
  518. }
  519. $subtemp = $sum >> 31;
  520. $temp2[28] = $sum - 2147483648 * $subtemp;
  521. $temp2[29] = $subtemp;$sum = $temp[31] * 2147483648 + $temp[30] - 1068540291349636075 - $carry;
  522. if ($carry = $sum < 0) {
  523. $sum+= 4611686018427387904;
  524. }
  525. $subtemp = $sum >> 31;
  526. $temp2[30] = $sum - 2147483648 * $subtemp;
  527. $temp2[31] = $subtemp;$sum = $temp[33] * 2147483648 + $temp[32] - 2853743524 - $carry;
  528. if ($carry = $sum < 0) {
  529. $sum+= 4611686018427387904;
  530. }
  531. $subtemp = $sum >> 31;
  532. $temp2[32] = $sum - 2147483648 * $subtemp;
  533. $temp2[33] = $subtemp;$i = 34;
  534. if ($carry) {
  535. for (; !$temp2[$i]; ++$i) {
  536. $temp2[$i] = 2147483647;
  537. }
  538. --$temp2[$i];
  539. }
  540. for ($i = count($temp2) - 1; $i >= 0; --$i) {
  541. if ($temp2[$i]) {
  542. break;
  543. }
  544. unset($temp2[$i]);
  545. }$temp = $temp2;
  546. goto loop_5ba92a04757fa;
  547.  
  548. end_5ba92a04757fa:return $temp;};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement