rng.evm 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. .code:
  2. PUSH 60 contract rng {...
  3. PUSH 40 contract rng {...
  4. MSTORE contract rng {...
  5. PUSH [tag3] test()
  6. PUSH 0 uint
  7. PUSH 3 3
  8. PUSH 5 5
  9. PUSH 7 7
  10. PUSH B 11
  11. DUP5 uint
  12. tag6:
  13. JUMPDEST for (int i = 0; i < 1000000; ++i) {...
  14. PUSH F4240 1000000
  15. DUP2 i
  16. SLT i < 1000000
  17. ISZERO for (int i = 0; i < 1000000; ++i) {...
  18. PUSH [tag7] for (int i = 0; i < 1000000; ++i) {...
  19. JUMPI for (int i = 0; i < 1000000; ++i) {...
  20. PUSH 243F6A8885A308D3 0x243F6A8885A308D3
  21. SWAP5 0x243F6A8885A308D3 * rand1
  22. SWAP1 0x243F6A8885A308D3 * rand1
  23. SWAP5 0x243F6A8885A308D3 * rand1
  24. MUL 0x243F6A8885A308D3 * rand1
  25. PUSH 13198A2E03707344 0x13198A2E03707344
  26. ADD 0x243F6A8885A308D3 * rand1 + 0x13198A2E03707344
  27. SWAP4 0x243F6A8885A308D3 * rand1 + 0x13198A2E03707344
  28. PUSH A4093822299F31D0 0xA4093822299F31D0
  29. SWAP4 0xA4093822299F31D0 * rand2
  30. SWAP1 0xA4093822299F31D0 * rand2
  31. SWAP4 0xA4093822299F31D0 * rand2
  32. MUL 0xA4093822299F31D0 * rand2
  33. PUSH 82EFA98EC4E6C89 0x082EFA98EC4E6C89
  34. ADD 0xA4093822299F31D0 * rand2 + 0x082EFA98EC4E6C89
  35. SWAP3 0xA4093822299F31D0 * rand2 + 0x082EFA98EC4E6C89
  36. PUSH 452821E638D01377 0x452821E638D01377
  37. SWAP3 0x452821E638D01377 * rand3
  38. SWAP1 0x452821E638D01377 * rand3
  39. SWAP3 0x452821E638D01377 * rand3
  40. MUL 0x452821E638D01377 * rand3
  41. PUSH BE5466CF34E90C6C 0xBE5466CF34E90C6C
  42. ADD 0x452821E638D01377 * rand3 + 0xBE5466CF34E90C6C
  43. SWAP2 0x452821E638D01377 * rand3 + 0xBE5466CF34E90C6C
  44. PUSH C0AC29B7C97C50DD 0xC0AC29B7C97C50DD
  45. DUP4 0xC0AC29B7C97C50DD * rand3
  46. MUL 0xC0AC29B7C97C50DD * rand3
  47. PUSH 3F84D5B5B5470917 0x3F84D5B5B5470917
  48. ADD 0xC0AC29B7C97C50DD * rand3 + 0x3F84D5B5B5470917
  49. SWAP2 0xC0AC29B7C97C50DD * rand3 + 0x3F84D5B5B5470917
  50. POP
  51. PUSH 1 i < 1000000
  52. ADD ++i
  53. PUSH [tag6] for (int i = 0; i < 1000000; ++i) {...
  54. JUMP for (int i = 0; i < 1000000; ++i) {...
  55. tag3:
  56. JUMPDEST test()
  57. PUSH 0 uint
  58. SSTORE rand = test()
  59. PUSH #[$00000000…00000000] contract rng {...
  60. DUP1 contract rng {...
  61. PUSH [$00000000…00000000] contract rng {...
  62. PUSH 0 contract rng {...
  63. CODECOPY contract rng {...
  64. PUSH 0 contract rng {...
  65. RETURN contract rng {...
  66. tag7:
  67. JUMPDEST for (int i = 0; i < 1000000; ++i) {...
  68. POP
  69. SWAP2 rand1 ^ rand2
  70. SWAP1 rand1 ^ rand2
  71. SWAP3 rand1 ^ rand2
  72. XOR rand1 ^ rand2
  73. SWAP1 rand1 ^ rand2 ^ rand3
  74. SWAP2 rand1 ^ rand2 ^ rand3
  75. XOR rand1 ^ rand2 ^ rand3
  76. XOR rand1 ^ rand2 ^ rand3 ^ rand4
  77. SWAP2 rand1 ^ rand2 ^ rand3 ^ rand4
  78. SWAP1 test()
  79. POP
  80. JUMP [out] function test() returns (uint) {...
  81. .data:
  82. 0:
  83. .code:
  84. PUSH 60 contract rng {...
  85. PUSH 40 contract rng {...
  86. MSTORE contract rng {...
  87. PUSH E0
  88. PUSH 2
  89. EXP
  90. PUSH 0 contract rng {...
  91. CALLDATALOAD contract rng {...
  92. DIV contract rng {...
  93. PUSH F8A8FD6D contract rng {...
  94. DUP2 contract rng {...
  95. EQ contract rng {...
  96. PUSH [tag2] contract rng {...
  97. JUMPI contract rng {...
  98. tag1:
  99. JUMPDEST contract rng {...
  100. STOP contract rng {...
  101. tag2:
  102. JUMPDEST function test() returns (uint) {...
  103. PUSH [tag3] function test() returns (uint) {...
  104. PUSH 0 contract rng {...
  105. PUSH 3 3
  106. PUSH 5 5
  107. PUSH 7 7
  108. PUSH B 11
  109. DUP5 contract rng {...
  110. tag6:
  111. JUMPDEST for (int i = 0; i < 1000000; ++i) {...
  112. PUSH F4240 1000000
  113. DUP2 i
  114. SLT i < 1000000
  115. ISZERO for (int i = 0; i < 1000000; ++i) {...
  116. PUSH [tag7] for (int i = 0; i < 1000000; ++i) {...
  117. JUMPI for (int i = 0; i < 1000000; ++i) {...
  118. PUSH 243F6A8885A308D3 0x243F6A8885A308D3
  119. SWAP5 0x243F6A8885A308D3 * rand1
  120. SWAP1 0x243F6A8885A308D3 * rand1
  121. SWAP5 0x243F6A8885A308D3 * rand1
  122. MUL 0x243F6A8885A308D3 * rand1
  123. PUSH 13198A2E03707344 0x13198A2E03707344
  124. ADD 0x243F6A8885A308D3 * rand1 + 0x13198A2E03707344
  125. SWAP4 0x243F6A8885A308D3 * rand1 + 0x13198A2E03707344
  126. PUSH A4093822299F31D0 0xA4093822299F31D0
  127. SWAP4 0xA4093822299F31D0 * rand2
  128. SWAP1 0xA4093822299F31D0 * rand2
  129. SWAP4 0xA4093822299F31D0 * rand2
  130. MUL 0xA4093822299F31D0 * rand2
  131. PUSH 82EFA98EC4E6C89 0x082EFA98EC4E6C89
  132. ADD 0xA4093822299F31D0 * rand2 + 0x082EFA98EC4E6C89
  133. SWAP3 0xA4093822299F31D0 * rand2 + 0x082EFA98EC4E6C89
  134. PUSH 452821E638D01377 0x452821E638D01377
  135. SWAP3 0x452821E638D01377 * rand3
  136. SWAP1 0x452821E638D01377 * rand3
  137. SWAP3 0x452821E638D01377 * rand3
  138. MUL 0x452821E638D01377 * rand3
  139. PUSH BE5466CF34E90C6C 0xBE5466CF34E90C6C
  140. ADD 0x452821E638D01377 * rand3 + 0xBE5466CF34E90C6C
  141. SWAP2 0x452821E638D01377 * rand3 + 0xBE5466CF34E90C6C
  142. PUSH C0AC29B7C97C50DD 0xC0AC29B7C97C50DD
  143. DUP4 0xC0AC29B7C97C50DD * rand3
  144. MUL 0xC0AC29B7C97C50DD * rand3
  145. PUSH 3F84D5B5B5470917 0x3F84D5B5B5470917
  146. ADD 0xC0AC29B7C97C50DD * rand3 + 0x3F84D5B5B5470917
  147. SWAP2 0xC0AC29B7C97C50DD * rand3 + 0x3F84D5B5B5470917
  148. POP
  149. PUSH 1 i < 1000000
  150. ADD ++i
  151. PUSH [tag6] for (int i = 0; i < 1000000; ++i) {...
  152. JUMP for (int i = 0; i < 1000000; ++i) {...
  153. tag3:
  154. JUMPDEST function test() returns (uint) {...
  155. PUSH 60 contract rng {...
  156. SWAP1 function test() returns (uint) {...
  157. DUP2 function test() returns (uint) {...
  158. MSTORE function test() returns (uint) {...
  159. PUSH 20 function test() returns (uint) {...
  160. SWAP1 function test() returns (uint) {...
  161. RETURN function test() returns (uint) {...
  162. tag7:
  163. JUMPDEST for (int i = 0; i < 1000000; ++i) {...
  164. POP
  165. SWAP2 rand1 ^ rand2
  166. SWAP1 rand1 ^ rand2
  167. SWAP3 rand1 ^ rand2
  168. XOR rand1 ^ rand2
  169. SWAP1 rand1 ^ rand2 ^ rand3
  170. SWAP2 rand1 ^ rand2 ^ rand3
  171. XOR rand1 ^ rand2 ^ rand3
  172. XOR rand1 ^ rand2 ^ rand3 ^ rand4
  173. SWAP2 rand1 ^ rand2 ^ rand3 ^ rand4
  174. SWAP1 function test() returns (uint) {...
  175. POP
  176. JUMP [out] function test() returns (uint) {...