diff options
Diffstat (limited to 'test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul')
-rw-r--r-- | test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul index c8acf465..c909d39e 100644 --- a/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul +++ b/test/libyul/yulOptimizerTests/fullSuite/abi_example1.yul @@ -458,14 +458,14 @@ // ---- // fullSuite // { -// let _1 := 0x20 -// let _485 := mload(0) -// let abi_encode_pos := _1 +// let _2 := 0 +// let _485 := mload(_2) +// let abi_encode_pos := 0x20 // let abi_encode_length_68 := mload(_485) -// mstore(_1, abi_encode_length_68) +// mstore(0x20, abi_encode_length_68) // abi_encode_pos := 64 -// let abi_encode_srcPtr := add(_485, _1) -// let abi_encode_i_69 := 0 +// let abi_encode_srcPtr := add(_485, 0x20) +// let abi_encode_i_69 := _2 // for { // } // lt(abi_encode_i_69, abi_encode_length_68) @@ -473,28 +473,32 @@ // abi_encode_i_69 := add(abi_encode_i_69, 1) // } // { -// let _874 := mload(abi_encode_srcPtr) -// let abi_encode_pos_71_978 := abi_encode_pos -// let abi_encode_srcPtr_73_980 := _874 -// let abi_encode_i_74_981 := 0 -// for { -// } -// lt(abi_encode_i_74_981, 0x3) -// { -// abi_encode_i_74_981 := add(abi_encode_i_74_981, 1) -// } -// { -// mstore(abi_encode_pos_71_978, and(mload(abi_encode_srcPtr_73_980), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) -// abi_encode_srcPtr_73_980 := add(abi_encode_srcPtr_73_980, _1) -// abi_encode_pos_71_978 := add(abi_encode_pos_71_978, _1) -// } -// abi_encode_srcPtr := add(abi_encode_srcPtr, _1) +// abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(mload(abi_encode_srcPtr), abi_encode_pos) +// abi_encode_srcPtr := add(abi_encode_srcPtr, 0x20) // abi_encode_pos := add(abi_encode_pos, 0x60) // } -// let a, b, c, d := abi_decode_tuple_t_uint256t_uint256t_array$_t_uint256_$dyn_memory_ptrt_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(mload(_1), mload(0x40)) -// sstore(a, b) -// sstore(c, d) -// sstore(0, abi_encode_pos) +// let _487 := mload(0x40) +// let _488 := mload(0x20) +// if slt(sub(_487, _488), 128) +// { +// revert(_2, _2) +// } +// let abi_decode_offset_64 := calldataload(add(_488, 64)) +// let abi_decode__165 := 0xffffffffffffffff +// if gt(abi_decode_offset_64, abi_decode__165) +// { +// revert(_2, _2) +// } +// let abi_decode_value2_587 := abi_decode_t_array$_t_uint256_$dyn_memory_ptr(add(_488, abi_decode_offset_64), _487) +// let abi_decode_offset_65 := calldataload(add(_488, 96)) +// if gt(abi_decode_offset_65, abi_decode__165) +// { +// revert(_2, _2) +// } +// let abi_decode_value3_588 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(_488, abi_decode_offset_65), _487) +// sstore(calldataload(_488), calldataload(add(_488, 32))) +// sstore(abi_decode_value2_587, abi_decode_value3_588) +// sstore(_2, abi_encode_pos) // function abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(offset_3, end_4) -> array_5 // { // if iszero(slt(add(offset_3, 0x1f), end_4)) @@ -502,17 +506,23 @@ // revert(0, 0) // } // let length_6 := calldataload(offset_3) -// let array_5_254 := allocateMemory(array_allocation_size_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(length_6)) +// if gt(length_6, 0xffffffffffffffff) +// { +// revert(0, 0) +// } +// let array_allo__217 := 0x20 +// let array_5_254 := allocateMemory(add(mul(length_6, array_allo__217), array_allo__217)) // array_5 := array_5_254 // let dst_7 := array_5_254 // mstore(array_5_254, length_6) -// dst_7 := add(array_5_254, 0x20) -// let src_8 := add(offset_3, 0x20) -// if gt(add(add(offset_3, mul(length_6, 0x40)), 0x20), end_4) +// dst_7 := add(array_5_254, array_allo__217) +// let src_8 := add(offset_3, array_allo__217) +// if gt(add(add(offset_3, mul(length_6, 0x40)), array_allo__217), end_4) // { // revert(0, 0) // } -// let i_9 := 0 +// let i_9_566 := 0 +// let i_9 := i_9_566 // for { // } // lt(i_9, length_6) @@ -520,87 +530,85 @@ // i_9 := add(i_9, 1) // } // { -// mstore(dst_7, abi_decode_t_array$_t_uint256_$2_memory(src_8, end_4)) -// dst_7 := add(dst_7, 0x20) +// if iszero(slt(add(src_8, 0x1f), end_4)) +// { +// revert(i_9_566, i_9_566) +// } +// let abi_decode_array_13_263 := allocateMemory(array_allocation_size_t_array$_t_uint256_$2_memory(0x2)) +// let abi_decode_dst_15 := abi_decode_array_13_263 +// let abi_decode_src_16 := src_8 +// if gt(add(src_8, 64), end_4) +// { +// revert(i_9_566, i_9_566) +// } +// let abi_decode_i_17 := i_9_566 +// for { +// } +// lt(abi_decode_i_17, 0x2) +// { +// abi_decode_i_17 := add(abi_decode_i_17, 1) +// } +// { +// mstore(abi_decode_dst_15, calldataload(abi_decode_src_16)) +// abi_decode_dst_15 := add(abi_decode_dst_15, array_allo__217) +// abi_decode_src_16 := add(abi_decode_src_16, array_allo__217) +// } +// mstore(dst_7, abi_decode_array_13_263) +// dst_7 := add(dst_7, array_allo__217) // src_8 := add(src_8, 0x40) // } // } -// function abi_decode_t_array$_t_uint256_$2_memory(offset_11, end_12) -> array_13 +// function abi_decode_t_array$_t_uint256_$dyn_memory_ptr(offset_27, end_28) -> array_29 // { -// if iszero(slt(add(offset_11, 0x1f), end_12)) +// if iszero(slt(add(offset_27, 0x1f), end_28)) +// { +// revert(0, 0) +// } +// let length_30 := calldataload(offset_27) +// if gt(length_30, 0xffffffffffffffff) // { // revert(0, 0) // } -// let array_13_263 := allocateMemory(64) -// array_13 := array_13_263 -// let dst_15 := array_13_263 -// let src_16 := offset_11 -// if gt(add(offset_11, 64), end_12) +// let array_allo__234 := 0x20 +// let array_allo__560 := mul(length_30, array_allo__234) +// let array_29_279 := allocateMemory(add(array_allo__560, array_allo__234)) +// array_29 := array_29_279 +// let dst_31 := array_29_279 +// mstore(array_29_279, length_30) +// dst_31 := add(array_29_279, array_allo__234) +// let src_32 := add(offset_27, array_allo__234) +// if gt(add(add(offset_27, array_allo__560), array_allo__234), end_28) // { // revert(0, 0) // } -// let i_17 := 0 +// let i_33 := 0 // for { // } -// lt(i_17, 0x2) +// lt(i_33, length_30) // { -// i_17 := add(i_17, 1) +// i_33 := add(i_33, 1) // } // { -// mstore(dst_15, calldataload(src_16)) -// dst_15 := add(dst_15, 0x20) -// src_16 := add(src_16, 0x20) +// mstore(dst_31, calldataload(src_32)) +// dst_31 := add(dst_31, array_allo__234) +// src_32 := add(src_32, array_allo__234) // } // } -// function abi_decode_tuple_t_uint256t_uint256t_array$_t_uint256_$dyn_memory_ptrt_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(headStart_58, dataEnd_59) -> value0_60, value1_61, value2, value3 +// function abi_encode_t_array$_t_contract$_C_$55_$3_memory_to_t_array$_t_address_$3_memory_ptr(value_70, pos_71) // { -// if slt(sub(dataEnd_59, headStart_58), 128) -// { -// revert(value2, value2) -// } -// value0_60 := calldataload(add(headStart_58, value2)) -// value1_61 := calldataload(add(headStart_58, 32)) -// let offset_64 := calldataload(add(headStart_58, 64)) -// let _165 := 0xffffffffffffffff -// if gt(offset_64, _165) -// { -// revert(value2, value2) -// } -// let _532 := add(headStart_58, offset_64) -// if iszero(slt(add(_532, 0x1f), dataEnd_59)) -// { -// revert(value2, value2) -// } -// let abi_decode_length_30 := calldataload(_532) -// let abi_decode_array_29_279 := allocateMemory(array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(abi_decode_length_30)) -// let abi_decode_dst_31 := abi_decode_array_29_279 -// mstore(abi_decode_array_29_279, abi_decode_length_30) -// let abi_decode__91 := 0x20 -// abi_decode_dst_31 := add(abi_decode_array_29_279, abi_decode__91) -// let abi_decode_src_32 := add(_532, abi_decode__91) -// if gt(add(add(_532, mul(abi_decode_length_30, abi_decode__91)), abi_decode__91), dataEnd_59) -// { -// revert(value2, value2) -// } -// let abi_decode_i_33 := value2 +// let srcPtr_73 := value_70 +// let i_74 := 0 // for { // } -// lt(abi_decode_i_33, abi_decode_length_30) +// lt(i_74, 0x3) // { -// abi_decode_i_33 := add(abi_decode_i_33, 1) +// i_74 := add(i_74, 1) // } // { -// mstore(abi_decode_dst_31, calldataload(abi_decode_src_32)) -// abi_decode_dst_31 := add(abi_decode_dst_31, abi_decode__91) -// abi_decode_src_32 := add(abi_decode_src_32, abi_decode__91) +// mstore(pos_71, and(mload(srcPtr_73), 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) +// srcPtr_73 := add(srcPtr_73, 0x20) +// pos_71 := add(pos_71, 0x20) // } -// value2 := abi_decode_array_29_279 -// let offset_65 := calldataload(add(headStart_58, 96)) -// if gt(offset_65, _165) -// { -// revert(0, 0) -// } -// value3 := abi_decode_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(add(headStart_58, offset_65), dataEnd_59) // } // function allocateMemory(size) -> memPtr // { @@ -613,20 +621,12 @@ // } // mstore(64, newFreePtr) // } -// function array_allocation_size_t_array$_t_array$_t_uint256_$2_memory_$dyn_memory_ptr(length_92) -> size_93 -// { -// if gt(length_92, 0xffffffffffffffff) -// { -// revert(0, 0) -// } -// size_93 := add(mul(length_92, 0x20), 0x20) -// } -// function array_allocation_size_t_array$_t_uint256_$dyn_memory_ptr(length_98) -> size_99 +// function array_allocation_size_t_array$_t_uint256_$2_memory(length_94) -> size_95 // { -// if gt(length_98, 0xffffffffffffffff) +// if gt(length_94, 0xffffffffffffffff) // { // revert(0, 0) // } -// size_99 := add(mul(length_98, 0x20), 0x20) +// size_95 := mul(length_94, 0x20) // } // } |