solidity/test/cmdlineTests/optimizer_array_sload/output

74 lines
3.1 KiB
Plaintext

Optimized IR:
/// @use-src 0:"optimizer_array_sload/input.sol"
object "Arraysum_34" {
code {
{
/// @src 0:80:429 "contract Arraysum {..."
let _1 := memoryguard(0x80)
mstore(64, _1)
if callvalue() { revert(0, 0) }
let _2 := datasize("Arraysum_34_deployed")
codecopy(_1, dataoffset("Arraysum_34_deployed"), _2)
return(_1, _2)
}
}
/// @use-src 0:"optimizer_array_sload/input.sol"
object "Arraysum_34_deployed" {
code {
{
/// @src 0:80:429 "contract Arraysum {..."
mstore(64, memoryguard(0x80))
let _1 := 4
if iszero(lt(calldatasize(), _1))
{
let _2 := 0
if eq(0x81d73423, shr(224, calldataload(_2)))
{
if callvalue() { revert(_2, _2) }
if slt(add(calldatasize(), not(3)), _2) { revert(_2, _2) }
let var_sum := _2
/// @src 0:368:378 "uint i = 0"
let var_i := /** @src 0:80:429 "contract Arraysum {..." */ _2
let _3 := sload(_2)
/// @src 0:364:423 "for(uint i = 0; i < values.length; i++)..."
for { }
/** @src 0:380:397 "i < values.length" */ lt(var_i, _3)
/// @src 0:368:378 "uint i = 0"
{
/// @src 0:80:429 "contract Arraysum {..."
if eq(var_i, not(0))
{
mstore(_2, shl(224, 0x4e487b71))
mstore(_1, 0x11)
revert(_2, 0x24)
}
/// @src 0:399:402 "i++"
var_i := /** @src 0:80:429 "contract Arraysum {..." */ add(var_i, 1)
}
/// @src 0:399:402 "i++"
{
/// @src 0:80:429 "contract Arraysum {..."
mstore(_2, _2)
let sum := add(var_sum, sload(add(18569430475105882587588266137607568536673111973893317399460219858819262702947, var_i)))
if gt(var_sum, sum)
{
mstore(_2, shl(224, 0x4e487b71))
mstore(_1, 0x11)
revert(_2, 0x24)
}
/// @src 0:407:423 "sum += values[i]"
var_sum := sum
}
/// @src 0:80:429 "contract Arraysum {..."
let memPos := mload(64)
mstore(memPos, var_sum)
return(memPos, 32)
}
}
revert(0, 0)
}
}
data ".metadata" hex"<BYTECODE REMOVED>"
}
}