solidity/test/cmdlineTests/optimizer_array_sload/output

78 lines
3.0 KiB
Plaintext
Raw Normal View History

2020-07-03 14:20:27 +00:00
Optimized IR:
/*=====================================================*
2020-07-03 14:20:27 +00:00
* WARNING *
* Solidity to Yul compilation is still EXPERIMENTAL *
* It can result in LOSS OF FUNDS or worse *
* !USE AT YOUR OWN RISK! *
*=====================================================*/
2020-07-03 14:20:27 +00:00
2021-08-31 10:57:13 +00:00
/// @use-src 0:"optimizer_array_sload/input.sol"
object "Arraysum_34" {
2020-07-03 14:20:27 +00:00
code {
{
/// @src 0:80:429
mstore(64, 128)
2020-07-03 14:20:27 +00:00
if callvalue() { revert(0, 0) }
let _1 := datasize("Arraysum_34_deployed")
2021-04-29 09:43:27 +00:00
codecopy(128, dataoffset("Arraysum_34_deployed"), _1)
return(128, _1)
2020-07-03 14:20:27 +00:00
}
}
2021-08-31 10:57:13 +00:00
/// @use-src 0:"optimizer_array_sload/input.sol"
object "Arraysum_34_deployed" {
2020-07-03 14:20:27 +00:00
code {
{
/// @src 0:80:429
mstore(64, 128)
2020-07-03 14:20:27 +00:00
if iszero(lt(calldatasize(), 4))
{
let _1 := 0
if eq(0x81d73423, shr(224, calldataload(_1)))
{
if callvalue() { revert(_1, _1) }
if slt(add(calldatasize(), not(3)), _1) { revert(_1, _1) }
2021-01-25 15:57:25 +00:00
let var_sum := _1
/// @src 0:368:378
let var_i := /** @src 0:80:429 */ _1
2020-07-03 14:20:27 +00:00
let _2 := sload(_1)
/// @src 0:364:423
2020-07-03 14:20:27 +00:00
for { }
/** @src 0:380:397 */ lt(var_i, _2)
/// @src 0:368:378
2020-07-03 14:20:27 +00:00
{
/// @src 0:80:429
2021-01-25 15:57:25 +00:00
if eq(var_i, not(0)) { panic_error_0x11() }
/// @src 0:399:402
var_i := /** @src 0:80:429 */ add(var_i, 1)
2020-07-03 14:20:27 +00:00
}
/// @src 0:399:402
2020-07-03 14:20:27 +00:00
{
/// @src 0:80:429
mstore(_1, _1)
2021-04-19 09:33:04 +00:00
let _3 := sload(add(18569430475105882587588266137607568536673111973893317399460219858819262702947, var_i))
2021-04-13 10:13:45 +00:00
if gt(var_sum, not(_3)) { panic_error_0x11() }
/// @src 0:407:423
var_sum := /** @src 0:80:429 */ add(var_sum, _3)
2020-07-03 14:20:27 +00:00
}
let memPos := mload(64)
2021-01-25 15:57:25 +00:00
return(memPos, sub(abi_encode_uint256(memPos, var_sum), memPos))
2020-07-03 14:20:27 +00:00
}
}
revert(0, 0)
}
2021-01-25 15:57:25 +00:00
function abi_encode_uint256(headStart, value0) -> tail
2020-07-03 14:20:27 +00:00
{
tail := add(headStart, 32)
mstore(headStart, value0)
}
2020-10-13 11:28:39 +00:00
function panic_error_0x11()
{
mstore(0, shl(224, 0x4e487b71))
mstore(4, 0x11)
revert(0, 0x24)
}
2020-07-03 14:20:27 +00:00
}
2021-06-08 14:35:37 +00:00
data ".metadata" hex"<BYTECODE REMOVED>"
2020-07-03 14:20:27 +00:00
}
}