mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
146 lines
6.4 KiB
Plaintext
146 lines
6.4 KiB
Plaintext
Optimized IR:
|
|
/*******************************************************
|
|
* WARNING *
|
|
* Solidity to Yul compilation is still EXPERIMENTAL *
|
|
* It can result in LOSS OF FUNDS or worse *
|
|
* !USE AT YOUR OWN RISK! *
|
|
*******************************************************/
|
|
|
|
object "C_59" {
|
|
code {
|
|
{
|
|
mstore(64, 128)
|
|
if callvalue() { revert(0, 0) }
|
|
let _1 := datasize("C_59_deployed")
|
|
codecopy(0, dataoffset("C_59_deployed"), _1)
|
|
return(0, _1)
|
|
}
|
|
}
|
|
object "C_59_deployed" {
|
|
code {
|
|
{
|
|
let _1 := 64
|
|
mstore(_1, 128)
|
|
if iszero(lt(calldatasize(), 4))
|
|
{
|
|
let _2 := 0
|
|
if eq(0xf8eddcc6, shr(224, calldataload(_2)))
|
|
{
|
|
if callvalue() { revert(_2, _2) }
|
|
let _3 := 32
|
|
if slt(add(calldatasize(), not(3)), _3) { revert(_2, _2) }
|
|
let offset := calldataload(4)
|
|
let _4 := 0xffffffffffffffff
|
|
if gt(offset, _4) { revert(_2, _2) }
|
|
if iszero(slt(add(offset, 35), calldatasize())) { revert(_2, _2) }
|
|
let _5 := calldataload(add(4, offset))
|
|
if gt(_5, _4) { panic_error_0x41() }
|
|
let _6 := mul(_5, _3)
|
|
let dst := allocateMemory(add(_6, _3))
|
|
let dst_1 := dst
|
|
mstore(dst, _5)
|
|
dst := add(dst, _3)
|
|
let src := add(offset, 36)
|
|
if gt(add(add(offset, _6), 36), calldatasize()) { revert(_2, _2) }
|
|
let i := _2
|
|
for { } lt(i, _5) { i := add(i, 1) }
|
|
{
|
|
if slt(sub(calldatasize(), src), _3) { revert(_2, _2) }
|
|
let memPtr := mload(_1)
|
|
let newFreePtr := add(memPtr, _3)
|
|
if or(gt(newFreePtr, _4), lt(newFreePtr, memPtr)) { panic_error_0x41() }
|
|
mstore(_1, newFreePtr)
|
|
mstore(memPtr, calldataload(src))
|
|
mstore(dst, memPtr)
|
|
dst := add(dst, _3)
|
|
src := add(src, _3)
|
|
}
|
|
let ret, ret_1 := fun_sumArray_58(dst_1)
|
|
let memPos := allocateMemory(_2)
|
|
return(memPos, sub(abi_encode_uint256_t_string(memPos, ret, ret_1), memPos))
|
|
}
|
|
}
|
|
revert(0, 0)
|
|
}
|
|
function abi_encode_uint256_t_string(headStart, value0, value1) -> tail
|
|
{
|
|
mstore(headStart, value0)
|
|
let _1 := 32
|
|
mstore(add(headStart, _1), 64)
|
|
let length := mload(value1)
|
|
mstore(add(headStart, 64), length)
|
|
let i := tail
|
|
for { } lt(i, length) { i := add(i, _1) }
|
|
{
|
|
mstore(add(add(headStart, i), 96), mload(add(add(value1, i), _1)))
|
|
}
|
|
if gt(i, length)
|
|
{
|
|
mstore(add(add(headStart, length), 96), tail)
|
|
}
|
|
tail := add(add(headStart, and(add(length, 31), not(31))), 96)
|
|
}
|
|
function allocateMemory(size) -> memPtr
|
|
{
|
|
memPtr := mload(64)
|
|
let newFreePtr := add(memPtr, size)
|
|
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
|
|
mstore(64, newFreePtr)
|
|
}
|
|
function convert_t_stringliteral_6490_to_t_string() -> converted
|
|
{
|
|
let memPtr := mload(64)
|
|
let newFreePtr := add(memPtr, 160)
|
|
if or(gt(newFreePtr, 0xffffffffffffffff), lt(newFreePtr, memPtr)) { panic_error_0x41() }
|
|
mstore(64, newFreePtr)
|
|
converted := memPtr
|
|
mstore(memPtr, 100)
|
|
mstore(add(memPtr, 32), "longstringlongstringlongstringlo")
|
|
mstore(add(memPtr, 64), "ngstringlongstringlongstringlong")
|
|
mstore(add(memPtr, 96), "stringlongstringlongstringlongst")
|
|
mstore(add(memPtr, 128), "ring")
|
|
}
|
|
function extract_from_storage_value_dynamict_uint256(slot_value, offset) -> value
|
|
{
|
|
value := shr(mul(offset, 8), slot_value)
|
|
}
|
|
function fun_sumArray_58(vloc__s_22_mpos) -> vloc, vloc__27_mpos
|
|
{
|
|
if iszero(lt(vloc, mload(vloc__s_22_mpos))) { panic_error_0x32() }
|
|
let _1 := mload(mload(add(add(vloc__s_22_mpos, mul(vloc, 32)), 32)))
|
|
let _2, _3 := storage_array_index_access$_t_struct$_S_storage(vloc, vloc)
|
|
sstore(_2, _1)
|
|
if iszero(lt(0x01, mload(vloc__s_22_mpos))) { panic_error_0x32() }
|
|
let _4 := mload(mload(add(vloc__s_22_mpos, 64)))
|
|
if iszero(lt(vloc, 0x02)) { panic_error_0x32() }
|
|
let slot := add(0x02, vloc)
|
|
let _5 := sload(slot)
|
|
let shiftBits := mul(vloc, 8)
|
|
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$_t_struct$_S_storage(0x02, vloc)
|
|
vloc := extract_from_storage_value_dynamict_uint256(sload(_6), _7)
|
|
vloc__27_mpos := convert_t_stringliteral_6490_to_t_string()
|
|
}
|
|
function panic_error_0x32()
|
|
{
|
|
mstore(0, shl(224, 0x4e487b71))
|
|
mstore(4, 0x32)
|
|
revert(0, 0x24)
|
|
}
|
|
function panic_error_0x41()
|
|
{
|
|
mstore(0, shl(224, 0x4e487b71))
|
|
mstore(4, 0x41)
|
|
revert(0, 0x24)
|
|
}
|
|
function storage_array_index_access$_t_struct$_S_storage(array, index) -> slot, offset
|
|
{
|
|
if iszero(lt(index, 0x02)) { panic_error_0x32() }
|
|
slot := add(array, index)
|
|
offset := offset
|
|
}
|
|
}
|
|
}
|
|
}
|