Tests for FunctionSpecializer

This commit is contained in:
hrkrshnn
2021-03-29 11:02:18 +02:00
parent 45a3747701
commit 09998ceb0c
23 changed files with 3923 additions and 424 deletions
+26 -47
View File
@@ -14,9 +14,17 @@ object "object" {
code {
function main()
{
let _1 := 0
mstore_internal(0:i32, _1, _1, _1, _1)
mstore_internal(32:i32, _1, _1, _1, 1)
let hi := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(0))), 32)
let y := i64.or(hi, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(0, 32)))))
i64.store(0:i32, y)
i64.store(i32.add(0:i32, 8:i32), y)
i64.store(i32.add(0:i32, 16:i32), y)
i64.store(i32.add(0:i32, 24:i32), y)
i64.store(32:i32, y)
i64.store(i32.add(32:i32, 8:i32), y)
i64.store(i32.add(32:i32, 16:i32), y)
let hi_1 := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(1))), 32)
i64.store(i32.add(32:i32, 24:i32), i64.or(hi_1, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(1, 32))))))
eth.storageStore(0:i32, 32:i32)
}
function bswap16(x:i32) -> y:i32
@@ -28,24 +36,12 @@ object "object" {
let hi:i32 := i32.shl(bswap16(x), 16:i32)
y := i32.or(hi, bswap16(i32.shr_u(x, 16:i32)))
}
function bswap64(x) -> y
{
let hi := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(x))), 32)
y := i64.or(hi, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(x, 32)))))
}
function mstore_internal(pos:i32, y1, y2, y3, y4)
{
i64.store(pos, bswap64(y1))
i64.store(i32.add(pos, 8:i32), bswap64(y2))
i64.store(i32.add(pos, 16:i32), bswap64(y3))
i64.store(i32.add(pos, 24:i32), bswap64(y4))
}
}
}
Binary representation:
0061736d01000000011b0560000060017e017e60017f017f60057f7e7e7e7e0060027f7f0002190108657468657265756d0c73746f7261676553746f7265000403060500020201030503010001060100071102066d656d6f72790200046d61696e00010ac001052901017e0240420021004100200020002000200010054120200020002000420110054100412010000b0b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100241107421022002200041107610027221010b20010b2201027e02402000a71003ad422086210220022000422088a71003ad8421010b20010b32000240200020011004370000200041086a20021004370000200041106a20031004370000200041186a200410043700000b0b
0061736d01000000010e0360000060017f017f60027f7f0002190108657468657265756d0c73746f7261676553746f726500020304030001010503010001060100071102066d656d6f72790200046d61696e00010ac70103850101037e02404200a71003ad422086210020004200422088a71003ad84210141002001370000410041086a2001370000410041106a2001370000410041186a200137000041202001370000412041086a2001370000412041106a20013700004201a71003ad4220862102412041186a20024201422088a71003ad843700004100412010000b0b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100241107421022002200041107610027221010b20010b
Text representation:
(module
@@ -54,11 +50,21 @@ Text representation:
(export "main" (func $main))
(func $main
(local $_1 i64)
(local $hi i64)
(local $y i64)
(local $hi_1 i64)
(block $label_
(local.set $_1 (i64.const 0))
(call $mstore_internal (i32.const 0) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))
(call $mstore_internal (i32.const 32) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 1))
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.const 0)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (i64.const 0) (i64.const 32)))))))
(i64.store (i32.const 0) (local.get $y))
(i64.store (i32.add (i32.const 0) (i32.const 8)) (local.get $y))
(i64.store (i32.add (i32.const 0) (i32.const 16)) (local.get $y))
(i64.store (i32.add (i32.const 0) (i32.const 24)) (local.get $y))
(i64.store (i32.const 32) (local.get $y))
(i64.store (i32.add (i32.const 32) (i32.const 8)) (local.get $y))
(i64.store (i32.add (i32.const 32) (i32.const 16)) (local.get $y))
(local.set $hi_1 (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.const 1)))) (i64.const 32)))
(i64.store (i32.add (i32.const 32) (i32.const 24)) (i64.or (local.get $hi_1) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (i64.const 1) (i64.const 32)))))))
(call $eth.storageStore (i32.const 0) (i32.const 32))
)
)
@@ -87,31 +93,4 @@ Text representation:
(local.get $y)
)
(func $bswap64
(param $x i64)
(result i64)
(local $y i64)
(local $hi i64)
(block $label__3
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (local.get $x)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (local.get $x) (i64.const 32)))))))
)
(local.get $y)
)
(func $mstore_internal
(param $pos i32)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__4
(i64.store (local.get $pos) (call $bswap64 (local.get $y1)))
(i64.store (i32.add (local.get $pos) (i32.const 8)) (call $bswap64 (local.get $y2)))
(i64.store (i32.add (local.get $pos) (i32.const 16)) (call $bswap64 (local.get $y3)))
(i64.store (i32.add (local.get $pos) (i32.const 24)) (call $bswap64 (local.get $y4)))
)
)
)
+235 -229
View File
@@ -24,68 +24,64 @@ object "object" {
code {
function main()
{
let _1 := 0
let x, x_1, x_2, x_3 := calldataload(_1, _1, _1, _1)
let x, x_1, x_2, x_3 := calldataload()
let x_4 := x
let x_5 := x_1
let x_6 := x_2
let x_7 := x_3
let _2 := 1
let _3:i32 := i32.eqz(i32.eqz(i64.eqz(i64.or(i64.or(_1, _1), i64.or(_1, _2)))))
let _1:i32 := i32.eqz(i32.eqz(i64.eqz(i64.or(i64.or(0, 0), i64.or(0, 1)))))
for { }
i32.eqz(_3)
i32.eqz(_1)
{
let x_8, x_9, x_10, x_11 := add(x_4, x_5, x_6, x_7, _1, _1, _1, _2)
let x_8, x_9, x_10, x_11 := add(x_4, x_5, x_6, x_7)
x_4 := x_8
x_5 := x_9
x_6 := x_10
x_7 := x_11
}
{
let _4, _5, _6, _7 := iszero_887(_1, _1, _1, lt(x_4, x_5, x_6, x_7, _1, _1, _1, 10))
if i32.eqz(i64.eqz(i64.or(i64.or(_4, _5), i64.or(_6, _7)))) { break }
let _8, _9, _10, _11 := eq_888(x_4, x_5, x_6, x_7, _1, _1, _1, 2)
if i32.eqz(i64.eqz(i64.or(i64.or(_8, _9), i64.or(_10, _11)))) { break }
let _12, _13, _14, _15 := eq_888(x_4, x_5, x_6, x_7, _1, _1, _1, 4)
if i32.eqz(i64.eqz(i64.or(i64.or(_12, _13), i64.or(_14, _15)))) { continue }
let _2, _3, _4, _5 := iszero_1300_2121(lt(x_4, x_5, x_6, x_7))
if i32.eqz(i64.eqz(i64.or(i64.or(_2, _3), i64.or(_4, _5)))) { break }
let _6, _7, _8, _9 := eq_740_2122(x_4, x_5, x_6, x_7)
if i32.eqz(i64.eqz(i64.or(i64.or(_6, _7), i64.or(_8, _9)))) { break }
let _10, _11, _12, _13 := eq_741_2123(x_4, x_5, x_6, x_7)
if i32.eqz(i64.eqz(i64.or(i64.or(_10, _11), i64.or(_12, _13)))) { continue }
}
sstore(_1, _1, _1, _1, x_4, x_5, x_6, x_7)
sstore(x_4, x_5, x_6, x_7)
}
function add_carry(x, y, c) -> r, r_c
function add(x1, x2, x3, x4) -> r1, r2, r3, r4
{
let t := i64.add(x, y)
r := i64.add(t, c)
r_c := i64.extend_i32_u(i32.or(i64.lt_u(t, x), i64.lt_u(r, t)))
}
function add(x1, x2, x3, x4, y1, y2, y3, y4) -> r1, r2, r3, r4
{
let t := i64.add(x4, y4)
let t := i64.add(x4, 1)
r4 := i64.add(t, 0)
let r3_1, carry := add_carry(x3, y3, i64.extend_i32_u(i32.or(i64.lt_u(t, x4), i64.lt_u(r4, t))))
r3 := r3_1
let r2_1, carry_1 := add_carry(x2, y2, carry)
r2 := r2_1
let r1_1, carry_2 := add_carry(x1, y1, carry_1)
r1 := r1_1
let t_1 := i64.add(x3, 0)
r3 := i64.add(t_1, i64.extend_i32_u(i32.or(i64.lt_u(t, x4), i64.lt_u(r4, t))))
let t_2 := i64.add(x2, 0)
r2 := i64.add(t_2, i64.extend_i32_u(i32.or(i64.lt_u(t_1, x3), i64.lt_u(r3, t_1))))
r1 := i64.add(i64.add(x1, 0), i64.extend_i32_u(i32.or(i64.lt_u(t_2, x2), i64.lt_u(r2, t_2))))
}
function iszero_887(x1, x2, x3, x4) -> r1, r2, r3, r4
function iszero_1300_2121(x4) -> r1, r2, r3, r4
{
r4 := i64.extend_i32_u(i64.eqz(i64.or(i64.or(x1, x2), i64.or(x3, x4))))
r4 := i64.extend_i32_u(i64.eqz(i64.or(i64.or(0, 0), i64.or(0, x4))))
}
function eq_888(x1, x2, x3, x4, y1, y2, y3, y4) -> r1, r2, r3, r4
function eq_740_2122(x1, x2, x3, x4) -> r1, r2, r3, r4
{
r4 := i64.extend_i32_u(i32.and(i64.eq(x1, y1), i32.and(i64.eq(x2, y2), i32.and(i64.eq(x3, y3), i64.eq(x4, y4)))))
r4 := i64.extend_i32_u(i32.and(i64.eq(x1, 0), i32.and(i64.eq(x2, 0), i32.and(i64.eq(x3, 0), i64.eq(x4, 2)))))
}
function lt(x1, x2, x3, x4, y1, y2, y3, y4) -> z4
function eq_741_2123(x1, x2, x3, x4) -> r1, r2, r3, r4
{
r4 := i64.extend_i32_u(i32.and(i64.eq(x1, 0), i32.and(i64.eq(x2, 0), i32.and(i64.eq(x3, 0), i64.eq(x4, 4)))))
}
function lt(x1, x2, x3, x4) -> z4
{
let z:i32 := false
let _1:i32 := 0xffffffff:i32
switch i32.select(_1, i64.ne(x1, y1), i64.lt_u(x1, y1))
let _1 := 0
let _2:i32 := 0xffffffff:i32
switch i32.select(_2, i64.ne(x1, _1), i64.lt_u(x1, _1))
case 0:i32 {
switch i32.select(_1, i64.ne(x2, y2), i64.lt_u(x2, y2))
switch i32.select(_2, i64.ne(x2, _1), i64.lt_u(x2, _1))
case 0:i32 {
switch i32.select(_1, i64.ne(x3, y3), i64.lt_u(x3, y3))
case 0:i32 { z := i64.lt_u(x4, y4) }
switch i32.select(_2, i64.ne(x3, _1), i64.lt_u(x3, _1))
case 0:i32 { z := i64.lt_u(x4, 10) }
case 1:i32 { z := 0:i32 }
default { z := 1:i32 }
}
@@ -96,11 +92,18 @@ object "object" {
default { z := 1:i32 }
z4 := i64.extend_i32_u(z)
}
function u256_to_i32(x1, x2, x3, x4) -> v:i32
function u256_to_i32_744() -> v:i32
{
if i64.ne(0, i64.or(i64.or(x1, x2), x3)) { unreachable() }
if i64.ne(0, i64.shr_u(x4, 32)) { unreachable() }
v := i32.wrap_i64(x4)
if i64.ne(0, i64.or(i64.or(0, 0), 0)) { unreachable() }
if i64.ne(0, i64.shr_u(32, 32)) { unreachable() }
v := i32.wrap_i64(32)
}
function u256_to_i32() -> v:i32
{
let _1 := 0
if i64.ne(_1, i64.or(i64.or(_1, _1), _1)) { unreachable() }
if i64.ne(_1, i64.shr_u(_1, 32)) { unreachable() }
v := i32.wrap_i64(_1)
}
function bswap16(x:i32) -> y:i32
{
@@ -116,59 +119,66 @@ object "object" {
let hi := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(x))), 32)
y := i64.or(hi, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(x, 32)))))
}
function calldataload(x1, x2, x3, x4) -> z1, z2, z3, z4
function calldataload() -> z1, z2, z3, z4
{
let cds:i32 := eth.getCallDataSize()
let _1 := 0
let destination:i32 := u256_to_i32(_1, _1, _1, _1)
let offset:i32 := u256_to_i32(x1, x2, x3, x4)
let requested_size:i32 := u256_to_i32(_1, _1, _1, 32)
if i64.ne(_1, i64.or(i64.or(_1, _1), _1)) { unreachable() }
if i64.ne(_1, i64.shr_u(_1, 32)) { unreachable() }
let v:i32 := i32.wrap_i64(_1)
let offset:i32 := u256_to_i32()
let requested_size:i32 := u256_to_i32_744()
if i32.gt_u(offset, i32.sub(0xffffffff:i32, requested_size)) { eth.revert(0:i32, 0:i32) }
let available_size:i32 := i32.sub(cds, offset)
if i32.gt_u(offset, cds) { available_size := 0:i32 }
let _2:i32 := 0:i32
if i32.gt_u(available_size, _2)
{
eth.callDataCopy(destination, offset, available_size)
eth.callDataCopy(v, offset, available_size)
}
if i32.gt_u(requested_size, available_size)
{
let _3:i32 := i32.sub(requested_size, available_size)
let _4:i32 := i32.add(destination, available_size)
let _4:i32 := i32.add(v, available_size)
let i:i32 := _2
for { } i32.lt_u(i, _3) { i := i32.add(i, 1:i32) }
{
i32.store8(i32.add(_4, i), _2)
}
}
let z1_1 := bswap64(i64.load(_2))
let z2_1 := bswap64(i64.load(i32.add(_2, 8:i32)))
let z3_1 := bswap64(i64.load(i32.add(_2, 16:i32)))
let z4_1 := bswap64(i64.load(i32.add(_2, 24:i32)))
let z1_1, z2_1, z3_1, z4_1 := mload_internal()
z1 := z1_1
z2 := z2_1
z3 := z3_1
z4 := z4_1
}
function sstore(x1, x2, x3, x4, y1, y2, y3, y4)
function sstore(y1, y2, y3, y4)
{
mstore_internal(0:i32, x1, x2, x3, x4)
mstore_internal(32:i32, y1, y2, y3, y4)
let hi := i64.shl(i64.extend_i32_u(bswap32(i32.wrap_i64(0))), 32)
let y := i64.or(hi, i64.extend_i32_u(bswap32(i32.wrap_i64(i64.shr_u(0, 32)))))
i64.store(0:i32, y)
i64.store(i32.add(0:i32, 8:i32), y)
i64.store(i32.add(0:i32, 16:i32), y)
i64.store(i32.add(0:i32, 24:i32), y)
i64.store(32:i32, bswap64(y1))
i64.store(i32.add(32:i32, 8:i32), bswap64(y2))
i64.store(i32.add(32:i32, 16:i32), bswap64(y3))
i64.store(i32.add(32:i32, 24:i32), bswap64(y4))
eth.storageStore(0:i32, 32:i32)
}
function mstore_internal(pos:i32, y1, y2, y3, y4)
function mload_internal() -> z1, z2, z3, z4
{
i64.store(pos, bswap64(y1))
i64.store(i32.add(pos, 8:i32), bswap64(y2))
i64.store(i32.add(pos, 16:i32), bswap64(y3))
i64.store(i32.add(pos, 24:i32), bswap64(y4))
z1 := bswap64(i64.load(0:i32))
z2 := bswap64(i64.load(i32.add(0:i32, 8:i32)))
z3 := bswap64(i64.load(i32.add(0:i32, 16:i32)))
z4 := bswap64(i64.load(i32.add(0:i32, 24:i32)))
}
}
}
Binary representation:
0061736d0100000001530c6000006000017f60017e017e60037e7e7e017e60047e7e7e7e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e0060087e7e7e7e7e7e7e7e017e60017f017f60057f7e7e7e7e0060027f7f0060037f7f7f00025e0408657468657265756d0c73746f7261676553746f7265000a08657468657265756d06726576657274000a08657468657265756d0f67657443616c6c4461746153697a65000108657468657265756d0c63616c6c44617461436f7079000b030e0d0003070407070508080204060905030100010610037e0142000b7e0142000b7e0142000b071102066d656d6f72790200046d61696e00040ac0090dcb02030a7e017f107e02404200210002402000200020002000100e21012300210223012103230221040b20012105200221062003210720042108420121092000200084200020098484504545210a02400340200a45450d01024002402000200020002005200620072008200020002000420a10091007210b2300210c2301210d2302210e0b200b200c84200d200e8484504504400c030b0240200520062007200820002000200042021008210f2300211023012111230221120b200f201084201120128484504504400c030b024020052006200720082000200020004204100821132300211423012115230221160b2013201484201520168484504504400c010b0b0240200520062007200820002000200020091006211723002118230121192302211a0b201721052018210620192107201a21080c000b0b20002000200020002005200620072008100f0b0b2901037e0240200020017c2105200520027c21032005200054200320055472ad21040b2004240020030b6c010b7e0240200320077c210c200c42007c210b024020022006200c200354200b200c5472ad1005210d2300210e0b200d210a024020012005200e1005210f230021100b200f2109024020002004201010052111230021120b201121080b20092400200a2401200b240220080b2401047e0240200020018420022003848450ad21070b20052400200624012007240220040b2f01047e02402000200451200120055120022006512003200751717171ad210b0b20092400200a2401200b240220080ba30102017e057f024041002109417f210a0240200a200020045220002004541b210b200b41004604400240200a200120055220012005541b210c200c41004604400240200a200220065220022006541b210d200d41004604402003200754210905200d41014604404100210905410121090b0b0b05200c41014604404100210905410121090b0b0b05200b41014604404100210905410121090b0b0b2009ad21080b20080b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100b411074210220022000411076100b7221010b20010b2201027e02402000a7100cad422086210220022000422088a7100cad8421010b20010bfc0105047e017f017e087f047e024010022108420021092009200920092009100a210a2000200120022003100a210b2009200920094220100a210c200b417f200c6b4b04404100410010010b2008200b6b210d200b20084b04404100210d0b4100210e200d200e4b0440200a200b200d10030b200c200d4b0440200c200d6b210f200a200d6a2110200e2111024003402011200f49450d010240201020116a200e3a00000b201141016a21110c000b0b0b200e290000100d2112200e41086a290000100d2113200e41106a290000100d2114200e41186a290000100d2115201221042013210520142106201521070b20052400200624012007240220040b230002404100200020012002200310104120200420052006200710104100412010000b0b3200024020002001100d370000200041086a2002100d370000200041106a2003100d370000200041186a2004100d3700000b0b
0061736d010000000130096000006000017e6000017f60017e017e60047e7e7e7e0060047e7e7e7e017e60017f017f60027f7f0060037f7f7f00025e0408657468657265756d0c73746f7261676553746f7265000708657468657265756d06726576657274000708657468657265756d0f67657443616c6c4461746153697a65000208657468657265756d0c63616c6c44617461436f70790008030f0e00050305050502020606030104010503010001061a057e0142000b7e0142000b7e0142000b7f0141000b7f0141000b071102066d656d6f72790200046d61696e00040a8a0a0e8d0203087e017f107e02400240100f21002300210123012102230221030b200021042001210520022106200321074200420084420042018484504545210802400340200845450d010240024020042005200620071009100621092303210a2304210b2300210c0b2009200a84200b200c8484504504400c030b024020042005200620071007210d2300210e2301210f230221100b200d200e84200f20108484504504400c030b02402004200520062007100821112300211223012113230221140b2011201284201320148484504504400c010b0b02402004200520062007100521152300211623012117230221180b201521042016210520172106201821070c000b0b200420052006200710100b0b6701077e0240200342017c2108200842007c2107200242007c210920092008200354200720085472ad7c2106200142007c210a200a2009200254200620095472ad7c2105200042007c200a2001542005200a5472ad7c21040b20052400200624012007240220040b2401047e0240420042008442002000848450ad21040b20022400200324012004240220010b2f01047e02402000420051200142005120024200512003420251717171ad21070b20052400200624012007240220040b2f01047e02402000420051200142005120024200512003420451717171ad21070b20052400200624012007240220040bab0104017e017f017e047f02404100210542002106417f210702402007200020065220002006541b21082008410046044002402007200120065220012006541b21092009410046044002402007200220065220022006541b210a200a41004604402003420a54210505200a41014604404100210505410121050b0b0b05200941014604404100210505410121050b0b0b05200841014604404100210505410121050b0b0b2005ad21040b20040b2901017f024042004200420084420084520440000b42004220422088520440000b4220a721000b20000b2f02017f017e02404200210120012001200184200184520440000b20012001422088520440000b2001a721000b20000b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100c411074210220022000411076100c7221010b20010b2201027e02402000a7100dad422086210220022000422088a7100dad8421010b20010be60105047e017f017e087f047e0240100221044200210520052005200584200584520440000b20052005422088520440000b2005a72106100b2107100a21082007417f20086b4b04404100410010010b200420076b2109200720044b0440410021090b4100210a2009200a4b044020062007200910030b200820094b0440200820096b210b200620096a210c200a210d02400340200d200b49450d010240200c200d6a200a3a00000b200d41016a210d0c000b0b0b02401011210e2300210f23012110230221110b200e2100200f210120102102201121030b20012400200224012003240220000b7801027e02404200a7100dad422086210420044200422088a7100dad84210541002005370000410041086a2005370000410041106a2005370000410041186a200537000041202000100e370000412041086a2001100e370000412041106a2002100e370000412041186a2003100e3700004100412010000b0b4201047e02404100290000100e2100410041086a290000100e2101410041106a290000100e2102410041186a290000100e21030b20012400200224012003240220000b
Text representation:
(module
@@ -181,9 +191,10 @@ Text representation:
(global $global_ (mut i64) (i64.const 0))
(global $global__1 (mut i64) (i64.const 0))
(global $global__2 (mut i64) (i64.const 0))
(global $global__6 (mut i32) (i32.const 0))
(global $global__7 (mut i32) (i32.const 0))
(func $main
(local $_1 i64)
(local $x i64)
(local $x_1 i64)
(local $x_2 i64)
@@ -192,8 +203,9 @@ Text representation:
(local $x_5 i64)
(local $x_6 i64)
(local $x_7 i64)
(local $_1 i32)
(local $_2 i64)
(local $_3 i32)
(local $_3 i64)
(local $_4 i64)
(local $_5 i64)
(local $_6 i64)
@@ -204,16 +216,13 @@ Text representation:
(local $_11 i64)
(local $_12 i64)
(local $_13 i64)
(local $_14 i64)
(local $_15 i64)
(local $x_8 i64)
(local $x_9 i64)
(local $x_10 i64)
(local $x_11 i64)
(block $label_
(local.set $_1 (i64.const 0))
(block
(local.set $x (call $calldataload (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1)))
(local.set $x (call $calldataload))
(local.set $x_1 (global.get $global_))
(local.set $x_2 (global.get $global__1))
(local.set $x_3 (global.get $global__2))
@@ -223,46 +232,45 @@ Text representation:
(local.set $x_5 (local.get $x_1))
(local.set $x_6 (local.get $x_2))
(local.set $x_7 (local.get $x_3))
(local.set $_2 (i64.const 1))
(local.set $_3 (i32.eqz (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_1) (local.get $_1)) (i64.or (local.get $_1) (local.get $_2)))))))
(local.set $_1 (i32.eqz (i32.eqz (i64.eqz (i64.or (i64.or (i64.const 0) (i64.const 0)) (i64.or (i64.const 0) (i64.const 1)))))))
(block $label__3
(loop $label__5
(br_if $label__3 (i32.eqz (i32.eqz (local.get $_3))))
(br_if $label__3 (i32.eqz (i32.eqz (local.get $_1))))
(block $label__4
(block
(local.set $_4 (call $iszero_887 (local.get $_1) (local.get $_1) (local.get $_1) (call $lt (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 10))))
(local.set $_2 (call $iszero_1300_2121 (call $lt (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7))))
(local.set $_3 (global.get $global__6))
(local.set $_4 (global.get $global__7))
(local.set $_5 (global.get $global_))
(local.set $_6 (global.get $global__1))
(local.set $_7 (global.get $global__2))
)
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_4) (local.get $_5)) (i64.or (local.get $_6) (local.get $_7))))) (then
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_2) (local.get $_3)) (i64.or (local.get $_4) (local.get $_5))))) (then
(br $label__3)
))
(block
(local.set $_8 (call $eq_888 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 2)))
(local.set $_9 (global.get $global_))
(local.set $_10 (global.get $global__1))
(local.set $_11 (global.get $global__2))
(local.set $_6 (call $eq_740_2122 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7)))
(local.set $_7 (global.get $global_))
(local.set $_8 (global.get $global__1))
(local.set $_9 (global.get $global__2))
)
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_8) (local.get $_9)) (i64.or (local.get $_10) (local.get $_11))))) (then
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_6) (local.get $_7)) (i64.or (local.get $_8) (local.get $_9))))) (then
(br $label__3)
))
(block
(local.set $_12 (call $eq_888 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 4)))
(local.set $_13 (global.get $global_))
(local.set $_14 (global.get $global__1))
(local.set $_15 (global.get $global__2))
(local.set $_10 (call $eq_741_2123 (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7)))
(local.set $_11 (global.get $global_))
(local.set $_12 (global.get $global__1))
(local.set $_13 (global.get $global__2))
)
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_12) (local.get $_13)) (i64.or (local.get $_14) (local.get $_15))))) (then
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $_10) (local.get $_11)) (i64.or (local.get $_12) (local.get $_13))))) (then
(br $label__4)
))
)
(block
(local.set $x_8 (call $add (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_2)))
(local.set $x_8 (call $add (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7)))
(local.set $x_9 (global.get $global_))
(local.set $x_10 (global.get $global__1))
(local.set $x_11 (global.get $global__2))
@@ -276,90 +284,31 @@ Text representation:
)
)
(call $sstore (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7))
(call $sstore (local.get $x_4) (local.get $x_5) (local.get $x_6) (local.get $x_7))
)
)
(func $add_carry
(param $x i64)
(param $y i64)
(param $c i64)
(result i64)
(local $r i64)
(local $r_c i64)
(local $t i64)
(block $label__6
(local.set $t (i64.add (local.get $x) (local.get $y)))
(local.set $r (i64.add (local.get $t) (local.get $c)))
(local.set $r_c (i64.extend_i32_u (i32.or (i64.lt_u (local.get $t) (local.get $x)) (i64.lt_u (local.get $r) (local.get $t)))))
)
(global.set $global_ (local.get $r_c))
(local.get $r)
)
(func $add
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(result i64)
(local $r1 i64)
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(local $t i64)
(local $r3_1 i64)
(local $carry i64)
(local $r2_1 i64)
(local $carry_1 i64)
(local $r1_1 i64)
(local $carry_2 i64)
(block $label__7
(local.set $t (i64.add (local.get $x4) (local.get $y4)))
(local.set $r4 (i64.add (local.get $t) (i64.const 0)))
(block
(local.set $r3_1 (call $add_carry (local.get $x3) (local.get $y3) (i64.extend_i32_u (i32.or (i64.lt_u (local.get $t) (local.get $x4)) (i64.lt_u (local.get $r4) (local.get $t))))))
(local.set $carry (global.get $global_))
)
(local.set $r3 (local.get $r3_1))
(block
(local.set $r2_1 (call $add_carry (local.get $x2) (local.get $y2) (local.get $carry)))
(local.set $carry_1 (global.get $global_))
)
(local.set $r2 (local.get $r2_1))
(block
(local.set $r1_1 (call $add_carry (local.get $x1) (local.get $y1) (local.get $carry_1)))
(local.set $carry_2 (global.get $global_))
)
(local.set $r1 (local.get $r1_1))
)
(global.set $global_ (local.get $r2))
(global.set $global__1 (local.get $r3))
(global.set $global__2 (local.get $r4))
(local.get $r1)
)
(func $iszero_887
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(result i64)
(local $r1 i64)
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(local $t_1 i64)
(local $t_2 i64)
(block $label__8
(local.set $r4 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (local.get $x1) (local.get $x2)) (i64.or (local.get $x3) (local.get $x4))))))
(local.set $t (i64.add (local.get $x4) (i64.const 1)))
(local.set $r4 (i64.add (local.get $t) (i64.const 0)))
(local.set $t_1 (i64.add (local.get $x3) (i64.const 0)))
(local.set $r3 (i64.add (local.get $t_1) (i64.extend_i32_u (i32.or (i64.lt_u (local.get $t) (local.get $x4)) (i64.lt_u (local.get $r4) (local.get $t))))))
(local.set $t_2 (i64.add (local.get $x2) (i64.const 0)))
(local.set $r2 (i64.add (local.get $t_2) (i64.extend_i32_u (i32.or (i64.lt_u (local.get $t_1) (local.get $x3)) (i64.lt_u (local.get $r3) (local.get $t_1))))))
(local.set $r1 (i64.add (i64.add (local.get $x1) (i64.const 0)) (i64.extend_i32_u (i32.or (i64.lt_u (local.get $t_2) (local.get $x2)) (i64.lt_u (local.get $r2) (local.get $t_2))))))
)
(global.set $global_ (local.get $r2))
@@ -368,22 +317,55 @@ Text representation:
(local.get $r1)
)
(func $eq_888
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(func $iszero_1300_2121
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(result i64)
(local $r1 i64)
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(block $label__9
(local.set $r4 (i64.extend_i32_u (i32.and (i64.eq (local.get $x1) (local.get $y1)) (i32.and (i64.eq (local.get $x2) (local.get $y2)) (i32.and (i64.eq (local.get $x3) (local.get $y3)) (i64.eq (local.get $x4) (local.get $y4)))))))
(local.set $r4 (i64.extend_i32_u (i64.eqz (i64.or (i64.or (i64.const 0) (i64.const 0)) (i64.or (i64.const 0) (local.get $x4))))))
)
(global.set $global_ (local.get $r2))
(global.set $global__1 (local.get $r3))
(global.set $global__2 (local.get $r4))
(local.get $r1)
)
(func $eq_740_2122
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(result i64)
(local $r1 i64)
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(block $label__10
(local.set $r4 (i64.extend_i32_u (i32.and (i64.eq (local.get $x1) (i64.const 0)) (i32.and (i64.eq (local.get $x2) (i64.const 0)) (i32.and (i64.eq (local.get $x3) (i64.const 0)) (i64.eq (local.get $x4) (i64.const 2)))))))
)
(global.set $global_ (local.get $r2))
(global.set $global__1 (local.get $r3))
(global.set $global__2 (local.get $r4))
(local.get $r1)
)
(func $eq_741_2123
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(result i64)
(local $r1 i64)
(local $r2 i64)
(local $r3 i64)
(local $r4 i64)
(block $label__11
(local.set $r4 (i64.extend_i32_u (i32.and (i64.eq (local.get $x1) (i64.const 0)) (i32.and (i64.eq (local.get $x2) (i64.const 0)) (i32.and (i64.eq (local.get $x3) (i64.const 0)) (i64.eq (local.get $x4) (i64.const 4)))))))
)
(global.set $global_ (local.get $r2))
@@ -397,32 +379,30 @@ Text representation:
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(result i64)
(local $z4 i64)
(local $z i32)
(local $_1 i32)
(local $_1 i64)
(local $_2 i32)
(local $condition i32)
(local $condition_11 i32)
(local $condition_12 i32)
(block $label__10
(local $condition_13 i32)
(local $condition_14 i32)
(block $label__12
(local.set $z (i32.const 0))
(local.set $_1 (i32.const 4294967295))
(local.set $_1 (i64.const 0))
(local.set $_2 (i32.const 4294967295))
(block
(local.set $condition (select (local.get $_1) (i64.ne (local.get $x1) (local.get $y1)) (i64.lt_u (local.get $x1) (local.get $y1))))
(local.set $condition (select (local.get $_2) (i64.ne (local.get $x1) (local.get $_1)) (i64.lt_u (local.get $x1) (local.get $_1))))
(if (i32.eq (local.get $condition) (i32.const 0)) (then
(block
(local.set $condition_11 (select (local.get $_1) (i64.ne (local.get $x2) (local.get $y2)) (i64.lt_u (local.get $x2) (local.get $y2))))
(if (i32.eq (local.get $condition_11) (i32.const 0)) (then
(local.set $condition_13 (select (local.get $_2) (i64.ne (local.get $x2) (local.get $_1)) (i64.lt_u (local.get $x2) (local.get $_1))))
(if (i32.eq (local.get $condition_13) (i32.const 0)) (then
(block
(local.set $condition_12 (select (local.get $_1) (i64.ne (local.get $x3) (local.get $y3)) (i64.lt_u (local.get $x3) (local.get $y3))))
(if (i32.eq (local.get $condition_12) (i32.const 0)) (then
(local.set $z (i64.lt_u (local.get $x4) (local.get $y4)))
(local.set $condition_14 (select (local.get $_2) (i64.ne (local.get $x3) (local.get $_1)) (i64.lt_u (local.get $x3) (local.get $_1))))
(if (i32.eq (local.get $condition_14) (i32.const 0)) (then
(local.set $z (i64.lt_u (local.get $x4) (i64.const 10)))
)(else
(if (i32.eq (local.get $condition_12) (i32.const 1)) (then
(if (i32.eq (local.get $condition_14) (i32.const 1)) (then
(local.set $z (i32.const 0))
)(else
(local.set $z (i32.const 1))
@@ -431,7 +411,7 @@ Text representation:
)
)(else
(if (i32.eq (local.get $condition_11) (i32.const 1)) (then
(if (i32.eq (local.get $condition_13) (i32.const 1)) (then
(local.set $z (i32.const 0))
)(else
(local.set $z (i32.const 1))
@@ -454,19 +434,31 @@ Text representation:
(local.get $z4)
)
(func $u256_to_i32
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(func $u256_to_i32_744
(result i32)
(local $v i32)
(block $label__13
(if (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3))) (then
(block $label__15
(if (i64.ne (i64.const 0) (i64.or (i64.or (i64.const 0) (i64.const 0)) (i64.const 0))) (then
(unreachable)))
(if (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32))) (then
(if (i64.ne (i64.const 0) (i64.shr_u (i64.const 32) (i64.const 32))) (then
(unreachable)))
(local.set $v (i32.wrap_i64 (local.get $x4)))
(local.set $v (i32.wrap_i64 (i64.const 32)))
)
(local.get $v)
)
(func $u256_to_i32
(result i32)
(local $v i32)
(local $_1 i64)
(block $label__16
(local.set $_1 (i64.const 0))
(if (i64.ne (local.get $_1) (i64.or (i64.or (local.get $_1) (local.get $_1)) (local.get $_1))) (then
(unreachable)))
(if (i64.ne (local.get $_1) (i64.shr_u (local.get $_1) (i64.const 32))) (then
(unreachable)))
(local.set $v (i32.wrap_i64 (local.get $_1)))
)
(local.get $v)
@@ -476,7 +468,7 @@ Text representation:
(param $x i32)
(result i32)
(local $y i32)
(block $label__14
(block $label__17
(local.set $y (i32.or (i32.and (i32.shl (local.get $x) (i32.const 8)) (i32.const 65280)) (i32.and (i32.shr_u (local.get $x) (i32.const 8)) (i32.const 255))))
)
@@ -488,7 +480,7 @@ Text representation:
(result i32)
(local $y i32)
(local $hi i32)
(block $label__15
(block $label__18
(local.set $hi (i32.shl (call $bswap16 (local.get $x)) (i32.const 16)))
(local.set $y (i32.or (local.get $hi) (call $bswap16 (i32.shr_u (local.get $x) (i32.const 16)))))
@@ -501,7 +493,7 @@ Text representation:
(result i64)
(local $y i64)
(local $hi i64)
(block $label__16
(block $label__19
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (local.get $x)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (local.get $x) (i64.const 32)))))))
@@ -510,10 +502,6 @@ Text representation:
)
(func $calldataload
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(result i64)
(local $z1 i64)
(local $z2 i64)
@@ -521,7 +509,7 @@ Text representation:
(local $z4 i64)
(local $cds i32)
(local $_1 i64)
(local $destination i32)
(local $v i32)
(local $offset i32)
(local $requested_size i32)
(local $available_size i32)
@@ -533,12 +521,16 @@ Text representation:
(local $z2_1 i64)
(local $z3_1 i64)
(local $z4_1 i64)
(block $label__17
(block $label__20
(local.set $cds (call $eth.getCallDataSize))
(local.set $_1 (i64.const 0))
(local.set $destination (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1)))
(local.set $offset (call $u256_to_i32 (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)))
(local.set $requested_size (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 32)))
(if (i64.ne (local.get $_1) (i64.or (i64.or (local.get $_1) (local.get $_1)) (local.get $_1))) (then
(unreachable)))
(if (i64.ne (local.get $_1) (i64.shr_u (local.get $_1) (i64.const 32))) (then
(unreachable)))
(local.set $v (i32.wrap_i64 (local.get $_1)))
(local.set $offset (call $u256_to_i32))
(local.set $requested_size (call $u256_to_i32_744))
(if (i32.gt_u (local.get $offset) (i32.sub (i32.const 4294967295) (local.get $requested_size))) (then
(call $eth.revert (i32.const 0) (i32.const 0))))
(local.set $available_size (i32.sub (local.get $cds) (local.get $offset)))
@@ -547,27 +539,30 @@ Text representation:
))
(local.set $_2 (i32.const 0))
(if (i32.gt_u (local.get $available_size) (local.get $_2)) (then
(call $eth.callDataCopy (local.get $destination) (local.get $offset) (local.get $available_size))))
(call $eth.callDataCopy (local.get $v) (local.get $offset) (local.get $available_size))))
(if (i32.gt_u (local.get $requested_size) (local.get $available_size)) (then
(local.set $_3 (i32.sub (local.get $requested_size) (local.get $available_size)))
(local.set $_4 (i32.add (local.get $destination) (local.get $available_size)))
(local.set $_4 (i32.add (local.get $v) (local.get $available_size)))
(local.set $i (local.get $_2))
(block $label__18
(loop $label__20
(br_if $label__18 (i32.eqz (i32.lt_u (local.get $i) (local.get $_3))))
(block $label__19
(block $label__21
(loop $label__23
(br_if $label__21 (i32.eqz (i32.lt_u (local.get $i) (local.get $_3))))
(block $label__22
(i32.store8 (i32.add (local.get $_4) (local.get $i)) (local.get $_2))
)
(local.set $i (i32.add (local.get $i) (i32.const 1)))
(br $label__20)
(br $label__23)
)
)
))
(local.set $z1_1 (call $bswap64 (i64.load (local.get $_2))))
(local.set $z2_1 (call $bswap64 (i64.load (i32.add (local.get $_2) (i32.const 8)))))
(local.set $z3_1 (call $bswap64 (i64.load (i32.add (local.get $_2) (i32.const 16)))))
(local.set $z4_1 (call $bswap64 (i64.load (i32.add (local.get $_2) (i32.const 24)))))
(block
(local.set $z1_1 (call $mload_internal))
(local.set $z2_1 (global.get $global_))
(local.set $z3_1 (global.get $global__1))
(local.set $z4_1 (global.get $global__2))
)
(local.set $z1 (local.get $z1_1))
(local.set $z2 (local.get $z2_1))
(local.set $z3 (local.get $z3_1))
@@ -581,33 +576,44 @@ Text representation:
)
(func $sstore
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__21
(call $mstore_internal (i32.const 0) (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4))
(call $mstore_internal (i32.const 32) (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4))
(local $hi i64)
(local $y i64)
(block $label__24
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.const 0)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (i64.const 0) (i64.const 32)))))))
(i64.store (i32.const 0) (local.get $y))
(i64.store (i32.add (i32.const 0) (i32.const 8)) (local.get $y))
(i64.store (i32.add (i32.const 0) (i32.const 16)) (local.get $y))
(i64.store (i32.add (i32.const 0) (i32.const 24)) (local.get $y))
(i64.store (i32.const 32) (call $bswap64 (local.get $y1)))
(i64.store (i32.add (i32.const 32) (i32.const 8)) (call $bswap64 (local.get $y2)))
(i64.store (i32.add (i32.const 32) (i32.const 16)) (call $bswap64 (local.get $y3)))
(i64.store (i32.add (i32.const 32) (i32.const 24)) (call $bswap64 (local.get $y4)))
(call $eth.storageStore (i32.const 0) (i32.const 32))
)
)
(func $mstore_internal
(param $pos i32)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__22
(i64.store (local.get $pos) (call $bswap64 (local.get $y1)))
(i64.store (i32.add (local.get $pos) (i32.const 8)) (call $bswap64 (local.get $y2)))
(i64.store (i32.add (local.get $pos) (i32.const 16)) (call $bswap64 (local.get $y3)))
(i64.store (i32.add (local.get $pos) (i32.const 24)) (call $bswap64 (local.get $y4)))
(func $mload_internal
(result i64)
(local $z1 i64)
(local $z2 i64)
(local $z3 i64)
(local $z4 i64)
(block $label__25
(local.set $z1 (call $bswap64 (i64.load (i32.const 0))))
(local.set $z2 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 8)))))
(local.set $z3 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 16)))))
(local.set $z4 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 24)))))
)
(global.set $global_ (local.get $z2))
(global.set $global__1 (local.get $z3))
(global.set $global__2 (local.get $z4))
(local.get $z1)
)
)
@@ -64,17 +64,16 @@ object "D_16" {
returndatacopy(_1, _1, returndatasize())
revert(_1, returndatasize())
}
return(allocate_memory(_1), _1)
return(allocate_memory(), _1)
}
}
revert(0, 0)
}
function allocate_memory(size) -> memPtr
function allocate_memory() -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
if gt(memPtr, 0xffffffffffffffff) { panic_error_0x41() }
mstore(64, memPtr)
}
function panic_error_0x41()
{
+30 -8
View File
@@ -45,14 +45,14 @@ object "C_59" {
for { } lt(i, _4) { i := add(i, 1) }
{
if slt(sub(calldatasize(), src), _2) { revert(_1, _1) }
let value := allocate_memory(_2)
let value := allocate_memory_1246()
mstore(value, calldataload(src))
mstore(dst, value)
dst := add(dst, _2)
src := add(src, _2)
}
let ret, ret_1 := fun_sumArray(dst_1)
let memPos := allocate_memory(_1)
let memPos := allocate_memory_1247()
return(memPos, sub(abi_encode_uint256_string(memPos, ret, ret_1), memPos))
}
}
@@ -76,6 +76,19 @@ object "C_59" {
}
tail := add(add(headStart, and(add(length, 31), not(31))), 96)
}
function allocate_memory_1246() -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, 32)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
}
function allocate_memory_1247() -> memPtr
{
memPtr := mload(64)
if gt(memPtr, 0xffffffffffffffff) { panic_error_0x41() }
mstore(64, memPtr)
}
function allocate_memory(size) -> memPtr
{
memPtr := mload(64)
@@ -85,7 +98,10 @@ object "C_59" {
}
function copy_literal_to_memory_64902fd228f7ef267f3b474dd6ef84bae434cf5546eee948e7ca26df3eda1927() -> memPtr
{
let memPtr_1 := allocate_memory(160)
let memPtr_1 := mload(64)
let newFreePtr := add(memPtr_1, 160)
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr_1)) { panic_error_0x41() }
mstore(64, newFreePtr)
mstore(memPtr_1, 100)
memPtr := memPtr_1
mstore(add(memPtr_1, 0x20), "longstringlongstringlongstringlo")
@@ -101,7 +117,7 @@ object "C_59" {
{
if iszero(lt(var_mpos, mload(var_s_mpos))) { panic_error_0x32() }
let _1 := mload(mload(add(add(var_s_mpos, shl(5, var_mpos)), 32)))
let _2, _3 := storage_array_index_access_struct_S(var_mpos, var_mpos)
let _2, _3 := storage_array_index_access_struct_S_1254()
sstore(_2, _1)
if iszero(lt(0x01, mload(var_s_mpos))) { panic_error_0x32() }
let _4 := mload(mload(add(var_s_mpos, 64)))
@@ -111,7 +127,7 @@ object "C_59" {
let shiftBits := shl(3, var_mpos)
let mask := shl(shiftBits, not(0))
sstore(slot, or(and(_5, not(mask)), and(shl(shiftBits, _4), mask)))
let _6, _7 := storage_array_index_access_struct_S(0x02, var_mpos)
let _6, _7 := storage_array_index_access_struct_S()
var := extract_from_storage_value_dynamict_uint256(sload(_6), _7)
var_mpos := copy_literal_to_memory_64902fd228f7ef267f3b474dd6ef84bae434cf5546eee948e7ca26df3eda1927()
}
@@ -127,10 +143,16 @@ object "C_59" {
mstore(4, 0x41)
revert(0, 0x24)
}
function storage_array_index_access_struct_S(array, index) -> slot, offset
function storage_array_index_access_struct_S_1254() -> slot, offset
{
if iszero(lt(index, 0x02)) { panic_error_0x32() }
slot := add(array, index)
if iszero(lt(slot, 0x02)) { panic_error_0x32() }
slot := add(slot, slot)
offset := offset
}
function storage_array_index_access_struct_S() -> slot, offset
{
if iszero(lt(slot, 0x02)) { panic_error_0x32() }
slot := add(0x02, slot)
offset := offset
}
}
@@ -40,7 +40,7 @@ object "Arraysum_34" {
mstore(_1, _1)
var_sum := checked_add_uint256(var_sum, sload(add(keccak256(_1, 0x20), var_i)))
}
let memPos := allocate_memory(_1)
let memPos := allocate_memory()
return(memPos, sub(abi_encode_uint256(memPos, var_sum), memPos))
}
}
@@ -51,17 +51,16 @@ object "Arraysum_34" {
tail := add(headStart, 32)
mstore(headStart, value0)
}
function allocate_memory(size) -> memPtr
function allocate_memory() -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr))
if gt(memPtr, 0xffffffffffffffff)
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x41)
revert(0, 0x24)
}
mstore(64, newFreePtr)
mstore(64, memPtr)
}
function checked_add_uint256(x, y) -> sum
{
@@ -1,7 +1,7 @@
{"contracts":{"A":{"C":{"ewasm":{"wasm":"0061736d01000000013f0960000060017e017e60047e7e7e7e017f60087e7e7e7e7e7e7e7e00600c7e7e7e7e7e7e7e7e7e7e7e7e0060017f0060017f017f60027f7f0060037f7f7f0002510408657468657265756d08636f6465436f7079000808657468657265756d06726576657274000708657468657265756d0c67657443616c6c56616c7565000508657468657265756d0666696e6973680007030a090002020606010403030503010001060100071102066d656d6f72790200046d61696e00040086030c435f335f6465706c6f7965640061736d0100000001160460000060047e7e7e7e017f60017f017f60027f7f0002130108657468657265756d067265766572740003030504000102020503010001060100071102066d656d6f72790200046d61696e00010a9f0204b30104017e027f037e037f02404200210020002000200042c00010022101200141c0006a210220022001490440000b2000a71004ad422086210320032000422088a71004ad84210420022004370000200241086a2004370000200241106a2004370000428001a71004ad4220862105200241186a2005428001422088a71004ad84370000200020002000200010022106200020002000200010022107200741c0006a210820082007490440000b2008200610000b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100341107421022002200041107610037221010b20010b0af00309dc0103017e027f057e02404200210020002000200042c00010052101200141c0006a210220022001490440000b20001009210320022003370000200241086a2003370000200241106a2003370000200241186a428001100937000041001002410029000010092104410041086a29000010092105410041106a2900001009210620042005842006410041186a290000100984845045044020002000200020002000200020002000100c0b42f9022107200020002000200020002000200042d3012000200020002007100a20002000200020002000200020002007100b0b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b2601027f0240200020012002200310052105200541c0006a210420042005490440000b0b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100741107421022002200041107610077221010b20010b2201027e02402000a71008ad422086210220022000422088a71008ad8421010b20010b25000240200020012002200310062004200520062007100520082009200a200b100510000b0b1b000240200020012002200310062004200520062007100510030b0b1b000240200020012002200310062004200520062007100510010b0b","wast":"(module
{"contracts":{"A":{"C":{"ewasm":{"wasm":"0061736d0100000001330b6000006000017e6000017f60017e0060017e017e60017e017f60027e7e0060017f0060017f017f60027f7f0060037f7f7f0002510408657468657265756d08636f6465436f7079000a08657468657265756d06726576657274000908657468657265756d0c67657443616c6c56616c7565000708657468657265756d0666696e6973680009030d0c0002050208080101040603000503010001060100071102066d656d6f72790200046d61696e00040092030c435f335f6465706c6f7965640061736d010000000112046000006000017f60017f017f60027f7f0002130108657468657265756d06726576657274000303060500010102020503010001060100071102066d656d6f72790200046d61696e00010aae02059d0103017e027f037e02404200210020002000200084200084520440000b200042c000422088520440000b42c000a72101200141c0006a210220022001490440000b2000a71005ad422086210320032000422088a71005ad84210420022004370000200241086a2004370000200241106a2004370000428001a71005ad4220862105200241186a2005428001422088a71005ad843700001003100210000b0b2f02017f017e02404200210120012001200184200184520440000b20012001422088520440000b2001a721000b20000b1e01027f024010022101200141c0006a210020002001490440000b0b20000b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100441107421022002200041107610047221010b20010b0aca040c960102027f057e024010052100200041c0006a210120012000490440000b100a210220012002370000200141086a2002370000200141106a2002370000200141186a100b370000410010024100290000100c2103410041086a290000100c2104410041106a290000100c210520032004842005410041186a290000100c848450450440100f0b428503210642ca012006100d2006100e0b0b2b01017f024042004200420084420084520440000b420042c000422088520440000b42c000a721000b20000b2901017f024042004200420084420084520440000b42002000422088520440000b2000a721010b20010b2f02017f017e02404200210120012001200184200184520440000b20012001422088520440000b2001a721000b20000b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100841107421022002200041107610087221010b20010b2201027e02404200a71009ad422086210120014200422088a71009ad8421000b20000b2401027e0240428001a71009ad42208621012001428001422088a71009ad8421000b20000b2201027e02402000a71009ad422086210220022000422088a71009ad8421010b20010b3001047f024020011006210220001006210310072104200441c0006a210520052004490440000b20052003200210000b0b2801037f024020001006210110072102200241c0006a210320032002490440000b2003200110030b0b2601037f02401007210010072101200141c0006a210220022001490440000b2002200010010b0b","wast":"(module
;; custom section for sub-module
;; The Keccak-256 hash of the text representation of \"C_3_deployed\": 380167268971b84f9fd4e61f1659da4fd304bd6e30ec2dd33d412f3c8203ced7
;; (@custom \"C_3_deployed\" \"0061736d0100000001160460000060047e7e7e7e017f60017f017f60027f7f0002130108657468657265756d067265766572740003030504000102020503010001060100071102066d656d6f72790200046d61696e00010a9f0204b30104017e027f037e037f02404200210020002000200042c00010022101200141c0006a210220022001490440000b2000a71004ad422086210320032000422088a71004ad84210420022004370000200241086a2004370000200241106a2004370000428001a71004ad4220862105200241186a2005428001422088a71004ad84370000200020002000200010022106200020002000200010022107200741c0006a210820082007490440000b2008200610000b0b2901017f024042002000200184200284520440000b42002003422088520440000b2003a721040b20040b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100341107421022002200041107610037221010b20010b\")
;; The Keccak-256 hash of the text representation of \"C_3_deployed\": 1c21519afc0397d3ba45d99eb2354c3d74191cd82bffab348d52efabddb63f6a
;; (@custom \"C_3_deployed\" \"0061736d010000000112046000006000017f60017f017f60027f7f0002130108657468657265756d06726576657274000303060500010102020503010001060100071102066d656d6f72790200046d61696e00010aae02059d0103017e027f037e02404200210020002000200084200084520440000b200042c000422088520440000b42c000a72101200141c0006a210220022001490440000b2000a71005ad422086210320032000422088a71005ad84210420022004370000200241086a2004370000200241106a2004370000428001a71005ad4220862105200241186a2005428001422088a71005ad843700001003100210000b0b2f02017f017e02404200210120012001200184200184520440000b20012001422088520440000b2001a721000b20000b1e01027f024010022101200141c0006a210020002001490440000b0b20000b1f01017f024020004108744180fe0371200041087641ff01717221010b20010b1e01027f02402000100441107421022002200041107610047221010b20010b\")
(import \"ethereum\" \"codeCopy\" (func $eth.codeCopy (param i32 i32 i32)))
(import \"ethereum\" \"revert\" (func $eth.revert (param i32 i32)))
(import \"ethereum\" \"getCallValue\" (func $eth.getCallValue (param i32)))
@@ -10,46 +10,55 @@
(export \"main\" (func $main))
(func $main
(local $_1 i64)
(local $p i32)
(local $r i32)
(local $_2 i64)
(local $_1 i64)
(local $z1 i64)
(local $z2 i64)
(local $z3 i64)
(local $_3 i64)
(local $_2 i64)
(block $label_
(local.set $_1 (i64.const 0))
(local.set $p (call $u256_to_i32 (local.get $_1) (local.get $_1) (local.get $_1) (i64.const 64)))
(local.set $p (call $u256_to_i32_685))
(local.set $r (i32.add (local.get $p) (i32.const 64)))
(if (i32.lt_u (local.get $r) (local.get $p)) (then
(unreachable)))
(local.set $_2 (call $bswap64 (local.get $_1)))
(i64.store (local.get $r) (local.get $_2))
(i64.store (i32.add (local.get $r) (i32.const 8)) (local.get $_2))
(i64.store (i32.add (local.get $r) (i32.const 16)) (local.get $_2))
(i64.store (i32.add (local.get $r) (i32.const 24)) (call $bswap64 (i64.const 128)))
(local.set $_1 (call $bswap64_388))
(i64.store (local.get $r) (local.get $_1))
(i64.store (i32.add (local.get $r) (i32.const 8)) (local.get $_1))
(i64.store (i32.add (local.get $r) (i32.const 16)) (local.get $_1))
(i64.store (i32.add (local.get $r) (i32.const 24)) (call $bswap64_389))
(call $eth.getCallValue (i32.const 0))
(local.set $z1 (call $bswap64 (i64.load (i32.const 0))))
(local.set $z2 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 8)))))
(local.set $z3 (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 16)))))
(if (i32.eqz (i64.eqz (i64.or (i64.or (local.get $z1) (local.get $z2)) (i64.or (local.get $z3) (call $bswap64 (i64.load (i32.add (i32.const 0) (i32.const 24)))))))) (then
(call $revert (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1))))
(local.set $_3 (datasize \"C_3_deployed\"))
(call $codecopy (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (dataoffset \"C_3_deployed\") (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_3))
(call $return (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_1) (local.get $_3))
(call $revert)))
(local.set $_2 (datasize \"C_3_deployed\"))
(call $codecopy (dataoffset \"C_3_deployed\") (local.get $_2))
(call $return (local.get $_2))
)
)
(func $u256_to_i32
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(func $u256_to_i32_685
(result i32)
(local $v i32)
(block $label__1
(if (i64.ne (i64.const 0) (i64.or (i64.or (local.get $x1) (local.get $x2)) (local.get $x3))) (then
(if (i64.ne (i64.const 0) (i64.or (i64.or (i64.const 0) (i64.const 0)) (i64.const 0))) (then
(unreachable)))
(if (i64.ne (i64.const 0) (i64.shr_u (i64.const 64) (i64.const 32))) (then
(unreachable)))
(local.set $v (i32.wrap_i64 (i64.const 64)))
)
(local.get $v)
)
(func $u256_to_i32_687
(param $x4 i64)
(result i32)
(local $v i32)
(block $label__2
(if (i64.ne (i64.const 0) (i64.or (i64.or (i64.const 0) (i64.const 0)) (i64.const 0))) (then
(unreachable)))
(if (i64.ne (i64.const 0) (i64.shr_u (local.get $x4) (i64.const 32))) (then
(unreachable)))
@@ -59,29 +68,27 @@
(local.get $v)
)
(func $to_internal_i32ptr
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(func $u256_to_i32
(result i32)
(local $r i32)
(local $p i32)
(block $label__2
(local.set $p (call $u256_to_i32 (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)))
(local.set $r (i32.add (local.get $p) (i32.const 64)))
(if (i32.lt_u (local.get $r) (local.get $p)) (then
(local $v i32)
(local $_1 i64)
(block $label__3
(local.set $_1 (i64.const 0))
(if (i64.ne (local.get $_1) (i64.or (i64.or (local.get $_1) (local.get $_1)) (local.get $_1))) (then
(unreachable)))
(if (i64.ne (local.get $_1) (i64.shr_u (local.get $_1) (i64.const 32))) (then
(unreachable)))
(local.set $v (i32.wrap_i64 (local.get $_1)))
)
(local.get $r)
(local.get $v)
)
(func $bswap16
(param $x i32)
(result i32)
(local $y i32)
(block $label__3
(block $label__4
(local.set $y (i32.or (i32.and (i32.shl (local.get $x) (i32.const 8)) (i32.const 65280)) (i32.and (i32.shr_u (local.get $x) (i32.const 8)) (i32.const 255))))
)
@@ -93,7 +100,7 @@
(result i32)
(local $y i32)
(local $hi i32)
(block $label__4
(block $label__5
(local.set $hi (i32.shl (call $bswap16 (local.get $x)) (i32.const 16)))
(local.set $y (i32.or (local.get $hi) (call $bswap16 (i32.shr_u (local.get $x) (i32.const 16)))))
@@ -101,12 +108,36 @@
(local.get $y)
)
(func $bswap64_388
(result i64)
(local $y i64)
(local $hi i64)
(block $label__6
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.const 0)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (i64.const 0) (i64.const 32)))))))
)
(local.get $y)
)
(func $bswap64_389
(result i64)
(local $y i64)
(local $hi i64)
(block $label__7
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.const 128)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (i64.const 128) (i64.const 32)))))))
)
(local.get $y)
)
(func $bswap64
(param $x i64)
(result i64)
(local $y i64)
(local $hi i64)
(block $label__5
(block $label__8
(local.set $hi (i64.shl (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (local.get $x)))) (i64.const 32)))
(local.set $y (i64.or (local.get $hi) (i64.extend_i32_u (call $bswap32 (i32.wrap_i64 (i64.shr_u (local.get $x) (i64.const 32)))))))
@@ -115,48 +146,49 @@
)
(func $codecopy
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(param $z1 i64)
(param $z2 i64)
(param $z3 i64)
(param $z4 i64)
(block $label__6
(call $eth.codeCopy (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)) (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4)) (call $u256_to_i32 (local.get $z1) (local.get $z2) (local.get $z3) (local.get $z4)))
(local $_1 i32)
(local $_2 i32)
(local $p i32)
(local $r i32)
(block $label__9
(local.set $_1 (call $u256_to_i32_687 (local.get $z4)))
(local.set $_2 (call $u256_to_i32_687 (local.get $y4)))
(local.set $p (call $u256_to_i32))
(local.set $r (i32.add (local.get $p) (i32.const 64)))
(if (i32.lt_u (local.get $r) (local.get $p)) (then
(unreachable)))
(call $eth.codeCopy (local.get $r) (local.get $_2) (local.get $_1))
)
)
(func $return
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__7
(call $eth.finish (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)) (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4)))
(local $_1 i32)
(local $p i32)
(local $r i32)
(block $label__10
(local.set $_1 (call $u256_to_i32_687 (local.get $y4)))
(local.set $p (call $u256_to_i32))
(local.set $r (i32.add (local.get $p) (i32.const 64)))
(if (i32.lt_u (local.get $r) (local.get $p)) (then
(unreachable)))
(call $eth.finish (local.get $r) (local.get $_1))
)
)
(func $revert
(param $x1 i64)
(param $x2 i64)
(param $x3 i64)
(param $x4 i64)
(param $y1 i64)
(param $y2 i64)
(param $y3 i64)
(param $y4 i64)
(block $label__8
(call $eth.revert (call $to_internal_i32ptr (local.get $x1) (local.get $x2) (local.get $x3) (local.get $x4)) (call $u256_to_i32 (local.get $y1) (local.get $y2) (local.get $y3) (local.get $y4)))
(local $_1 i32)
(local $p i32)
(local $r i32)
(block $label__11
(local.set $_1 (call $u256_to_i32))
(local.set $p (call $u256_to_i32))
(local.set $r (i32.add (local.get $p) (i32.const 64)))
(if (i32.lt_u (local.get $r) (local.get $p)) (then
(unreachable)))
(call $eth.revert (local.get $r) (local.get $_1))
)
)
+6 -7
View File
@@ -35,9 +35,9 @@ object "C_3" {
======= viair_subobjects/input.sol:D =======
Binary:
608060405234156100105760006000fd5b61010d80610021600039806000f350fe6080604052600436101515610088576000803560e01c6326121ff0141561008657341561002a578081fd5b806003193601121561003a578081fd5b6028806080016080811067ffffffffffffffff8211171561005e5761005d6100cb565b5b50806100e560803980608083f01515610079573d82833e3d82fd5b508061008482610092565bf35b505b60006000fd6100e3565b60006040519050601f19601f830116810181811067ffffffffffffffff821117156100c0576100bf6100cb565b5b80604052505b919050565b634e487b7160e01b600052604160045260246000fd5b565bfe60806040523415600f5760006000fd5b600a80601e600039806000f350fe608060405260006000fd
608060405234156100105760006000fd5b60fb80610020600039806000f350fe6080604052600436101515610087576000803560e01c6326121ff0141561008557341561002a578081fd5b806003193601121561003a578081fd5b6028806080016080811067ffffffffffffffff8211171561005e5761005d6100b9565b5b50806100d360803980608083f01515610079573d82833e3d82fd5b5080610083610091565bf35b505b60006000fd6100d1565b6000604051905067ffffffffffffffff8111156100b1576100b06100b9565b5b806040525b90565b634e487b7160e01b600052604160045260246000fd5b565bfe60806040523415600f5760006000fd5b600a80601e600039806000f350fe608060405260006000fd
Binary of the runtime part:
6080604052600436101515610088576000803560e01c6326121ff0141561008657341561002a578081fd5b806003193601121561003a578081fd5b6028806080016080811067ffffffffffffffff8211171561005e5761005d6100cb565b5b50806100e560803980608083f01515610079573d82833e3d82fd5b508061008482610092565bf35b505b60006000fd6100e3565b60006040519050601f19601f830116810181811067ffffffffffffffff821117156100c0576100bf6100cb565b5b80604052505b919050565b634e487b7160e01b600052604160045260246000fd5b565bfe60806040523415600f5760006000fd5b600a80601e600039806000f350fe608060405260006000fd
6080604052600436101515610087576000803560e01c6326121ff0141561008557341561002a578081fd5b806003193601121561003a578081fd5b6028806080016080811067ffffffffffffffff8211171561005e5761005d6100b9565b5b50806100d360803980608083f01515610079573d82833e3d82fd5b5080610083610091565bf35b505b60006000fd6100d1565b6000604051905067ffffffffffffffff8111156100b1576100b06100b9565b5b806040525b90565b634e487b7160e01b600052604160045260246000fd5b565bfe60806040523415600f5760006000fd5b600a80601e600039806000f350fe608060405260006000fd
Optimized IR:
/*******************************************************
* WARNING *
@@ -76,17 +76,16 @@ object "D_16" {
returndatacopy(_1, _1, returndatasize())
revert(_1, returndatasize())
}
return(allocate_memory(_1), _1)
return(allocate_memory(), _1)
}
}
revert(0, 0)
}
function allocate_memory(size) -> memPtr
function allocate_memory() -> memPtr
{
memPtr := mload(64)
let newFreePtr := add(memPtr, and(add(size, 31), not(31)))
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
mstore(64, newFreePtr)
if gt(memPtr, 0xffffffffffffffff) { panic_error_0x41() }
mstore(64, memPtr)
}
function panic_error_0x41()
{