diff --git a/libsolutil/CMakeLists.txt b/libsolutil/CMakeLists.txt index 01749c02bf66..70f98804db53 100644 --- a/libsolutil/CMakeLists.txt +++ b/libsolutil/CMakeLists.txt @@ -23,6 +23,8 @@ set(sources Keccak256.h LazyInit.h LEB128.h + logging.cpp + logging.h Numeric.cpp Numeric.h picosha2.h diff --git a/libsolutil/logging.cpp b/libsolutil/logging.cpp new file mode 100644 index 000000000000..58824ba1d507 --- /dev/null +++ b/libsolutil/logging.cpp @@ -0,0 +1,89 @@ +#include + +#include +#include +#include + +using namespace solidity; + +struct Registry::Impl { + std::map, std::less<>> loggers; + // Preset levels: applied to new loggers on creation (most specific match wins) + std::vector> presets; + std::FILE* output = stderr; + + LogLevel resolve_level(std::string const& name) const { + LogLevel result = LogLevel::info; + std::size_t best_match = 0; + bool matched = false; + for (auto const& [prefix, level] : presets) { + if (prefix.empty() || name == prefix || name.starts_with(prefix + ".")) { + if (!matched || prefix.size() >= best_match) { + best_match = prefix.size(); + result = level; + matched = true; + } + } + } + return result; + } +}; + +Registry::Registry() : m_impl(std::make_unique()) {} +Registry::~Registry() = default; + +Registry& Registry::instance() { + static Registry reg; + return reg; +} + +Logger& Registry::get(std::string const& name) { + auto it = m_impl->loggers.find(name); + if (it != m_impl->loggers.end()) + return *it->second; + + auto level = m_impl->resolve_level(name); + auto logger = std::make_unique(name, level, m_impl->output); + auto& ref = *logger; + m_impl->loggers.emplace(name, std::move(logger)); + return ref; +} + +void Registry::set_level(std::string_view prefix, LogLevel level) { + // Store as preset for future loggers + std::string key(prefix); + bool found = false; + for (auto& [p, l] : m_impl->presets) { + if (p == key) { l = level; found = true; break; } + } + if (!found) + m_impl->presets.emplace_back(key, level); + + // Apply to existing loggers + for (auto& [name, logger] : m_impl->loggers) { + if (key.empty() || name == prefix || name.starts_with(key + ".")) + logger->set_level(level); + } +} + +void Registry::set_output(std::FILE* output) { + m_impl->output = output; +} + +void Registry::clear() { + m_impl->loggers.clear(); +} + +namespace solidity { + +std::optional parseLogLevel(std::string_view s) { + if (s == "trace") return LogLevel::trace; + if (s == "debug") return LogLevel::debug; + if (s == "info") return LogLevel::info; + if (s == "warn") return LogLevel::warn; + if (s == "error") return LogLevel::error; + if (s == "off") return LogLevel::off; + return std::nullopt; +} + +} diff --git a/libsolutil/logging.h b/libsolutil/logging.h new file mode 100644 index 000000000000..dd9704e3a7c1 --- /dev/null +++ b/libsolutil/logging.h @@ -0,0 +1,102 @@ +#pragma once + +#include + +#include + +#include +#include +#include +#include +#include + +namespace solidity +{ + +enum class LogLevel : std::uint8_t { trace = 0, debug = 1, info = 2, warn = 3, error = 4, off = 5 }; + +/// Guard macro: skips argument evaluation when the logger's level is too low. +/// SOL_LOG(logger, debug, "x={} y={}", expensive1(), expensive2()); +#define SOL_LOG(logger, lvl, ...) \ + do { if ((logger).should_log(::solidity::LogLevel::lvl)) [[unlikely]] (logger).lvl(__VA_ARGS__); } while (0) + +class Logger { +public: + explicit Logger(std::string name, LogLevel level = LogLevel::info, std::FILE* output = stdout) + : m_name(std::move(name)), + m_level(static_cast(level)), + m_output(output) {} + + [[nodiscard]] bool should_log(LogLevel level) const noexcept { + return static_cast(level) >= m_level; + } + + void set_level(LogLevel level) noexcept { + m_level = static_cast(level); + } + + [[nodiscard]] LogLevel level() const noexcept { + return static_cast(m_level); + } + + [[nodiscard]] std::string const& name() const noexcept { return m_name; } + + void set_output(std::FILE* output) noexcept { m_output = output; } + + template + void log(LogLevel const level, fmt::format_string fmt, Args&&... args) const { + if (!should_log(level)) + return; + fmt::print(m_output, fmt, std::forward(args)...); + } + + template + SOL_NOINLINE void trace(fmt::format_string fmt, Args&&... args) const { + log(LogLevel::trace, fmt, std::forward(args)...); + } + + template + SOL_NOINLINE void debug(fmt::format_string fmt, Args&&... args) const { + log(LogLevel::debug, fmt, std::forward(args)...); + } + + template + SOL_NOINLINE void info(fmt::format_string fmt, Args&&... args) const { + log(LogLevel::info, fmt, std::forward(args)...); + } + + template + SOL_NOINLINE void warn(fmt::format_string fmt, Args&&... args) const { + log(LogLevel::warn, fmt, std::forward(args)...); + } + + template + SOL_NOINLINE void error(fmt::format_string fmt, Args&&... args) const { + log(LogLevel::error, fmt, std::forward(args)...); + } + +private: + std::string m_name; + std::uint8_t m_level; + std::FILE* m_output; +}; + +class Registry { +public: + static Registry& instance(); + + Logger& get(std::string const& name); + void set_level(std::string_view prefix, LogLevel level); + void set_output(std::FILE* output); + void clear(); + +private: + Registry(); + ~Registry(); + struct Impl; + std::unique_ptr m_impl; +}; + +std::optional parseLogLevel(std::string_view s); + +} diff --git a/libyul/backends/evm/ssa/CodeTransform.cpp b/libyul/backends/evm/ssa/CodeTransform.cpp index caca86153f8b..1bf26931db4a 100644 --- a/libyul/backends/evm/ssa/CodeTransform.cpp +++ b/libyul/backends/evm/ssa/CodeTransform.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -34,6 +35,34 @@ using namespace solidity::yul::ssa; namespace { + +solidity::Logger const& log() +{ + static solidity::Logger const& instance = solidity::Registry::instance().get("yul.ssa.codetransform"); + return instance; +} + +solidity::Logger const& logDot() +{ + static solidity::Logger const& instance = solidity::Registry::instance().get("yul.ssa.codetransform.dot"); + return instance; +} + +solidity::Logger const& logShuffler() +{ + static solidity::Logger const& instance = solidity::Registry::instance().get("yul.ssa.codetransform.shuffler"); + return instance; +} + +std::string operationName(SSACFG::Operation const& _operation) +{ + return std::visit(solidity::util::GenericVisitor{ + [](SSACFG::Call const& _call) { return _call.function.get().name.str(); }, + [](SSACFG::BuiltinCall const& _call) { return _call.builtin.get().name; }, + [](SSACFG::LiteralAssignment const&) -> std::string { return "assign"; } + }, _operation.kind); +} + void assertLayoutCompatibility(StackData const& _layout1, StackData const& _layout2) { auto const compatibility = checkLayoutCompatibility(_layout1, _layout2); @@ -41,6 +70,58 @@ void assertLayoutCompatibility(StackData const& _layout1, StackData const& _layo } } +void AssemblyCallbacks::swap(StackDepth const _depth) +{ + logShuffler().debug("SWAP{} ", _depth.value); + assembly->appendInstruction(evmasm::swapInstruction(static_cast(_depth.value))); +} + +void AssemblyCallbacks::pop() +{ + logShuffler().debug("POP "); + assembly->appendInstruction(evmasm::Instruction::POP); +} + +void AssemblyCallbacks::push(StackSlot const& _slot) +{ + logShuffler().debug("PUSH({}) ", slotToString(_slot)); + switch (_slot.kind()) + { + case StackSlot::Kind::ValueID: + { + auto const id = _slot.valueID(); + yulAssert(id.isLiteral(), fmt::format("Tried bringing up v{}", id.value())); + assembly->appendConstant(cfg->literalInfo(id).value); + return; + } + case StackSlot::Kind::Junk: + { + if (assembly->evmVersion().hasPush0()) + assembly->appendConstant(0); + else + assembly->appendInstruction(evmasm::Instruction::CODESIZE); + return; + } + case StackSlot::Kind::FunctionCallReturnLabel: + { + auto const& call = callSites->functionCall(_slot.functionCallReturnLabel()); + yulAssert(returnLabels->count(&call), "FunctionCallReturnLabel not pre-registered before shuffle."); + assembly->appendLabelReference(returnLabels->at(&call)); + return; + } + case StackSlot::Kind::FunctionReturnLabel: + { + yulAssert(false, "Cannot produce function return label."); + } + } +} + +void AssemblyCallbacks::dup(StackDepth const _depth) +{ + logShuffler().debug("DUP{} ", _depth.value); + assembly->appendInstruction(evmasm::dupInstruction(static_cast(_depth.value))); +} + void CodeTransform::run ( AbstractAssembly& _assembly, @@ -48,6 +129,12 @@ void CodeTransform::run BuiltinContext& _builtinContext ) { + log().debug("\n\n\n"); + log().debug("--------------------\n"); + log().debug("Running SSA CFG code transform\n"); + log().debug("--------------------\n"); + SOL_LOG(logDot(), debug, "{}\n", _controlFlowLiveness.toDot()); + yulAssert(!_controlFlowLiveness.cfgLiveness.empty()); ControlFlow const& controlFlow = _controlFlowLiveness.controlFlow.get(); yulAssert(controlFlow.functionGraphs.size() == _controlFlowLiveness.cfgLiveness.size()); @@ -143,6 +230,8 @@ CodeTransform::CodeTransform( }()), m_stack(m_stackData, m_assemblyCallbacks) { + log().debug("Code transform for {}\n", m_cfg.function ? m_cfg.function->name.str() : "main"); + if (_function) { auto const findIt = m_functionLabels.find(_function); @@ -165,6 +254,7 @@ void CodeTransform::operator()(SSACFG::BlockId const _blockId) m_blockIsTransformed[_blockId.value] = true; m_assembly.appendLabel(m_blockLabels[_blockId.value]); + log().debug("\tGenerating for Block {} with label {}\n", _blockId.value, m_blockLabels[_blockId.value]); auto const& blockLayout = m_stackLayout[_blockId]; yulAssert(blockLayout); @@ -178,6 +268,8 @@ void CodeTransform::operator()(SSACFG::BlockId const _blockId) { auto const& operationInLayout = blockLayout->operationIn[operationIndex]; + SOL_LOG(log(), debug, "\t\t{}: {} -> {}\n", operationName(m_cfg.operation(block.operations[operationIndex])), stackToString(m_stack.data()), stackToString(operationInLayout)); + // perform the operation (*this)(block.operations[operationIndex], operationInLayout); } @@ -185,7 +277,9 @@ void CodeTransform::operator()(SSACFG::BlockId const _blockId) // Shuffle to the block's exit layout before dispatching the exit. // This ensures the condition is on top for ConditionalJump, phi pre-images are // in the right positions for jumps, and return values are accessible for FunctionReturn. + logShuffler().debug("\t\t\tshuffling: "); auto const shuffleResult = StackShuffler::shuffle(m_stack, blockLayout->exitIn); + logShuffler().debug("\n"); yulAssert(shuffleResult.status == StackShufflerResult::Status::Admissible); // handle the block exit @@ -211,7 +305,9 @@ void CodeTransform::operator()(SSACFG::OperationId _opId, StackData const& _oper // prepare stack for operation { + logShuffler().debug("\t\t\tshuffling: "); auto const shuffleResult = StackShuffler::shuffle(m_stack, _operationInputLayout); + logShuffler().debug("\n"); yulAssert(shuffleResult.status == StackShufflerResult::Status::Admissible); } @@ -254,6 +350,7 @@ void CodeTransform::operator()(SSACFG::OperationId _opId, StackData const& _oper // generate code for the operation std::visit(util::GenericVisitor{ [&](SSACFG::BuiltinCall const& _builtin) { + SOL_LOG(log(), debug, "\t\t\tBuiltin call: {}: {}", _builtin.builtin.get().name, stackToString(m_stack.data())); m_assembly.setSourceLocation(opOriginLocation); static_cast(_builtin.builtin.get()).generateCode( _builtin.call, @@ -265,6 +362,17 @@ void CodeTransform::operator()(SSACFG::OperationId _opId, StackData const& _oper auto const* returnLabel = util::valueOrNullptr(m_returnLabels, &_call.call.get()); // check that if we have a return label, the call can continue yulAssert(!!returnLabel == _call.canContinue); + if (returnLabel) + SOL_LOG(log(), debug, "\t\t\tCall: {} (label={}): {}, returnLabel: {}", + _call.function.get().name.str(), + m_functionLabels.at(&_call.function.get()), + stackToString(m_stack.data()), + *returnLabel); + else + SOL_LOG(log(), debug, "\t\t\tCall: {} (label={}): {}", + _call.function.get().name.str(), + m_functionLabels.at(&_call.function.get()), + stackToString(m_stack.data())); m_assembly.setSourceLocation(opOriginLocation); m_assembly.appendJumpTo( m_functionLabels.at(&_call.function.get()), @@ -280,7 +388,9 @@ void CodeTransform::operator()(SSACFG::OperationId _opId, StackData const& _oper m_stack.pop(); } }, - [&](SSACFG::LiteralAssignment const&){} + [&](SSACFG::LiteralAssignment const&) { + SOL_LOG(log(), debug, "\t\t\tLiteral assignment: {}", stackToString(m_stack.data())); + } }, _operation.kind); // simulate that the inputs are consumed for (size_t i = 0; i < _operation.inputs.size(); ++i) @@ -289,6 +399,8 @@ void CodeTransform::operator()(SSACFG::OperationId _opId, StackData const& _oper for (auto value: _operation.outputs) m_stack.push(StackSlot::makeValueID(value)); + SOL_LOG(log(), debug, " -> {}\n", stackToString(m_stack.data())); + // Assert that the operation produced its proclaimed output. yulAssert(m_stack.size() == baseHeight + _operation.outputs.size()); for (auto const& [stackEntry, output]: ranges::views::zip( @@ -323,6 +435,11 @@ void CodeTransform::operator()(SSACFG::BlockId const& _currentBlock, SSACFG::Bas ScopedSaveAndRestore restoreStack(m_stackData, StackData(m_stackData)); yulAssert(m_stackLayout[_conditionalJump.zero]); + SOL_LOG(log(), debug, "\t\tJUMPI creating stack for zero layout (to Block {}) {} -> {}\n", + _conditionalJump.zero.value, + stackToString(m_stack.data()), + stackToString(m_stackLayout[_conditionalJump.zero]->stackIn)); + // transform stack to a state in which we can jump to the zero branch prepareBlockExitStack( m_stackLayout[_conditionalJump.zero]->stackIn, @@ -347,6 +464,7 @@ void CodeTransform::operator()(SSACFG::BlockId const& _currentBlock, SSACFG::Bas void CodeTransform::operator()(SSACFG::BlockId const& _currentBlock, SSACFG::BasicBlock::Jump const& _jump) { yulAssert(static_cast(m_stack.size()) == m_assembly.stackHeight()); + log().debug("\t\tJUMP creating target stack for jump {} -> {}\n", _currentBlock.value, _jump.target.value); yulAssert(m_stackLayout[_jump.target]); prepareBlockExitStack(m_stackLayout[_jump.target]->stackIn, PhiInverse(m_cfg, _currentBlock, _jump.target)); assertLayoutCompatibility(m_stack.data(), m_stackLayout[_jump.target]->stackIn); @@ -400,7 +518,9 @@ void CodeTransform::prepareBlockExitStack(StackData const& _target, PhiInverse c auto const pulledBackTarget = stackPreImage(_target, _phiInverse); // shuffle to target { + logShuffler().debug("\t\t\tshuffling: "); auto const shuffleResult = StackShuffler::shuffle(m_stack, pulledBackTarget); + logShuffler().debug("\n"); yulAssert(shuffleResult.status == StackShufflerResult::Status::Admissible); } // check that shuffling was successful diff --git a/libyul/backends/evm/ssa/CodeTransform.h b/libyul/backends/evm/ssa/CodeTransform.h index 48d74ffd66be..4ec2f7d7ff67 100644 --- a/libyul/backends/evm/ssa/CodeTransform.h +++ b/libyul/backends/evm/ssa/CodeTransform.h @@ -35,53 +35,10 @@ namespace solidity::yul::ssa struct AssemblyCallbacks { - void swap(StackDepth const _depth) - { - assembly->appendInstruction(evmasm::swapInstruction(static_cast(_depth.value))); - } - - void pop() - { - assembly->appendInstruction(evmasm::Instruction::POP); - } - - void push(StackSlot const& _slot) - { - switch (_slot.kind()) - { - case StackSlot::Kind::ValueID: - { - auto const id = _slot.valueID(); - yulAssert(id.isLiteral(), fmt::format("Tried bringing up v{}", id.value())); - assembly->appendConstant(cfg->literalInfo(id).value); - return; - } - case StackSlot::Kind::Junk: - { - if (assembly->evmVersion().hasPush0()) - assembly->appendConstant(0); - else - assembly->appendInstruction(evmasm::Instruction::CODESIZE); - return; - } - case StackSlot::Kind::FunctionCallReturnLabel: - { - auto const& call = callSites->functionCall(_slot.functionCallReturnLabel()); - yulAssert(returnLabels->count(&call), "FunctionCallReturnLabel not pre-registered before shuffle."); - assembly->appendLabelReference(returnLabels->at(&call)); - return; - } - case StackSlot::Kind::FunctionReturnLabel: - { - yulAssert(false, "Cannot produce function return label."); - } - } - } - - void dup(StackDepth const _depth) - { - assembly->appendInstruction(evmasm::dupInstruction(static_cast(_depth.value))); - } + void swap(StackDepth _depth); + void pop(); + void push(StackSlot const& _slot); + void dup(StackDepth _depth); SSACFG const* cfg{}; AbstractAssembly* assembly{}; diff --git a/libyul/backends/evm/ssa/StackLayoutGenerator.cpp b/libyul/backends/evm/ssa/StackLayoutGenerator.cpp index ff6b896c609c..c07686811226 100644 --- a/libyul/backends/evm/ssa/StackLayoutGenerator.cpp +++ b/libyul/backends/evm/ssa/StackLayoutGenerator.cpp @@ -37,6 +37,28 @@ using namespace solidity::yul::ssa; namespace { + +solidity::Logger const& log() +{ + static solidity::Logger const& instance = solidity::Registry::instance().get("yul.ssa.stacklayout"); + return instance; +} + +solidity::Logger const& logShuffler() +{ + static solidity::Logger const& instance = solidity::Registry::instance().get("yul.ssa.stacklayout.shuffler"); + return instance; +} + +std::string operationName(SSACFG::Operation const& _operation) +{ + return std::visit(solidity::util::GenericVisitor{ + [](SSACFG::Call const& _call) { return _call.function.get().name.str(); }, + [](SSACFG::BuiltinCall const& _call) { return _call.builtin.get().name; }, + [](SSACFG::LiteralAssignment const&) -> std::string { return "assign"; } + }, _operation.kind); +} + void handlePhiFunctions(StackData& _stackData, PhiInverse const& _phiInverse, LivenessAnalysis::LivenessData const& _liveness) { // add any phi function values here that are not already contained in the stack @@ -85,6 +107,7 @@ SSACFGStackLayout StackLayoutGenerator::generate( ControlFlow::FunctionGraphID const _graphID ) { + log().debug("Stack layout for {}\n", _liveness.cfg().function ? _liveness.cfg().function->name.str() : "main graph"); return StackLayoutGenerator(_liveness, _callSites, _graphID).m_resultLayout; } @@ -225,6 +248,8 @@ void StackLayoutGenerator::visitBlock(SSACFG::BlockId const& _blockId) StackType stack(currentStackData, {}); bool const junkCanBeAdded = m_junkAdmittingBlocksFinder->allowsAdditionOfJunk(_blockId); + SOL_LOG(log(), debug, "\tBlock {} (junk={}, stackIn={})\n", _blockId, junkCanBeAdded, stackToString(currentStackData)); + auto const& operationsLiveOut = m_liveness.operationsLiveOut(_blockId); blockLayout.operationIn.reserve(block.operations.size()); for (std::size_t operationIndex = 0; operationIndex < block.operations.size(); ++operationIndex) @@ -253,6 +278,7 @@ void StackLayoutGenerator::visitBlock(SSACFG::BlockId const& _blockId) ) stack.declareJunk(depth); + SOL_LOG(log(), debug, "\t\t{}: {} -> {}\n", operationName(operation), stackToString(currentStackData), stackToString(requiredStackTop)); std::size_t const targetSize = findOptimalTargetSize( stack.data(), requiredStackTop, @@ -260,6 +286,7 @@ void StackLayoutGenerator::visitBlock(SSACFG::BlockId const& _blockId) junkCanBeAdded, m_hasFunctionReturnLabel ); + logShuffler().debug("\t\t\tshuffling: "); { auto const shuffleResult = StackShuffler::shuffle( stack, @@ -267,6 +294,8 @@ void StackLayoutGenerator::visitBlock(SSACFG::BlockId const& _blockId) opLiveOutWithoutOutputs, targetSize ); + logShuffler().debug("\n"); + SOL_LOG(log(), debug, "\t\t\tshuffled to: {}\n", stackToString(stack.data())); yulAssert(shuffleResult.status == StackShufflerResult::Status::Admissible); } @@ -275,6 +304,7 @@ void StackLayoutGenerator::visitBlock(SSACFG::BlockId const& _blockId) stack.pop(); for (auto const& val: operation.outputs) stack.push(Slot::makeValueID(val)); + SOL_LOG(log(), debug, "\t\t\tresult: {}\n", stackToString(currentStackData)); } std::visit( @@ -339,4 +369,5 @@ void StackLayoutGenerator::visitBlock(SSACFG::BlockId const& _blockId) }, block.exit ); + SOL_LOG(log(), debug, "\t\tstack out = {}\n", stackToString(currentStackData)); } diff --git a/libyul/backends/evm/ssa/StackUtils.h b/libyul/backends/evm/ssa/StackUtils.h index 47dc6711a79a..ca0797d1b4cb 100644 --- a/libyul/backends/evm/ssa/StackUtils.h +++ b/libyul/backends/evm/ssa/StackUtils.h @@ -21,6 +21,8 @@ #include #include +#include + #include #include diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index a805ac3fe598..d4cb7b6e8b74 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -55,6 +55,7 @@ #include #include #include +#include #include #include @@ -813,6 +814,9 @@ bool CommandLineInterface::parseArguments(int _argc, char const* const* _argv) } m_options = parser.options(); + if (m_options.logLevel) + Registry::instance().set_level("", *m_options.logLevel); + return true; } diff --git a/solc/CommandLineParser.cpp b/solc/CommandLineParser.cpp index 08260a6fb803..f93d441daf03 100644 --- a/solc/CommandLineParser.cpp +++ b/solc/CommandLineParser.cpp @@ -32,6 +32,8 @@ #include +#include + using namespace solidity::langutil; using namespace solidity::yul; @@ -92,6 +94,7 @@ static std::string const g_strYulOptimizations = "yul-optimizations"; static std::string const g_strOutputDir = "output-dir"; static std::string const g_strOverwrite = "overwrite"; static std::string const g_strRevertStrings = "revert-strings"; +static std::string const g_strLogLevel = "log-level"; static std::string const g_strStopAfter = "stop-after"; /// Possible arguments to for --revert-strings @@ -754,6 +757,11 @@ General Information)").c_str(), g_strErrorIds.c_str(), "Output error codes." ) + ( + g_strLogLevel.c_str(), + po::value()->value_name("level"), + "Set global log level (trace, debug, info, warn, error, off)." + ) ; desc.add(outputFormatting); @@ -1168,6 +1176,36 @@ void CommandLineParser::processArgs() m_options.formatting.withErrorIds = m_args.count(g_strErrorIds); + if (m_args.contains(g_strLogLevel)) + { + std::string levelStr = m_args[g_strLogLevel].as(); + auto level = parseLogLevel(levelStr); + if (!level) + solThrow( + CommandLineValidationError, + "Invalid option for --" + g_strLogLevel + ": " + levelStr + + ". Valid options: trace, debug, info, warn, error, off." + ); + m_options.logLevel = *level; + } + // Check if env VAR is defined + else if(char const* levelValue = std::getenv("SOLC_LOG_LEVEL")) + { + if (levelValue) + { + std::string logLevelStr = std::string(levelValue); + auto level = parseLogLevel(logLevelStr); + if (!level.has_value()) + solThrow( + CommandLineValidationError, + "Invalid option for ENV VAR SOLC_LOG_LEVEL: " + logLevelStr + + ". Valid options: trace, debug, info, warn, error, off." + ); + + m_options.logLevel = *level; + } + } + if (m_args.count(g_strRevertStrings)) { std::string revertStringsString = m_args[g_strRevertStrings].as(); diff --git a/solc/CommandLineParser.h b/solc/CommandLineParser.h index 96dbb49c3dce..7eab089406e8 100644 --- a/solc/CommandLineParser.h +++ b/solc/CommandLineParser.h @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -274,6 +275,8 @@ struct CommandLineOptions } modelChecker; bool experimental = false; + + std::optional logLevel; }; /// Parses the command-line arguments and produces a filled-out CommandLineOptions structure. diff --git a/test/cmdlineTests/via_ssa_debug_log_level/args b/test/cmdlineTests/via_ssa_debug_log_level/args new file mode 100644 index 000000000000..d6cf91cc8e14 --- /dev/null +++ b/test/cmdlineTests/via_ssa_debug_log_level/args @@ -0,0 +1 @@ +--experimental --via-ssa-cfg --bin --log-level debug diff --git a/test/cmdlineTests/via_ssa_debug_log_level/err b/test/cmdlineTests/via_ssa_debug_log_level/err new file mode 100644 index 000000000000..f3be7d0d2b80 --- /dev/null +++ b/test/cmdlineTests/via_ssa_debug_log_level/err @@ -0,0 +1,1611 @@ + + +-------------------- +Running SSA CFG code transform +-------------------- +digraph SSACFG { +nodesep=0.7; +graph[fontname="DejaVu Sans"] +node[shape=box,fontname="DejaVu Sans"]; + +Entry [label="Entry"]; +Entry -> Block0_0; +Block0_0 [label="\ +Block 0; (0, max 5)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv0 := memoryguard()\l\ +mstore(v0, 0x40)\l\ +v1 := calldatasize()\l\ +v2 := lt(0x04, v1)\l\ +v3 := iszero(v2)\l\ +"]; +Block0_0 -> Block0_0Exit; +Block0_0Exit [label="{ If v3 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block0_0Exit:0 -> Block0_2 [style="solid"]; +Block0_0Exit:1 -> Block0_1 [style="solid"]; +Block0_1 [label="\ +Block 1; (1, max 5)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv4 := calldataload(0x00)\l\ +v5 := shift_right_unsigned(v4)\l\ +v6 := eq(0xb3de648b, v5)\l\ +"]; +Block0_1 -> Block0_1Exit; +Block0_1Exit [label="{ If v6 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block0_1Exit:0 -> Block0_5 [style="solid"]; +Block0_1Exit:1 -> Block0_4 [style="solid"]; +Block0_2 [fillcolor="#FF746C", style=filled, label="\ +Block 2; (5, max 5)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()\l\ +"]; +Block0_2Exit [label="Terminated"]; +Block0_2 -> Block0_2Exit; +Block0_4 [fillcolor="#FF746C", style=filled, label="\ +Block 4; (2, max 2)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nexternal_fun_f()\l\ +"]; +Block0_4Exit [label="Terminated"]; +Block0_4 -> Block0_4Exit; +Block0_5 [label="\ +Block 5; (3, max 5)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\n"]; +Block0_5 -> Block0_5Exit [arrowhead=none]; +Block0_5Exit [label="Jump" shape=oval]; +Block0_5Exit -> Block0_3 [style="solid"]; +Block0_3 [label="\ +Block 3; (4, max 5)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\n"]; +Block0_3 -> Block0_3Exit [arrowhead=none]; +Block0_3Exit [label="Jump" shape=oval]; +Block0_3Exit -> Block0_2 [style="solid"]; +FunctionEntry_shift_right_unsigned_0 [label="function shift_right_unsigned: + newValue := shift_right_unsigned(v0)"]; +FunctionEntry_shift_right_unsigned_0 -> Block1_0; +Block1_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v1[1]\l\nUsed: v0[1]\l\nv1 := shr(v0, 0xe0)\l\ +"]; +Block1_0Exit [label="FunctionReturn[v1]"]; +Block1_0 -> Block1_0Exit; +FunctionEntry_allocate_unbounded_0 [label="function allocate_unbounded: + memPtr := allocate_unbounded()"]; +FunctionEntry_allocate_unbounded_0 -> Block2_0; +Block2_0 [label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: v0[1]\l\nUsed: \l\nv0 := mload(0x40)\l\ +"]; +Block2_0Exit [label="FunctionReturn[v0]"]; +Block2_0 -> Block2_0Exit; +FunctionEntry_revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb_0 [label="function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb: + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()"]; +FunctionEntry_revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb_0 -> Block3_0; +Block3_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert(0x00, 0x00)\l\ +"]; +Block3_0Exit [label="Terminated"]; +Block3_0 -> Block3_0Exit; +FunctionEntry_revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b_0 [label="function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b: + revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b()"]; +FunctionEntry_revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b_0 -> Block4_0; +Block4_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert(0x00, 0x00)\l\ +"]; +Block4_0Exit [label="Terminated"]; +Block4_0 -> Block4_0Exit; +FunctionEntry_cleanup_uint256_0 [label="function cleanup_uint256: + cleaned := cleanup_uint256(v0)"]; +FunctionEntry_cleanup_uint256_0 -> Block5_0; +Block5_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2]\l\ +LiveOut: v0[1]\l\nUsed: v0[1]\l\n"]; +Block5_0Exit [label="FunctionReturn[v0]"]; +Block5_0 -> Block5_0Exit; +FunctionEntry_validator_revert_uint256_0 [label="function validator_revert_uint256: + validator_revert_uint256(v0)"]; +FunctionEntry_validator_revert_uint256_0 -> Block6_0; +Block6_0 [label="\ +Block 0; (0, max 2)\nLiveIn: v0[2]\l\ +LiveOut: \l\nUsed: v0[2]\l\nv1 := cleanup_uint256(v0)\l\ +v2 := eq(v1, v0)\l\ +v3 := iszero(v2)\l\ +"]; +Block6_0 -> Block6_0Exit; +Block6_0Exit [label="{ If v3 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block6_0Exit:0 -> Block6_2 [style="solid"]; +Block6_0Exit:1 -> Block6_1 [style="solid"]; +Block6_1 [fillcolor="#FF746C", style=filled, label="\ +Block 1; (1, max 1)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert(0x00, 0x00)\l\ +"]; +Block6_1Exit [label="Terminated"]; +Block6_1 -> Block6_1Exit; +Block6_2 [label="\ +Block 2; (2, max 2)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\n"]; +Block6_2Exit [label="FunctionReturn[]"]; +Block6_2 -> Block6_2Exit; +FunctionEntry_abi_decode_uint256_0 [label="function abi_decode_uint256: + value := abi_decode_uint256(v0, v1)"]; +FunctionEntry_abi_decode_uint256_0 -> Block7_0; +Block7_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v2[1]\l\nUsed: v0[1]\l\nv2 := calldataload(v0)\l\ +validator_revert_uint256(v2)\l\ +"]; +Block7_0Exit [label="FunctionReturn[v2]"]; +Block7_0 -> Block7_0Exit; +FunctionEntry_abi_decode_tuple_uint256_0 [label="function abi_decode_tuple_uint256: + value0 := abi_decode_tuple_uint256(v0, v1)"]; +FunctionEntry_abi_decode_tuple_uint256_0 -> Block8_0; +Block8_0 [label="\ +Block 0; (0, max 2)\nLiveIn: v1[2], v0[2]\l\ +LiveOut: v1[1], v0[1]\l\nUsed: v1[1], v0[1]\l\nv2 := sub(v0, v1)\l\ +v3 := slt(0x20, v2)\l\ +"]; +Block8_0 -> Block8_0Exit; +Block8_0Exit [label="{ If v3 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block8_0Exit:0 -> Block8_2 [style="solid"]; +Block8_0Exit:1 -> Block8_1 [style="solid"]; +Block8_1 [fillcolor="#FF746C", style=filled, label="\ +Block 1; (1, max 1)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b()\l\ +"]; +Block8_1Exit [label="Terminated"]; +Block8_1 -> Block8_1Exit; +Block8_2 [label="\ +Block 2; (2, max 2)\nLiveIn: v1[1], v0[1]\l\ +LiveOut: v5[1]\l\nUsed: v1[1], v0[1]\l\nv4 := add(0x00, v0)\l\ +v5 := abi_decode_uint256(v1, v4)\l\ +"]; +Block8_2Exit [label="FunctionReturn[v5]"]; +Block8_2 -> Block8_2Exit; +FunctionEntry_abi_encode_uint256_to_uint256_0 [label="function abi_encode_uint256_to_uint256: + abi_encode_uint256_to_uint256(v0, v1)"]; +FunctionEntry_abi_encode_uint256_to_uint256_0 -> Block9_0; +Block9_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v1[1], v0[1]\l\ +LiveOut: \l\nUsed: v1[1], v0[1]\l\nv2 := cleanup_uint256(v0)\l\ +mstore(v2, v1)\l\ +"]; +Block9_0Exit [label="FunctionReturn[]"]; +Block9_0 -> Block9_0Exit; +FunctionEntry_abi_encode_uint256_0 [label="function abi_encode_uint256: + tail := abi_encode_uint256(v0, v1)"]; +FunctionEntry_abi_encode_uint256_0 -> Block10_0; +Block10_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v1[1], v0[2]\l\ +LiveOut: v2[1]\l\nUsed: v1[1], v0[2]\l\nv2 := add(0x20, v0)\l\ +v3 := add(0x00, v0)\l\ +abi_encode_uint256_to_uint256(v3, v1)\l\ +"]; +Block10_0Exit [label="FunctionReturn[v2]"]; +Block10_0 -> Block10_0Exit; +FunctionEntry_external_fun_f_0 [label="function external_fun_f: + external_fun_f()"]; +FunctionEntry_external_fun_f_0 -> Block11_0; +Block11_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 2)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv0 := callvalue()\l\ +"]; +Block11_0 -> Block11_0Exit; +Block11_0Exit [label="{ If v0 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block11_0Exit:0 -> Block11_2 [style="solid"]; +Block11_0Exit:1 -> Block11_1 [style="solid"]; +Block11_1 [fillcolor="#FF746C", style=filled, label="\ +Block 1; (1, max 1)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()\l\ +"]; +Block11_1Exit [label="Terminated"]; +Block11_1 -> Block11_1Exit; +Block11_2 [fillcolor="#FF746C", style=filled, label="\ +Block 2; (2, max 2)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv1 := calldatasize()\l\ +v2 := abi_decode_tuple_uint256(v1, 0x04)\l\ +v3 := fun_f(v2)\l\ +v4 := allocate_unbounded()\l\ +v5 := abi_encode_uint256(v3, v4)\l\ +v6 := sub(v4, v5)\l\ +return(v6, v4)\l\ +"]; +Block11_2Exit [label="Terminated"]; +Block11_2 -> Block11_2Exit; +FunctionEntry_revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74_0 [label="function revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74: + revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74()"]; +FunctionEntry_revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74_0 -> Block12_0; +Block12_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert(0x00, 0x00)\l\ +"]; +Block12_0Exit [label="Terminated"]; +Block12_0 -> Block12_0Exit; +FunctionEntry_zero_value_for_split_uint256_0 [label="function zero_value_for_split_uint256: + ret := zero_value_for_split_uint256()"]; +FunctionEntry_zero_value_for_split_uint256_0 -> Block13_0; +Block13_0 [label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\n"]; +Block13_0Exit [label="FunctionReturn[0x00]"]; +Block13_0 -> Block13_0Exit; +FunctionEntry_cleanup_rational_by_0 [label="function cleanup_rational_by: + cleaned := cleanup_rational_by(v0)"]; +FunctionEntry_cleanup_rational_by_0 -> Block14_0; +Block14_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2]\l\ +LiveOut: v0[1]\l\nUsed: v0[1]\l\n"]; +Block14_0Exit [label="FunctionReturn[v0]"]; +Block14_0 -> Block14_0Exit; +FunctionEntry_identity_0 [label="function identity: + ret := identity(v0)"]; +FunctionEntry_identity_0 -> Block15_0; +Block15_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2]\l\ +LiveOut: v0[1]\l\nUsed: v0[1]\l\n"]; +Block15_0Exit [label="FunctionReturn[v0]"]; +Block15_0 -> Block15_0Exit; +FunctionEntry_convert_rational_by_to_uint256_0 [label="function convert_rational_by_to_uint256: + converted := convert_rational_by_to_uint256(v0)"]; +FunctionEntry_convert_rational_by_to_uint256_0 -> Block16_0; +Block16_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v3[1]\l\nUsed: v0[1]\l\nv1 := cleanup_rational_by(v0)\l\ +v2 := identity(v1)\l\ +v3 := cleanup_uint256(v2)\l\ +"]; +Block16_0Exit [label="FunctionReturn[v3]"]; +Block16_0 -> Block16_0Exit; +FunctionEntry_shift_left_0 [label="function shift_left: + newValue := shift_left(v0)"]; +FunctionEntry_shift_left_0 -> Block17_0; +Block17_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v1[1]\l\nUsed: v0[1]\l\nv1 := shl(v0, 0x00)\l\ +"]; +Block17_0Exit [label="FunctionReturn[v1]"]; +Block17_0 -> Block17_0Exit; +FunctionEntry_update_byte_slice_shift_0 [label="function update_byte_slice_shift: + result := update_byte_slice_shift(v0, v1)"]; +FunctionEntry_update_byte_slice_shift_0 -> Block18_0; +Block18_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1], v1[1]\l\ +LiveOut: v7[1]\l\nUsed: v0[1], v1[1]\l\nv2 := not(0x00)\l\ +v3 := shift_left(v1)\l\ +v4 := not(v2)\l\ +v5 := and(v4, v0)\l\ +v6 := and(v2, v3)\l\ +v7 := or(v6, v5)\l\ +"]; +Block18_0Exit [label="FunctionReturn[v7]"]; +Block18_0 -> Block18_0Exit; +FunctionEntry_convert_uint256_to_uint256_0 [label="function convert_uint256_to_uint256: + converted := convert_uint256_to_uint256(v0)"]; +FunctionEntry_convert_uint256_to_uint256_0 -> Block19_0; +Block19_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v3[1]\l\nUsed: v0[1]\l\nv1 := cleanup_uint256(v0)\l\ +v2 := identity(v1)\l\ +v3 := cleanup_uint256(v2)\l\ +"]; +Block19_0Exit [label="FunctionReturn[v3]"]; +Block19_0 -> Block19_0Exit; +FunctionEntry_prepare_store_uint256_0 [label="function prepare_store_uint256: + ret := prepare_store_uint256(v0)"]; +FunctionEntry_prepare_store_uint256_0 -> Block20_0; +Block20_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2]\l\ +LiveOut: v0[1]\l\nUsed: v0[1]\l\n"]; +Block20_0Exit [label="FunctionReturn[v0]"]; +Block20_0 -> Block20_0Exit; +FunctionEntry_update_storage_value_offset_uint256_to_uint256_0 [label="function update_storage_value_offset_uint256_to_uint256: + update_storage_value_offset_uint256_to_uint256(v0, v1)"]; +FunctionEntry_update_storage_value_offset_uint256_to_uint256_0 -> Block21_0; +Block21_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2], v1[1]\l\ +LiveOut: \l\nUsed: v0[2], v1[1]\l\nv2 := convert_uint256_to_uint256(v1)\l\ +v3 := prepare_store_uint256(v2)\l\ +v4 := sload(v0)\l\ +v5 := update_byte_slice_shift(v3, v4)\l\ +sstore(v5, v0)\l\ +"]; +Block21_0Exit [label="FunctionReturn[]"]; +Block21_0 -> Block21_0Exit; +FunctionEntry_cleanup_t_rational_by_0 [label="function cleanup_t_rational_by: + cleaned := cleanup_t_rational_by(v0)"]; +FunctionEntry_cleanup_t_rational_by_0 -> Block22_0; +Block22_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2]\l\ +LiveOut: v0[1]\l\nUsed: v0[1]\l\n"]; +Block22_0Exit [label="FunctionReturn[v0]"]; +Block22_0 -> Block22_0Exit; +FunctionEntry_convert_t_rational_by_to_t_uint256_0 [label="function convert_t_rational_by_to_t_uint256: + converted := convert_t_rational_by_to_t_uint256(v0)"]; +FunctionEntry_convert_t_rational_by_to_t_uint256_0 -> Block23_0; +Block23_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v3[1]\l\nUsed: v0[1]\l\nv1 := cleanup_t_rational_by(v0)\l\ +v2 := identity(v1)\l\ +v3 := cleanup_uint256(v2)\l\ +"]; +Block23_0Exit [label="FunctionReturn[v3]"]; +Block23_0 -> Block23_0Exit; +FunctionEntry_increment_wrapping_uint256_0 [label="function increment_wrapping_uint256: + ret := increment_wrapping_uint256(v0)"]; +FunctionEntry_increment_wrapping_uint256_0 -> Block24_0; +Block24_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v2[1]\l\nUsed: v0[1]\l\nv1 := add(0x01, v0)\l\ +v2 := cleanup_uint256(v1)\l\ +"]; +Block24_0Exit [label="FunctionReturn[v2]"]; +Block24_0 -> Block24_0Exit; +FunctionEntry_shift_right_0_unsigned_0 [label="function shift_right_0_unsigned: + newValue := shift_right_0_unsigned(v0)"]; +FunctionEntry_shift_right_0_unsigned_0 -> Block25_0; +Block25_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v1[1]\l\nUsed: v0[1]\l\nv1 := shr(v0, 0x00)\l\ +"]; +Block25_0Exit [label="FunctionReturn[v1]"]; +Block25_0 -> Block25_0Exit; +FunctionEntry_cleanup_from_storage_uint256_0 [label="function cleanup_from_storage_uint256: + cleaned := cleanup_from_storage_uint256(v0)"]; +FunctionEntry_cleanup_from_storage_uint256_0 -> Block26_0; +Block26_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[2]\l\ +LiveOut: v0[1]\l\nUsed: v0[1]\l\n"]; +Block26_0Exit [label="FunctionReturn[v0]"]; +Block26_0 -> Block26_0Exit; +FunctionEntry_extract_from_storage_value_offset_uint256_0 [label="function extract_from_storage_value_offset_uint256: + value := extract_from_storage_value_offset_uint256(v0)"]; +FunctionEntry_extract_from_storage_value_offset_uint256_0 -> Block27_0; +Block27_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v2[1]\l\nUsed: v0[1]\l\nv1 := shift_right_0_unsigned(v0)\l\ +v2 := cleanup_from_storage_uint256(v1)\l\ +"]; +Block27_0Exit [label="FunctionReturn[v2]"]; +Block27_0 -> Block27_0Exit; +FunctionEntry_read_from_storage_split_offset_uint256_0 [label="function read_from_storage_split_offset_uint256: + value := read_from_storage_split_offset_uint256(v0)"]; +FunctionEntry_read_from_storage_split_offset_uint256_0 -> Block28_0; +Block28_0 [label="\ +Block 0; (0, max 0)\nLiveIn: v0[1]\l\ +LiveOut: v2[1]\l\nUsed: v0[1]\l\nv1 := sload(v0)\l\ +v2 := extract_from_storage_value_offset_uint256(v1)\l\ +"]; +Block28_0Exit [label="FunctionReturn[v2]"]; +Block28_0 -> Block28_0Exit; +FunctionEntry_panic_error_0x11_0 [label="function panic_error_0x11: + panic_error_0x11()"]; +FunctionEntry_panic_error_0x11_0 -> Block29_0; +Block29_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv0 := shl(0x4e487b71, 0xe0)\l\ +mstore(v0, 0x00)\l\ +mstore(0x11, 0x04)\l\ +revert(0x24, 0x00)\l\ +"]; +Block29_0Exit [label="Terminated"]; +Block29_0 -> Block29_0Exit; +FunctionEntry_checked_mul_uint256_0 [label="function checked_mul_uint256: + product := checked_mul_uint256(v0, v1)"]; +FunctionEntry_checked_mul_uint256_0 -> Block30_0; +Block30_0 [label="\ +Block 0; (0, max 2)\nLiveIn: v1[1], v0[1]\l\ +LiveOut: v5[2]\l\nUsed: v1[1], v0[1]\l\nv2 := cleanup_uint256(v0)\l\ +v3 := cleanup_uint256(v1)\l\ +v4 := mul(v3, v2)\l\ +v5 := cleanup_uint256(v4)\l\ +v6 := div(v2, v5)\l\ +v7 := eq(v6, v3)\l\ +v8 := iszero(v2)\l\ +v9 := or(v7, v8)\l\ +v10 := iszero(v9)\l\ +"]; +Block30_0 -> Block30_0Exit; +Block30_0Exit [label="{ If v10 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block30_0Exit:0 -> Block30_2 [style="solid"]; +Block30_0Exit:1 -> Block30_1 [style="solid"]; +Block30_1 [fillcolor="#FF746C", style=filled, label="\ +Block 1; (1, max 1)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\npanic_error_0x11()\l\ +"]; +Block30_1Exit [label="Terminated"]; +Block30_1 -> Block30_1Exit; +Block30_2 [label="\ +Block 2; (2, max 2)\nLiveIn: v5[2]\l\ +LiveOut: v5[1]\l\nUsed: v5[1]\l\n"]; +Block30_2Exit [label="FunctionReturn[v5]"]; +Block30_2 -> Block30_2Exit; +FunctionEntry_fun_f_0 [label="function fun_f: + var := fun_f(v0)"]; +FunctionEntry_fun_f_0 -> Block31_0; +Block31_0 [label="\ +Block 0; (0, max 5)\nLiveIn: v0[1]\l\ +LiveOut: v3[1], v0[1]\l\nUsed: \l\nv1 := zero_value_for_split_uint256()\l\ +v2 := convert_rational_by_to_uint256(0x01)\l\ +update_storage_value_offset_uint256_to_uint256(v2, 0x00)\l\ +v3 := convert_t_rational_by_to_t_uint256(0x00)\l\ +"]; +Block31_0 -> Block31_0Exit [arrowhead=none]; +Block31_0Exit [label="Jump" shape=oval]; +Block31_0Exit -> Block31_2 [style="solid"]; +Block31_2 [label="\ +Block 2; (1, max 5)\nLiveIn: phi0[3], v0[1]\l\ +LiveOut: phi0[1], v0[1]\l\nUsed: phi0[2]\l\nphi0 := φ(\l\ + Block 0 => v3,\l\ + Block 3 => v11\l\ +)\l\ +v4 := cleanup_uint256(v0)\l\ +v5 := cleanup_uint256(phi0)\l\ +v6 := lt(v4, v5)\l\ +v7 := iszero(v6)\l\ +"]; +Block31_2 -> Block31_2Exit; +Block31_2Exit [label="{ If v7 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block31_2Exit:0 -> Block31_6 [style="solid"]; +Block31_2Exit:1 -> Block31_5 [style="solid"]; +Block31_5 [label="\ +Block 5; (2, max 3)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\n"]; +Block31_5 -> Block31_5Exit [arrowhead=none]; +Block31_5Exit [label="Jump" shape=oval]; +Block31_5Exit -> Block31_4 [style="solid"]; +Block31_6 [label="\ +Block 6; (4, max 5)\nLiveIn: phi0[1], v0[1]\l\ +LiveOut: phi0[1], v0[1]\l\nUsed: \l\nv8 := read_from_storage_split_offset_uint256(0x00)\l\ +v9 := read_from_storage_split_offset_uint256(0x00)\l\ +v10 := checked_mul_uint256(v9, v8)\l\ +update_storage_value_offset_uint256_to_uint256(v10, 0x00)\l\ +"]; +Block31_6 -> Block31_6Exit [arrowhead=none]; +Block31_6Exit [label="Jump" shape=oval]; +Block31_6Exit -> Block31_3 [style="solid"]; +Block31_4 [label="\ +Block 4; (3, max 3)\nLiveIn: \l\ +LiveOut: v12[1]\l\nUsed: \l\nv12 := read_from_storage_split_offset_uint256(0x00)\l\ +"]; +Block31_4Exit [label="FunctionReturn[v12]"]; +Block31_4 -> Block31_4Exit; +Block31_3 [label="\ +Block 3; (5, max 5)\nLiveIn: phi0[1], v0[1]\l\ +LiveOut: v11[1], v0[1]\l\nUsed: phi0[1]\l\nv11 := increment_wrapping_uint256(phi0)\l\ +"]; +Block31_3 -> Block31_3Exit [arrowhead=none]; +Block31_3Exit [label="Jump" shape=oval]; +Block31_3Exit -> Block31_2 [style="dashed"]; +} + +Stack layout for main graph + Block 0 (junk=false, stackIn=[]) + memoryguard: [] -> [] + shuffling: + shuffled to: [] + result: [v0] + mstore: [v0] -> [v0, lit0] + shuffling: + shuffled to: [v0, lit0] + result: [] + calldatasize: [] -> [] + shuffling: + shuffled to: [] + result: [v1] + lt: [v1] -> [lit1, v1] + shuffling: + shuffled to: [lit1, v1] + result: [v2] + iszero: [v2] -> [v2] + shuffling: + shuffled to: [v2] + result: [v3] + stack out = [] + Block 1 (junk=false, stackIn=[]) + calldataload: [] -> [lit2] + shuffling: + shuffled to: [lit2] + result: [v4] + shift_right_unsigned: [v4] -> [FunctionCallReturnLabel[0], v4] + shuffling: + shuffled to: [FunctionCallReturnLabel[0], v4] + result: [v5] + eq: [v5] -> [lit3, v5] + shuffling: + shuffled to: [lit3, v5] + result: [v6] + stack out = [] + Block 4 (junk=true, stackIn=[]) + external_fun_f: [] -> [] + shuffling: + shuffled to: [] + result: [] + stack out = [] + Block 5 (junk=false, stackIn=[]) + stack out = [] + Block 3 (junk=false, stackIn=[]) + stack out = [] + Block 2 (junk=true, stackIn=[]) + revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74: [] -> [] + shuffling: + shuffled to: [] + result: [] + stack out = [] +Code transform for main + Generating for Block 0 with label 32 + memoryguard: [] -> [] + shuffling: + Builtin call: memoryguard: [] -> [v0] + mstore: [v0] -> [v0, lit0] + shuffling: PUSH(lit0) + Builtin call: mstore: [v0, lit0] -> [] + calldatasize: [] -> [] + shuffling: + Builtin call: calldatasize: [] -> [v1] + lt: [v1] -> [lit1, v1] + shuffling: PUSH(lit1) SWAP1 + Builtin call: lt: [lit1, v1] -> [v2] + iszero: [v2] -> [v2] + shuffling: + Builtin call: iszero: [v2] -> [v3] + shuffling: + JUMPI creating stack for zero layout (to Block 2) [] -> [] + shuffling: + Generating for Block 2 with label 34 + revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74: [] -> [] + shuffling: + Call: revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74 (label=12): [] -> [] + shuffling: + Generating for Block 1 with label 33 + calldataload: [] -> [lit2] + shuffling: PUSH(lit2) + Builtin call: calldataload: [lit2] -> [v4] + shift_right_unsigned: [v4] -> [FunctionCallReturnLabel[0], v4] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: shift_right_unsigned (label=1): [FunctionCallReturnLabel[0], v4], returnLabel: 40 -> [v5] + eq: [v5] -> [lit3, v5] + shuffling: PUSH(lit3) SWAP1 + Builtin call: eq: [lit3, v5] -> [v6] + shuffling: + JUMPI creating stack for zero layout (to Block 5) [] -> [] + shuffling: + Generating for Block 5 with label 37 + shuffling: + JUMP creating target stack for jump 5 -> 3 + shuffling: + Generating for Block 3 with label 35 + shuffling: + JUMP creating target stack for jump 3 -> 2 + shuffling: + Generating for Block 4 with label 36 + external_fun_f: [] -> [] + shuffling: + Call: external_fun_f (label=11): [] -> [] + shuffling: +Stack layout for shift_right_unsigned + Block 0 (junk=false, stackIn=[ReturnLabel[1], v0]) + shr: [ReturnLabel[1], v0] -> [v0, lit1] + shuffling: + shuffled to: [ReturnLabel[1], v0, lit1] + result: [ReturnLabel[1], v1] + stack out = [v1, ReturnLabel[1]] +Code transform for shift_right_unsigned + Generating for Block 0 with label 41 + shr: [ReturnLabel[1], v0] -> [ReturnLabel[1], v0, lit1] + shuffling: PUSH(lit1) + Builtin call: shr: [ReturnLabel[1], v0, lit1] -> [ReturnLabel[1], v1] + shuffling: SWAP1 +Stack layout for allocate_unbounded + Block 0 (junk=false, stackIn=[ReturnLabel[2]]) + mload: [ReturnLabel[2]] -> [lit1] + shuffling: + shuffled to: [ReturnLabel[2], lit1] + result: [ReturnLabel[2], v0] + stack out = [v0, ReturnLabel[2]] +Code transform for allocate_unbounded + Generating for Block 0 with label 43 + mload: [ReturnLabel[2]] -> [ReturnLabel[2], lit1] + shuffling: PUSH(lit1) + Builtin call: mload: [ReturnLabel[2], lit1] -> [ReturnLabel[2], v0] + shuffling: SWAP1 +Stack layout for revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb + Block 0 (junk=true, stackIn=[]) + revert: [] -> [lit0, lit0] + shuffling: + shuffled to: [lit0, lit0] + result: [] + stack out = [] +Code transform for revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb + Generating for Block 0 with label 45 + revert: [] -> [lit0, lit0] + shuffling: PUSH(lit0) DUP1 + Builtin call: revert: [lit0, lit0] -> [] + shuffling: +Stack layout for revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b + Block 0 (junk=true, stackIn=[]) + revert: [] -> [lit0, lit0] + shuffling: + shuffled to: [lit0, lit0] + result: [] + stack out = [] +Code transform for revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b + Generating for Block 0 with label 48 + revert: [] -> [lit0, lit0] + shuffling: PUSH(lit0) DUP1 + Builtin call: revert: [lit0, lit0] -> [] + shuffling: +Stack layout for cleanup_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[5], v0]) + stack out = [v0, ReturnLabel[5]] +Code transform for cleanup_uint256 + Generating for Block 0 with label 51 + shuffling: SWAP1 +Stack layout for validator_revert_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[6], v0]) + cleanup_uint256: [ReturnLabel[6], v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[6], v0, FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[6], v0, v1] + eq: [ReturnLabel[6], v0, v1] -> [v1, v0] + shuffling: + shuffled to: [ReturnLabel[6], v1, v0] + result: [ReturnLabel[6], v2] + iszero: [ReturnLabel[6], v2] -> [v2] + shuffling: + shuffled to: [ReturnLabel[6], v2] + result: [ReturnLabel[6], v3] + stack out = [ReturnLabel[6]] + Block 1 (junk=true, stackIn=[ReturnLabel[6]]) + revert: [ReturnLabel[6]] -> [lit0, lit0] + shuffling: + shuffled to: [ReturnLabel[6], lit0, lit0] + result: [ReturnLabel[6]] + stack out = [ReturnLabel[6]] + Block 2 (junk=false, stackIn=[ReturnLabel[6]]) + stack out = [ReturnLabel[6]] +Code transform for validator_revert_uint256 + Generating for Block 0 with label 53 + cleanup_uint256: [ReturnLabel[6], v0] -> [ReturnLabel[6], v0, FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) DUP2 + Call: cleanup_uint256 (label=5): [ReturnLabel[6], v0, FunctionCallReturnLabel[0], v0], returnLabel: 58 -> [ReturnLabel[6], v0, v1] + eq: [ReturnLabel[6], v0, v1] -> [ReturnLabel[6], v1, v0] + shuffling: SWAP1 + Builtin call: eq: [ReturnLabel[6], v1, v0] -> [ReturnLabel[6], v2] + iszero: [ReturnLabel[6], v2] -> [ReturnLabel[6], v2] + shuffling: + Builtin call: iszero: [ReturnLabel[6], v2] -> [ReturnLabel[6], v3] + shuffling: + JUMPI creating stack for zero layout (to Block 2) [ReturnLabel[6]] -> [ReturnLabel[6]] + shuffling: + Generating for Block 2 with label 55 + shuffling: + Generating for Block 1 with label 54 + revert: [ReturnLabel[6]] -> [ReturnLabel[6], lit0, lit0] + shuffling: PUSH(lit0) DUP1 + Builtin call: revert: [ReturnLabel[6], lit0, lit0] -> [ReturnLabel[6]] + shuffling: +Stack layout for abi_decode_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[7], v1, v0]) + calldataload: [ReturnLabel[7], JUNK, v0] -> [v0] + shuffling: + shuffled to: [ReturnLabel[7], JUNK, v0] + result: [ReturnLabel[7], JUNK, v2] + validator_revert_uint256: [ReturnLabel[7], JUNK, v2] -> [FunctionCallReturnLabel[0], v2] + shuffling: + shuffled to: [ReturnLabel[7], JUNK, v2, FunctionCallReturnLabel[0], v2] + result: [ReturnLabel[7], JUNK, v2] + stack out = [v2, ReturnLabel[7]] +Code transform for abi_decode_uint256 + Generating for Block 0 with label 59 + calldataload: [ReturnLabel[7], v1, v0] -> [ReturnLabel[7], JUNK, v0] + shuffling: + Builtin call: calldataload: [ReturnLabel[7], v1, v0] -> [ReturnLabel[7], v1, v2] + validator_revert_uint256: [ReturnLabel[7], v1, v2] -> [ReturnLabel[7], JUNK, v2, FunctionCallReturnLabel[0], v2] + shuffling: PUSH(FunctionCallReturnLabel[0]) DUP2 + Call: validator_revert_uint256 (label=6): [ReturnLabel[7], v1, v2, FunctionCallReturnLabel[0], v2], returnLabel: 61 -> [ReturnLabel[7], v1, v2] + shuffling: SWAP2 SWAP1 POP +Stack layout for abi_decode_tuple_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[8], v1, v0]) + sub: [ReturnLabel[8], v1, v0] -> [v0, v1] + shuffling: + shuffled to: [ReturnLabel[8], v1, v0, v0, v1] + result: [ReturnLabel[8], v1, v0, v2] + slt: [ReturnLabel[8], v1, v0, v2] -> [lit1, v2] + shuffling: + shuffled to: [ReturnLabel[8], v1, v0, lit1, v2] + result: [ReturnLabel[8], v1, v0, v3] + stack out = [ReturnLabel[8], v1, v0] + Block 1 (junk=true, stackIn=[ReturnLabel[8], JUNK, JUNK]) + revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b: [ReturnLabel[8], JUNK, JUNK] -> [] + shuffling: + shuffled to: [ReturnLabel[8], JUNK, JUNK] + result: [ReturnLabel[8], JUNK, JUNK] + stack out = [ReturnLabel[8], JUNK, JUNK] + Block 2 (junk=false, stackIn=[ReturnLabel[8], v1, v0]) + add: [ReturnLabel[8], v1, v0] -> [lit0, v0] + shuffling: + shuffled to: [ReturnLabel[8], v1, lit0, v0] + result: [ReturnLabel[8], v1, v4] + abi_decode_uint256: [ReturnLabel[8], v1, v4] -> [FunctionCallReturnLabel[0], v1, v4] + shuffling: + shuffled to: [ReturnLabel[8], FunctionCallReturnLabel[0], v1, v4] + result: [ReturnLabel[8], v5] + stack out = [v5, ReturnLabel[8]] +Code transform for abi_decode_tuple_uint256 + Generating for Block 0 with label 62 + sub: [ReturnLabel[8], v1, v0] -> [ReturnLabel[8], v1, v0, v0, v1] + shuffling: DUP1 DUP3 + Builtin call: sub: [ReturnLabel[8], v1, v0, v0, v1] -> [ReturnLabel[8], v1, v0, v2] + slt: [ReturnLabel[8], v1, v0, v2] -> [ReturnLabel[8], v1, v0, lit1, v2] + shuffling: PUSH(lit1) SWAP1 + Builtin call: slt: [ReturnLabel[8], v1, v0, lit1, v2] -> [ReturnLabel[8], v1, v0, v3] + shuffling: + JUMPI creating stack for zero layout (to Block 2) [ReturnLabel[8], v1, v0] -> [ReturnLabel[8], v1, v0] + shuffling: + Generating for Block 2 with label 64 + add: [ReturnLabel[8], v1, v0] -> [ReturnLabel[8], v1, lit0, v0] + shuffling: PUSH(lit0) SWAP1 + Builtin call: add: [ReturnLabel[8], v1, lit0, v0] -> [ReturnLabel[8], v1, v4] + abi_decode_uint256: [ReturnLabel[8], v1, v4] -> [ReturnLabel[8], FunctionCallReturnLabel[0], v1, v4] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP2 SWAP1 + Call: abi_decode_uint256 (label=7): [ReturnLabel[8], FunctionCallReturnLabel[0], v1, v4], returnLabel: 67 -> [ReturnLabel[8], v5] + shuffling: SWAP1 + Generating for Block 1 with label 63 + revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b: [ReturnLabel[8], v1, v0] -> [ReturnLabel[8], JUNK, JUNK] + shuffling: + Call: revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b (label=4): [ReturnLabel[8], v1, v0] -> [ReturnLabel[8], v1, v0] + shuffling: +Stack layout for abi_encode_uint256_to_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[9], v1, v0]) + cleanup_uint256: [ReturnLabel[9], v1, v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[9], v1, FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[9], v1, v2] + mstore: [ReturnLabel[9], v1, v2] -> [v2, v1] + shuffling: + shuffled to: [ReturnLabel[9], v2, v1] + result: [ReturnLabel[9]] + stack out = [ReturnLabel[9]] +Code transform for abi_encode_uint256_to_uint256 + Generating for Block 0 with label 68 + cleanup_uint256: [ReturnLabel[9], v1, v0] -> [ReturnLabel[9], v1, FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[9], v1, FunctionCallReturnLabel[0], v0], returnLabel: 70 -> [ReturnLabel[9], v1, v2] + mstore: [ReturnLabel[9], v1, v2] -> [ReturnLabel[9], v2, v1] + shuffling: SWAP1 + Builtin call: mstore: [ReturnLabel[9], v2, v1] -> [ReturnLabel[9]] + shuffling: +Stack layout for abi_encode_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[10], v1, v0]) + add: [ReturnLabel[10], v1, v0] -> [lit1, v0] + shuffling: + shuffled to: [ReturnLabel[10], v1, v0, lit1, v0] + result: [ReturnLabel[10], v1, v0, v2] + add: [ReturnLabel[10], v1, v0, v2] -> [lit0, v0] + shuffling: + shuffled to: [ReturnLabel[10], v1, v2, lit0, v0] + result: [ReturnLabel[10], v1, v2, v3] + abi_encode_uint256_to_uint256: [ReturnLabel[10], v1, v2, v3] -> [FunctionCallReturnLabel[0], v3, v1] + shuffling: + shuffled to: [ReturnLabel[10], v2, FunctionCallReturnLabel[0], v3, v1] + result: [ReturnLabel[10], v2] + stack out = [v2, ReturnLabel[10]] +Code transform for abi_encode_uint256 + Generating for Block 0 with label 71 + add: [ReturnLabel[10], v1, v0] -> [ReturnLabel[10], v1, v0, lit1, v0] + shuffling: PUSH(lit1) DUP2 + Builtin call: add: [ReturnLabel[10], v1, v0, lit1, v0] -> [ReturnLabel[10], v1, v0, v2] + add: [ReturnLabel[10], v1, v0, v2] -> [ReturnLabel[10], v1, v2, lit0, v0] + shuffling: SWAP1 PUSH(lit0) SWAP1 + Builtin call: add: [ReturnLabel[10], v1, v2, lit0, v0] -> [ReturnLabel[10], v1, v2, v3] + abi_encode_uint256_to_uint256: [ReturnLabel[10], v1, v2, v3] -> [ReturnLabel[10], v2, FunctionCallReturnLabel[0], v3, v1] + shuffling: SWAP1 SWAP2 PUSH(FunctionCallReturnLabel[0]) SWAP2 SWAP1 + Call: abi_encode_uint256_to_uint256 (label=9): [ReturnLabel[10], v2, FunctionCallReturnLabel[0], v3, v1], returnLabel: 73 -> [ReturnLabel[10], v2] + shuffling: SWAP1 +Stack layout for external_fun_f + Block 0 (junk=true, stackIn=[]) + callvalue: [] -> [] + shuffling: + shuffled to: [] + result: [v0] + stack out = [] + Block 1 (junk=true, stackIn=[]) + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb: [] -> [] + shuffling: + shuffled to: [] + result: [] + stack out = [] + Block 2 (junk=true, stackIn=[]) + calldatasize: [] -> [] + shuffling: + shuffled to: [] + result: [v1] + abi_decode_tuple_uint256: [v1] -> [FunctionCallReturnLabel[0], v1, lit0] + shuffling: + shuffled to: [FunctionCallReturnLabel[0], v1, lit0] + result: [v2] + fun_f: [v2] -> [FunctionCallReturnLabel[1], v2] + shuffling: + shuffled to: [FunctionCallReturnLabel[1], v2] + result: [v3] + allocate_unbounded: [v3] -> [FunctionCallReturnLabel[2]] + shuffling: + shuffled to: [v3, FunctionCallReturnLabel[2]] + result: [v3, v4] + abi_encode_uint256: [v3, v4] -> [FunctionCallReturnLabel[3], v3, v4] + shuffling: + shuffled to: [v3, v4, FunctionCallReturnLabel[3], v3, v4] + result: [v3, v4, v5] + sub: [JUNK, v4, v5] -> [v4, v5] + shuffling: + shuffled to: [JUNK, v4, v4, v5] + result: [JUNK, v4, v6] + return: [JUNK, v4, v6] -> [v6, v4] + shuffling: + shuffled to: [JUNK, v6, v4] + result: [JUNK] + stack out = [JUNK] +Code transform for external_fun_f + Generating for Block 0 with label 74 + callvalue: [] -> [] + shuffling: + Builtin call: callvalue: [] -> [v0] + shuffling: + JUMPI creating stack for zero layout (to Block 2) [] -> [] + shuffling: + Generating for Block 2 with label 76 + calldatasize: [] -> [] + shuffling: + Builtin call: calldatasize: [] -> [v1] + abi_decode_tuple_uint256: [v1] -> [FunctionCallReturnLabel[0], v1, lit0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 PUSH(lit0) + Call: abi_decode_tuple_uint256 (label=8): [FunctionCallReturnLabel[0], v1, lit0], returnLabel: 80 -> [v2] + fun_f: [v2] -> [FunctionCallReturnLabel[1], v2] + shuffling: PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: fun_f (label=31): [FunctionCallReturnLabel[1], v2], returnLabel: 81 -> [v3] + allocate_unbounded: [v3] -> [v3, FunctionCallReturnLabel[2]] + shuffling: PUSH(FunctionCallReturnLabel[2]) + Call: allocate_unbounded (label=2): [v3, FunctionCallReturnLabel[2]], returnLabel: 82 -> [v3, v4] + abi_encode_uint256: [v3, v4] -> [v3, v4, FunctionCallReturnLabel[3], v3, v4] + shuffling: PUSH(FunctionCallReturnLabel[3]) DUP3 DUP3 + Call: abi_encode_uint256 (label=10): [v3, v4, FunctionCallReturnLabel[3], v3, v4], returnLabel: 83 -> [v3, v4, v5] + sub: [v3, v4, v5] -> [JUNK, v4, v4, v5] + shuffling: DUP2 SWAP1 + Builtin call: sub: [v3, v4, v4, v5] -> [v3, v4, v6] + return: [v3, v4, v6] -> [JUNK, v6, v4] + shuffling: SWAP1 + Builtin call: return: [v3, v6, v4] -> [v3] + shuffling: + Generating for Block 1 with label 75 + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb: [] -> [] + shuffling: + Call: revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb (label=3): [] -> [] + shuffling: +Stack layout for revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74 + Block 0 (junk=true, stackIn=[]) + revert: [] -> [lit0, lit0] + shuffling: + shuffled to: [lit0, lit0] + result: [] + stack out = [] +Code transform for revert_error_42b3090547df1d2001c96683413b8cf91c1b902ef5e3cb8d9f6f304cf7446f74 + Generating for Block 0 with label 84 + revert: [] -> [lit0, lit0] + shuffling: PUSH(lit0) DUP1 + Builtin call: revert: [lit0, lit0] -> [] + shuffling: +Stack layout for zero_value_for_split_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[13]]) + stack out = [lit0, ReturnLabel[13]] +Code transform for zero_value_for_split_uint256 + Generating for Block 0 with label 87 + shuffling: PUSH(lit0) SWAP1 +Stack layout for cleanup_rational_by + Block 0 (junk=false, stackIn=[ReturnLabel[14], v0]) + stack out = [v0, ReturnLabel[14]] +Code transform for cleanup_rational_by + Generating for Block 0 with label 89 + shuffling: SWAP1 +Stack layout for identity + Block 0 (junk=false, stackIn=[ReturnLabel[15], v0]) + stack out = [v0, ReturnLabel[15]] +Code transform for identity + Generating for Block 0 with label 91 + shuffling: SWAP1 +Stack layout for convert_rational_by_to_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[16], v0]) + cleanup_rational_by: [ReturnLabel[16], v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[16], FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[16], v1] + identity: [ReturnLabel[16], v1] -> [FunctionCallReturnLabel[1], v1] + shuffling: + shuffled to: [ReturnLabel[16], FunctionCallReturnLabel[1], v1] + result: [ReturnLabel[16], v2] + cleanup_uint256: [ReturnLabel[16], v2] -> [FunctionCallReturnLabel[2], v2] + shuffling: + shuffled to: [ReturnLabel[16], FunctionCallReturnLabel[2], v2] + result: [ReturnLabel[16], v3] + stack out = [v3, ReturnLabel[16]] +Code transform for convert_rational_by_to_uint256 + Generating for Block 0 with label 93 + cleanup_rational_by: [ReturnLabel[16], v0] -> [ReturnLabel[16], FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: cleanup_rational_by (label=14): [ReturnLabel[16], FunctionCallReturnLabel[0], v0], returnLabel: 95 -> [ReturnLabel[16], v1] + identity: [ReturnLabel[16], v1] -> [ReturnLabel[16], FunctionCallReturnLabel[1], v1] + shuffling: PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: identity (label=15): [ReturnLabel[16], FunctionCallReturnLabel[1], v1], returnLabel: 96 -> [ReturnLabel[16], v2] + cleanup_uint256: [ReturnLabel[16], v2] -> [ReturnLabel[16], FunctionCallReturnLabel[2], v2] + shuffling: PUSH(FunctionCallReturnLabel[2]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[16], FunctionCallReturnLabel[2], v2], returnLabel: 97 -> [ReturnLabel[16], v3] + shuffling: SWAP1 +Stack layout for shift_left + Block 0 (junk=false, stackIn=[ReturnLabel[17], v0]) + shl: [ReturnLabel[17], v0] -> [v0, lit0] + shuffling: + shuffled to: [ReturnLabel[17], v0, lit0] + result: [ReturnLabel[17], v1] + stack out = [v1, ReturnLabel[17]] +Code transform for shift_left + Generating for Block 0 with label 98 + shl: [ReturnLabel[17], v0] -> [ReturnLabel[17], v0, lit0] + shuffling: PUSH(lit0) + Builtin call: shl: [ReturnLabel[17], v0, lit0] -> [ReturnLabel[17], v1] + shuffling: SWAP1 +Stack layout for update_byte_slice_shift + Block 0 (junk=false, stackIn=[ReturnLabel[18], v1, v0]) + not: [ReturnLabel[18], v1, v0] -> [lit0] + shuffling: + shuffled to: [ReturnLabel[18], v1, v0, lit0] + result: [ReturnLabel[18], v1, v0, v2] + shift_left: [ReturnLabel[18], v1, v0, v2] -> [FunctionCallReturnLabel[0], v1] + shuffling: + shuffled to: [ReturnLabel[18], v2, v0, FunctionCallReturnLabel[0], v1] + result: [ReturnLabel[18], v2, v0, v3] + not: [ReturnLabel[18], v2, v0, v3] -> [v2] + shuffling: + shuffled to: [ReturnLabel[18], v2, v0, v3, v2] + result: [ReturnLabel[18], v2, v0, v3, v4] + and: [ReturnLabel[18], v2, v0, v3, v4] -> [v4, v0] + shuffling: + shuffled to: [ReturnLabel[18], v2, v3, v4, v0] + result: [ReturnLabel[18], v2, v3, v5] + and: [ReturnLabel[18], v2, v3, v5] -> [v2, v3] + shuffling: + shuffled to: [ReturnLabel[18], v5, v2, v3] + result: [ReturnLabel[18], v5, v6] + or: [ReturnLabel[18], v5, v6] -> [v6, v5] + shuffling: + shuffled to: [ReturnLabel[18], v6, v5] + result: [ReturnLabel[18], v7] + stack out = [v7, ReturnLabel[18]] +Code transform for update_byte_slice_shift + Generating for Block 0 with label 100 + not: [ReturnLabel[18], v1, v0] -> [ReturnLabel[18], v1, v0, lit0] + shuffling: PUSH(lit0) + Builtin call: not: [ReturnLabel[18], v1, v0, lit0] -> [ReturnLabel[18], v1, v0, v2] + shift_left: [ReturnLabel[18], v1, v0, v2] -> [ReturnLabel[18], v2, v0, FunctionCallReturnLabel[0], v1] + shuffling: SWAP2 PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: shift_left (label=17): [ReturnLabel[18], v2, v0, FunctionCallReturnLabel[0], v1], returnLabel: 102 -> [ReturnLabel[18], v2, v0, v3] + not: [ReturnLabel[18], v2, v0, v3] -> [ReturnLabel[18], v2, v0, v3, v2] + shuffling: DUP3 + Builtin call: not: [ReturnLabel[18], v2, v0, v3, v2] -> [ReturnLabel[18], v2, v0, v3, v4] + and: [ReturnLabel[18], v2, v0, v3, v4] -> [ReturnLabel[18], v2, v3, v4, v0] + shuffling: SWAP1 SWAP2 + Builtin call: and: [ReturnLabel[18], v2, v3, v4, v0] -> [ReturnLabel[18], v2, v3, v5] + and: [ReturnLabel[18], v2, v3, v5] -> [ReturnLabel[18], v5, v2, v3] + shuffling: SWAP2 SWAP1 + Builtin call: and: [ReturnLabel[18], v5, v2, v3] -> [ReturnLabel[18], v5, v6] + or: [ReturnLabel[18], v5, v6] -> [ReturnLabel[18], v6, v5] + shuffling: SWAP1 + Builtin call: or: [ReturnLabel[18], v6, v5] -> [ReturnLabel[18], v7] + shuffling: SWAP1 +Stack layout for convert_uint256_to_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[19], v0]) + cleanup_uint256: [ReturnLabel[19], v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[19], FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[19], v1] + identity: [ReturnLabel[19], v1] -> [FunctionCallReturnLabel[1], v1] + shuffling: + shuffled to: [ReturnLabel[19], FunctionCallReturnLabel[1], v1] + result: [ReturnLabel[19], v2] + cleanup_uint256: [ReturnLabel[19], v2] -> [FunctionCallReturnLabel[2], v2] + shuffling: + shuffled to: [ReturnLabel[19], FunctionCallReturnLabel[2], v2] + result: [ReturnLabel[19], v3] + stack out = [v3, ReturnLabel[19]] +Code transform for convert_uint256_to_uint256 + Generating for Block 0 with label 103 + cleanup_uint256: [ReturnLabel[19], v0] -> [ReturnLabel[19], FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[19], FunctionCallReturnLabel[0], v0], returnLabel: 105 -> [ReturnLabel[19], v1] + identity: [ReturnLabel[19], v1] -> [ReturnLabel[19], FunctionCallReturnLabel[1], v1] + shuffling: PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: identity (label=15): [ReturnLabel[19], FunctionCallReturnLabel[1], v1], returnLabel: 106 -> [ReturnLabel[19], v2] + cleanup_uint256: [ReturnLabel[19], v2] -> [ReturnLabel[19], FunctionCallReturnLabel[2], v2] + shuffling: PUSH(FunctionCallReturnLabel[2]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[19], FunctionCallReturnLabel[2], v2], returnLabel: 107 -> [ReturnLabel[19], v3] + shuffling: SWAP1 +Stack layout for prepare_store_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[20], v0]) + stack out = [v0, ReturnLabel[20]] +Code transform for prepare_store_uint256 + Generating for Block 0 with label 108 + shuffling: SWAP1 +Stack layout for update_storage_value_offset_uint256_to_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[21], v1, v0]) + convert_uint256_to_uint256: [ReturnLabel[21], v1, v0] -> [FunctionCallReturnLabel[0], v1] + shuffling: + shuffled to: [ReturnLabel[21], v0, FunctionCallReturnLabel[0], v1] + result: [ReturnLabel[21], v0, v2] + prepare_store_uint256: [ReturnLabel[21], v0, v2] -> [FunctionCallReturnLabel[1], v2] + shuffling: + shuffled to: [ReturnLabel[21], v0, FunctionCallReturnLabel[1], v2] + result: [ReturnLabel[21], v0, v3] + sload: [ReturnLabel[21], v0, v3] -> [v0] + shuffling: + shuffled to: [ReturnLabel[21], v0, v3, v0] + result: [ReturnLabel[21], v0, v3, v4] + update_byte_slice_shift: [ReturnLabel[21], v0, v3, v4] -> [FunctionCallReturnLabel[2], v3, v4] + shuffling: + shuffled to: [ReturnLabel[21], v0, FunctionCallReturnLabel[2], v3, v4] + result: [ReturnLabel[21], v0, v5] + sstore: [ReturnLabel[21], v0, v5] -> [v5, v0] + shuffling: + shuffled to: [ReturnLabel[21], v5, v0] + result: [ReturnLabel[21]] + stack out = [ReturnLabel[21]] +Code transform for update_storage_value_offset_uint256_to_uint256 + Generating for Block 0 with label 110 + convert_uint256_to_uint256: [ReturnLabel[21], v1, v0] -> [ReturnLabel[21], v0, FunctionCallReturnLabel[0], v1] + shuffling: SWAP1 PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: convert_uint256_to_uint256 (label=19): [ReturnLabel[21], v0, FunctionCallReturnLabel[0], v1], returnLabel: 112 -> [ReturnLabel[21], v0, v2] + prepare_store_uint256: [ReturnLabel[21], v0, v2] -> [ReturnLabel[21], v0, FunctionCallReturnLabel[1], v2] + shuffling: PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: prepare_store_uint256 (label=20): [ReturnLabel[21], v0, FunctionCallReturnLabel[1], v2], returnLabel: 113 -> [ReturnLabel[21], v0, v3] + sload: [ReturnLabel[21], v0, v3] -> [ReturnLabel[21], v0, v3, v0] + shuffling: DUP2 + Builtin call: sload: [ReturnLabel[21], v0, v3, v0] -> [ReturnLabel[21], v0, v3, v4] + update_byte_slice_shift: [ReturnLabel[21], v0, v3, v4] -> [ReturnLabel[21], v0, FunctionCallReturnLabel[2], v3, v4] + shuffling: PUSH(FunctionCallReturnLabel[2]) SWAP2 SWAP1 + Call: update_byte_slice_shift (label=18): [ReturnLabel[21], v0, FunctionCallReturnLabel[2], v3, v4], returnLabel: 114 -> [ReturnLabel[21], v0, v5] + sstore: [ReturnLabel[21], v0, v5] -> [ReturnLabel[21], v5, v0] + shuffling: SWAP1 + Builtin call: sstore: [ReturnLabel[21], v5, v0] -> [ReturnLabel[21]] + shuffling: +Stack layout for cleanup_t_rational_by + Block 0 (junk=false, stackIn=[ReturnLabel[22], v0]) + stack out = [v0, ReturnLabel[22]] +Code transform for cleanup_t_rational_by + Generating for Block 0 with label 115 + shuffling: SWAP1 +Stack layout for convert_t_rational_by_to_t_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[23], v0]) + cleanup_t_rational_by: [ReturnLabel[23], v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[23], FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[23], v1] + identity: [ReturnLabel[23], v1] -> [FunctionCallReturnLabel[1], v1] + shuffling: + shuffled to: [ReturnLabel[23], FunctionCallReturnLabel[1], v1] + result: [ReturnLabel[23], v2] + cleanup_uint256: [ReturnLabel[23], v2] -> [FunctionCallReturnLabel[2], v2] + shuffling: + shuffled to: [ReturnLabel[23], FunctionCallReturnLabel[2], v2] + result: [ReturnLabel[23], v3] + stack out = [v3, ReturnLabel[23]] +Code transform for convert_t_rational_by_to_t_uint256 + Generating for Block 0 with label 117 + cleanup_t_rational_by: [ReturnLabel[23], v0] -> [ReturnLabel[23], FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: cleanup_t_rational_by (label=22): [ReturnLabel[23], FunctionCallReturnLabel[0], v0], returnLabel: 119 -> [ReturnLabel[23], v1] + identity: [ReturnLabel[23], v1] -> [ReturnLabel[23], FunctionCallReturnLabel[1], v1] + shuffling: PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: identity (label=15): [ReturnLabel[23], FunctionCallReturnLabel[1], v1], returnLabel: 120 -> [ReturnLabel[23], v2] + cleanup_uint256: [ReturnLabel[23], v2] -> [ReturnLabel[23], FunctionCallReturnLabel[2], v2] + shuffling: PUSH(FunctionCallReturnLabel[2]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[23], FunctionCallReturnLabel[2], v2], returnLabel: 121 -> [ReturnLabel[23], v3] + shuffling: SWAP1 +Stack layout for increment_wrapping_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[24], v0]) + add: [ReturnLabel[24], v0] -> [lit1, v0] + shuffling: + shuffled to: [ReturnLabel[24], lit1, v0] + result: [ReturnLabel[24], v1] + cleanup_uint256: [ReturnLabel[24], v1] -> [FunctionCallReturnLabel[0], v1] + shuffling: + shuffled to: [ReturnLabel[24], FunctionCallReturnLabel[0], v1] + result: [ReturnLabel[24], v2] + stack out = [v2, ReturnLabel[24]] +Code transform for increment_wrapping_uint256 + Generating for Block 0 with label 122 + add: [ReturnLabel[24], v0] -> [ReturnLabel[24], lit1, v0] + shuffling: PUSH(lit1) SWAP1 + Builtin call: add: [ReturnLabel[24], lit1, v0] -> [ReturnLabel[24], v1] + cleanup_uint256: [ReturnLabel[24], v1] -> [ReturnLabel[24], FunctionCallReturnLabel[0], v1] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[24], FunctionCallReturnLabel[0], v1], returnLabel: 124 -> [ReturnLabel[24], v2] + shuffling: SWAP1 +Stack layout for shift_right_0_unsigned + Block 0 (junk=false, stackIn=[ReturnLabel[25], v0]) + shr: [ReturnLabel[25], v0] -> [v0, lit0] + shuffling: + shuffled to: [ReturnLabel[25], v0, lit0] + result: [ReturnLabel[25], v1] + stack out = [v1, ReturnLabel[25]] +Code transform for shift_right_0_unsigned + Generating for Block 0 with label 125 + shr: [ReturnLabel[25], v0] -> [ReturnLabel[25], v0, lit0] + shuffling: PUSH(lit0) + Builtin call: shr: [ReturnLabel[25], v0, lit0] -> [ReturnLabel[25], v1] + shuffling: SWAP1 +Stack layout for cleanup_from_storage_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[26], v0]) + stack out = [v0, ReturnLabel[26]] +Code transform for cleanup_from_storage_uint256 + Generating for Block 0 with label 127 + shuffling: SWAP1 +Stack layout for extract_from_storage_value_offset_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[27], v0]) + shift_right_0_unsigned: [ReturnLabel[27], v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[27], FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[27], v1] + cleanup_from_storage_uint256: [ReturnLabel[27], v1] -> [FunctionCallReturnLabel[1], v1] + shuffling: + shuffled to: [ReturnLabel[27], FunctionCallReturnLabel[1], v1] + result: [ReturnLabel[27], v2] + stack out = [v2, ReturnLabel[27]] +Code transform for extract_from_storage_value_offset_uint256 + Generating for Block 0 with label 129 + shift_right_0_unsigned: [ReturnLabel[27], v0] -> [ReturnLabel[27], FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: shift_right_0_unsigned (label=25): [ReturnLabel[27], FunctionCallReturnLabel[0], v0], returnLabel: 131 -> [ReturnLabel[27], v1] + cleanup_from_storage_uint256: [ReturnLabel[27], v1] -> [ReturnLabel[27], FunctionCallReturnLabel[1], v1] + shuffling: PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: cleanup_from_storage_uint256 (label=26): [ReturnLabel[27], FunctionCallReturnLabel[1], v1], returnLabel: 132 -> [ReturnLabel[27], v2] + shuffling: SWAP1 +Stack layout for read_from_storage_split_offset_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[28], v0]) + sload: [ReturnLabel[28], v0] -> [v0] + shuffling: + shuffled to: [ReturnLabel[28], v0] + result: [ReturnLabel[28], v1] + extract_from_storage_value_offset_uint256: [ReturnLabel[28], v1] -> [FunctionCallReturnLabel[0], v1] + shuffling: + shuffled to: [ReturnLabel[28], FunctionCallReturnLabel[0], v1] + result: [ReturnLabel[28], v2] + stack out = [v2, ReturnLabel[28]] +Code transform for read_from_storage_split_offset_uint256 + Generating for Block 0 with label 133 + sload: [ReturnLabel[28], v0] -> [ReturnLabel[28], v0] + shuffling: + Builtin call: sload: [ReturnLabel[28], v0] -> [ReturnLabel[28], v1] + extract_from_storage_value_offset_uint256: [ReturnLabel[28], v1] -> [ReturnLabel[28], FunctionCallReturnLabel[0], v1] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: extract_from_storage_value_offset_uint256 (label=27): [ReturnLabel[28], FunctionCallReturnLabel[0], v1], returnLabel: 135 -> [ReturnLabel[28], v2] + shuffling: SWAP1 +Stack layout for panic_error_0x11 + Block 0 (junk=true, stackIn=[]) + shl: [] -> [lit0, lit1] + shuffling: + shuffled to: [lit0, lit1] + result: [v0] + mstore: [v0] -> [v0, lit2] + shuffling: + shuffled to: [v0, lit2] + result: [] + mstore: [] -> [lit3, lit4] + shuffling: + shuffled to: [lit3, lit4] + result: [] + revert: [] -> [lit5, lit2] + shuffling: + shuffled to: [lit5, lit2] + result: [] + stack out = [] +Code transform for panic_error_0x11 + Generating for Block 0 with label 136 + shl: [] -> [lit0, lit1] + shuffling: PUSH(lit0) PUSH(lit1) + Builtin call: shl: [lit0, lit1] -> [v0] + mstore: [v0] -> [v0, lit2] + shuffling: PUSH(lit2) + Builtin call: mstore: [v0, lit2] -> [] + mstore: [] -> [lit3, lit4] + shuffling: PUSH(lit3) PUSH(lit4) + Builtin call: mstore: [lit3, lit4] -> [] + revert: [] -> [lit5, lit2] + shuffling: PUSH(lit5) PUSH(lit2) + Builtin call: revert: [lit5, lit2] -> [] + shuffling: +Stack layout for checked_mul_uint256 + Block 0 (junk=false, stackIn=[ReturnLabel[30], v1, v0]) + cleanup_uint256: [ReturnLabel[30], v1, v0] -> [FunctionCallReturnLabel[0], v0] + shuffling: + shuffled to: [ReturnLabel[30], v1, FunctionCallReturnLabel[0], v0] + result: [ReturnLabel[30], v1, v2] + cleanup_uint256: [ReturnLabel[30], v1, v2] -> [FunctionCallReturnLabel[1], v1] + shuffling: + shuffled to: [ReturnLabel[30], v2, FunctionCallReturnLabel[1], v1] + result: [ReturnLabel[30], v2, v3] + mul: [ReturnLabel[30], v2, v3] -> [v3, v2] + shuffling: + shuffled to: [ReturnLabel[30], v2, v3, v3, v2] + result: [ReturnLabel[30], v2, v3, v4] + cleanup_uint256: [ReturnLabel[30], v2, v3, v4] -> [FunctionCallReturnLabel[2], v4] + shuffling: + shuffled to: [ReturnLabel[30], v2, v3, FunctionCallReturnLabel[2], v4] + result: [ReturnLabel[30], v2, v3, v5] + div: [ReturnLabel[30], v2, v3, v5] -> [v2, v5] + shuffling: + shuffled to: [ReturnLabel[30], v2, v3, v5, v2, v5] + result: [ReturnLabel[30], v2, v3, v5, v6] + eq: [ReturnLabel[30], v2, v3, v5, v6] -> [v6, v3] + shuffling: + shuffled to: [ReturnLabel[30], v2, v5, v6, v3] + result: [ReturnLabel[30], v2, v5, v7] + iszero: [ReturnLabel[30], v2, v5, v7] -> [v2] + shuffling: + shuffled to: [ReturnLabel[30], v7, v5, v2] + result: [ReturnLabel[30], v7, v5, v8] + or: [ReturnLabel[30], v7, v5, v8] -> [v7, v8] + shuffling: + shuffled to: [ReturnLabel[30], v5, v7, v8] + result: [ReturnLabel[30], v5, v9] + iszero: [ReturnLabel[30], v5, v9] -> [v9] + shuffling: + shuffled to: [ReturnLabel[30], v5, v9] + result: [ReturnLabel[30], v5, v10] + stack out = [ReturnLabel[30], v5] + Block 1 (junk=true, stackIn=[ReturnLabel[30], JUNK]) + panic_error_0x11: [ReturnLabel[30], JUNK] -> [] + shuffling: + shuffled to: [ReturnLabel[30], JUNK] + result: [ReturnLabel[30], JUNK] + stack out = [ReturnLabel[30], JUNK] + Block 2 (junk=false, stackIn=[ReturnLabel[30], v5]) + stack out = [v5, ReturnLabel[30]] +Code transform for checked_mul_uint256 + Generating for Block 0 with label 139 + cleanup_uint256: [ReturnLabel[30], v1, v0] -> [ReturnLabel[30], v1, FunctionCallReturnLabel[0], v0] + shuffling: PUSH(FunctionCallReturnLabel[0]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[30], v1, FunctionCallReturnLabel[0], v0], returnLabel: 144 -> [ReturnLabel[30], v1, v2] + cleanup_uint256: [ReturnLabel[30], v1, v2] -> [ReturnLabel[30], v2, FunctionCallReturnLabel[1], v1] + shuffling: SWAP1 PUSH(FunctionCallReturnLabel[1]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[30], v2, FunctionCallReturnLabel[1], v1], returnLabel: 145 -> [ReturnLabel[30], v2, v3] + mul: [ReturnLabel[30], v2, v3] -> [ReturnLabel[30], v2, v3, v3, v2] + shuffling: DUP1 DUP3 + Builtin call: mul: [ReturnLabel[30], v2, v3, v3, v2] -> [ReturnLabel[30], v2, v3, v4] + cleanup_uint256: [ReturnLabel[30], v2, v3, v4] -> [ReturnLabel[30], v2, v3, FunctionCallReturnLabel[2], v4] + shuffling: PUSH(FunctionCallReturnLabel[2]) SWAP1 + Call: cleanup_uint256 (label=5): [ReturnLabel[30], v2, v3, FunctionCallReturnLabel[2], v4], returnLabel: 146 -> [ReturnLabel[30], v2, v3, v5] + div: [ReturnLabel[30], v2, v3, v5] -> [ReturnLabel[30], v2, v3, v5, v2, v5] + shuffling: DUP3 DUP2 + Builtin call: div: [ReturnLabel[30], v2, v3, v5, v2, v5] -> [ReturnLabel[30], v2, v3, v5, v6] + eq: [ReturnLabel[30], v2, v3, v5, v6] -> [ReturnLabel[30], v2, v5, v6, v3] + shuffling: SWAP1 SWAP2 + Builtin call: eq: [ReturnLabel[30], v2, v5, v6, v3] -> [ReturnLabel[30], v2, v5, v7] + iszero: [ReturnLabel[30], v2, v5, v7] -> [ReturnLabel[30], v7, v5, v2] + shuffling: SWAP2 + Builtin call: iszero: [ReturnLabel[30], v7, v5, v2] -> [ReturnLabel[30], v7, v5, v8] + or: [ReturnLabel[30], v7, v5, v8] -> [ReturnLabel[30], v5, v7, v8] + shuffling: SWAP2 SWAP1 SWAP2 + Builtin call: or: [ReturnLabel[30], v5, v7, v8] -> [ReturnLabel[30], v5, v9] + iszero: [ReturnLabel[30], v5, v9] -> [ReturnLabel[30], v5, v9] + shuffling: + Builtin call: iszero: [ReturnLabel[30], v5, v9] -> [ReturnLabel[30], v5, v10] + shuffling: + JUMPI creating stack for zero layout (to Block 2) [ReturnLabel[30], v5] -> [ReturnLabel[30], v5] + shuffling: + Generating for Block 2 with label 141 + shuffling: SWAP1 + Generating for Block 1 with label 140 + panic_error_0x11: [ReturnLabel[30], v5] -> [ReturnLabel[30], JUNK] + shuffling: + Call: panic_error_0x11 (label=29): [ReturnLabel[30], v5] -> [ReturnLabel[30], v5] + shuffling: +Stack layout for fun_f + Block 0 (junk=false, stackIn=[ReturnLabel[31], v0]) + zero_value_for_split_uint256: [ReturnLabel[31], v0] -> [FunctionCallReturnLabel[0]] + shuffling: + shuffled to: [ReturnLabel[31], v0, FunctionCallReturnLabel[0]] + result: [ReturnLabel[31], v0, v1] + convert_rational_by_to_uint256: [ReturnLabel[31], v0, JUNK] -> [FunctionCallReturnLabel[1], lit1] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[1], lit1] + result: [ReturnLabel[31], v0, JUNK, v2] + update_storage_value_offset_uint256_to_uint256: [ReturnLabel[31], v0, JUNK, v2] -> [FunctionCallReturnLabel[2], v2, lit0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[2], v2, lit0] + result: [ReturnLabel[31], v0, JUNK] + convert_t_rational_by_to_t_uint256: [ReturnLabel[31], v0, JUNK] -> [FunctionCallReturnLabel[3], lit0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[3], lit0] + result: [ReturnLabel[31], v0, JUNK, v3] + stack out = [ReturnLabel[31], v0, JUNK, v3] + Block 2 (junk=false, stackIn=[ReturnLabel[31], v0, JUNK, phi0]) + cleanup_uint256: [ReturnLabel[31], v0, JUNK, phi0] -> [FunctionCallReturnLabel[4], v0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[4], v0] + result: [ReturnLabel[31], v0, JUNK, phi0, v4] + cleanup_uint256: [ReturnLabel[31], v0, JUNK, phi0, v4] -> [FunctionCallReturnLabel[5], phi0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, v4, FunctionCallReturnLabel[5], phi0] + result: [ReturnLabel[31], v0, JUNK, phi0, v4, v5] + lt: [ReturnLabel[31], v0, JUNK, phi0, v4, v5] -> [v4, v5] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, v4, v5] + result: [ReturnLabel[31], v0, JUNK, phi0, v6] + iszero: [ReturnLabel[31], v0, JUNK, phi0, v6] -> [v6] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, v6] + result: [ReturnLabel[31], v0, JUNK, phi0, v7] + stack out = [ReturnLabel[31], v0, JUNK, phi0] + Block 5 (junk=false, stackIn=[ReturnLabel[31], JUNK, JUNK, JUNK]) + stack out = [ReturnLabel[31], JUNK, JUNK, JUNK] + Block 6 (junk=false, stackIn=[ReturnLabel[31], v0, JUNK, phi0]) + read_from_storage_split_offset_uint256: [ReturnLabel[31], v0, JUNK, phi0] -> [FunctionCallReturnLabel[6], lit0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[6], lit0] + result: [ReturnLabel[31], v0, JUNK, phi0, v8] + read_from_storage_split_offset_uint256: [ReturnLabel[31], v0, JUNK, phi0, v8] -> [FunctionCallReturnLabel[7], lit0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, v8, FunctionCallReturnLabel[7], lit0] + result: [ReturnLabel[31], v0, JUNK, phi0, v8, v9] + checked_mul_uint256: [ReturnLabel[31], v0, JUNK, phi0, v8, v9] -> [FunctionCallReturnLabel[8], v9, v8] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[8], v9, v8] + result: [ReturnLabel[31], v0, JUNK, phi0, v10] + update_storage_value_offset_uint256_to_uint256: [ReturnLabel[31], v0, JUNK, phi0, v10] -> [FunctionCallReturnLabel[9], v10, lit0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[9], v10, lit0] + result: [ReturnLabel[31], v0, JUNK, phi0] + stack out = [ReturnLabel[31], v0, JUNK, phi0] + Block 4 (junk=false, stackIn=[ReturnLabel[31], JUNK, JUNK, JUNK]) + read_from_storage_split_offset_uint256: [ReturnLabel[31], JUNK, JUNK, JUNK] -> [FunctionCallReturnLabel[11], lit0] + shuffling: + shuffled to: [ReturnLabel[31], JUNK, JUNK, JUNK, FunctionCallReturnLabel[11], lit0] + result: [ReturnLabel[31], JUNK, JUNK, JUNK, v12] + stack out = [v12, ReturnLabel[31]] + Block 3 (junk=false, stackIn=[ReturnLabel[31], v0, JUNK, phi0]) + increment_wrapping_uint256: [ReturnLabel[31], v0, JUNK, phi0] -> [FunctionCallReturnLabel[10], phi0] + shuffling: + shuffled to: [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[10], phi0] + result: [ReturnLabel[31], v0, JUNK, v11] + stack out = [ReturnLabel[31], v0, JUNK, v11] +Code transform for fun_f + Generating for Block 0 with label 147 + zero_value_for_split_uint256: [ReturnLabel[31], v0] -> [ReturnLabel[31], v0, FunctionCallReturnLabel[0]] + shuffling: PUSH(FunctionCallReturnLabel[0]) + Call: zero_value_for_split_uint256 (label=13): [ReturnLabel[31], v0, FunctionCallReturnLabel[0]], returnLabel: 157 -> [ReturnLabel[31], v0, v1] + convert_rational_by_to_uint256: [ReturnLabel[31], v0, v1] -> [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[1], lit1] + shuffling: PUSH(FunctionCallReturnLabel[1]) PUSH(lit1) + Call: convert_rational_by_to_uint256 (label=16): [ReturnLabel[31], v0, v1, FunctionCallReturnLabel[1], lit1], returnLabel: 158 -> [ReturnLabel[31], v0, v1, v2] + update_storage_value_offset_uint256_to_uint256: [ReturnLabel[31], v0, v1, v2] -> [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[2], v2, lit0] + shuffling: PUSH(FunctionCallReturnLabel[2]) SWAP1 PUSH(lit0) + Call: update_storage_value_offset_uint256_to_uint256 (label=21): [ReturnLabel[31], v0, v1, FunctionCallReturnLabel[2], v2, lit0], returnLabel: 159 -> [ReturnLabel[31], v0, v1] + convert_t_rational_by_to_t_uint256: [ReturnLabel[31], v0, v1] -> [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[3], lit0] + shuffling: PUSH(FunctionCallReturnLabel[3]) PUSH(lit0) + Call: convert_t_rational_by_to_t_uint256 (label=23): [ReturnLabel[31], v0, v1, FunctionCallReturnLabel[3], lit0], returnLabel: 160 -> [ReturnLabel[31], v0, v1, v3] + shuffling: + JUMP creating target stack for jump 0 -> 2 + shuffling: + Generating for Block 2 with label 149 + cleanup_uint256: [ReturnLabel[31], v0, JUNK, phi0] -> [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[4], v0] + shuffling: PUSH(FunctionCallReturnLabel[4]) DUP4 + Call: cleanup_uint256 (label=5): [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[4], v0], returnLabel: 161 -> [ReturnLabel[31], v0, JUNK, phi0, v4] + cleanup_uint256: [ReturnLabel[31], v0, JUNK, phi0, v4] -> [ReturnLabel[31], v0, JUNK, phi0, v4, FunctionCallReturnLabel[5], phi0] + shuffling: PUSH(FunctionCallReturnLabel[5]) DUP3 + Call: cleanup_uint256 (label=5): [ReturnLabel[31], v0, JUNK, phi0, v4, FunctionCallReturnLabel[5], phi0], returnLabel: 162 -> [ReturnLabel[31], v0, JUNK, phi0, v4, v5] + lt: [ReturnLabel[31], v0, JUNK, phi0, v4, v5] -> [ReturnLabel[31], v0, JUNK, phi0, v4, v5] + shuffling: + Builtin call: lt: [ReturnLabel[31], v0, JUNK, phi0, v4, v5] -> [ReturnLabel[31], v0, JUNK, phi0, v6] + iszero: [ReturnLabel[31], v0, JUNK, phi0, v6] -> [ReturnLabel[31], v0, JUNK, phi0, v6] + shuffling: + Builtin call: iszero: [ReturnLabel[31], v0, JUNK, phi0, v6] -> [ReturnLabel[31], v0, JUNK, phi0, v7] + shuffling: + JUMPI creating stack for zero layout (to Block 6) [ReturnLabel[31], v0, JUNK, phi0] -> [ReturnLabel[31], v0, JUNK, phi0] + shuffling: + Generating for Block 6 with label 153 + read_from_storage_split_offset_uint256: [ReturnLabel[31], v0, JUNK, phi0] -> [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[6], lit0] + shuffling: PUSH(FunctionCallReturnLabel[6]) PUSH(lit0) + Call: read_from_storage_split_offset_uint256 (label=28): [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[6], lit0], returnLabel: 163 -> [ReturnLabel[31], v0, JUNK, phi0, v8] + read_from_storage_split_offset_uint256: [ReturnLabel[31], v0, JUNK, phi0, v8] -> [ReturnLabel[31], v0, JUNK, phi0, v8, FunctionCallReturnLabel[7], lit0] + shuffling: PUSH(FunctionCallReturnLabel[7]) PUSH(lit0) + Call: read_from_storage_split_offset_uint256 (label=28): [ReturnLabel[31], v0, JUNK, phi0, v8, FunctionCallReturnLabel[7], lit0], returnLabel: 164 -> [ReturnLabel[31], v0, JUNK, phi0, v8, v9] + checked_mul_uint256: [ReturnLabel[31], v0, JUNK, phi0, v8, v9] -> [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[8], v9, v8] + shuffling: PUSH(FunctionCallReturnLabel[8]) SWAP2 + Call: checked_mul_uint256 (label=30): [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[8], v9, v8], returnLabel: 165 -> [ReturnLabel[31], v0, JUNK, phi0, v10] + update_storage_value_offset_uint256_to_uint256: [ReturnLabel[31], v0, JUNK, phi0, v10] -> [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[9], v10, lit0] + shuffling: PUSH(FunctionCallReturnLabel[9]) SWAP1 PUSH(lit0) + Call: update_storage_value_offset_uint256_to_uint256 (label=21): [ReturnLabel[31], v0, JUNK, phi0, FunctionCallReturnLabel[9], v10, lit0], returnLabel: 166 -> [ReturnLabel[31], v0, JUNK, phi0] + shuffling: + JUMP creating target stack for jump 6 -> 3 + shuffling: + Generating for Block 3 with label 150 + increment_wrapping_uint256: [ReturnLabel[31], v0, JUNK, phi0] -> [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[10], phi0] + shuffling: PUSH(FunctionCallReturnLabel[10]) SWAP1 + Call: increment_wrapping_uint256 (label=24): [ReturnLabel[31], v0, JUNK, FunctionCallReturnLabel[10], phi0], returnLabel: 167 -> [ReturnLabel[31], v0, JUNK, v11] + shuffling: + JUMP creating target stack for jump 3 -> 2 + shuffling: + Generating for Block 5 with label 152 + shuffling: + JUMP creating target stack for jump 5 -> 4 + shuffling: + Generating for Block 4 with label 151 + read_from_storage_split_offset_uint256: [ReturnLabel[31], JUNK, JUNK, JUNK] -> [ReturnLabel[31], JUNK, JUNK, JUNK, FunctionCallReturnLabel[11], lit0] + shuffling: PUSH(FunctionCallReturnLabel[11]) PUSH(lit0) + Call: read_from_storage_split_offset_uint256 (label=28): [ReturnLabel[31], JUNK, JUNK, JUNK, FunctionCallReturnLabel[11], lit0], returnLabel: 168 -> [ReturnLabel[31], JUNK, JUNK, JUNK, v12] + shuffling: SWAP4 SWAP3 POP POP POP + + + +-------------------- +Running SSA CFG code transform +-------------------- +digraph SSACFG { +nodesep=0.7; +graph[fontname="DejaVu Sans"] +node[shape=box,fontname="DejaVu Sans"]; + +Entry [label="Entry"]; +Entry -> Block0_0; +Block0_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 2)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv0 := memoryguard()\l\ +mstore(v0, 0x40)\l\ +v1 := callvalue()\l\ +"]; +Block0_0 -> Block0_0Exit; +Block0_0Exit [label="{ If v1 | { <0> Zero | <1> NonZero }}" shape=Mrecord]; +Block0_0Exit:0 -> Block0_2 [style="solid"]; +Block0_0Exit:1 -> Block0_1 [style="solid"]; +Block0_1 [fillcolor="#FF746C", style=filled, label="\ +Block 1; (1, max 1)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()\l\ +"]; +Block0_1Exit [label="Terminated"]; +Block0_1 -> Block0_1Exit; +Block0_2 [fillcolor="#FF746C", style=filled, label="\ +Block 2; (2, max 2)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nv2 := allocate_unbounded()\l\ +v3 := datasize()\l\ +v4 := dataoffset()\l\ +codecopy(v3, v4, v2)\l\ +v5 := datasize()\l\ +return(v5, v2)\l\ +"]; +Block0_2Exit [label="Terminated"]; +Block0_2 -> Block0_2Exit; +FunctionEntry_allocate_unbounded_0 [label="function allocate_unbounded: + memPtr := allocate_unbounded()"]; +FunctionEntry_allocate_unbounded_0 -> Block1_0; +Block1_0 [label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: v0[1]\l\nUsed: \l\nv0 := mload(0x40)\l\ +"]; +Block1_0Exit [label="FunctionReturn[v0]"]; +Block1_0 -> Block1_0Exit; +FunctionEntry_revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb_0 [label="function revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb: + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb()"]; +FunctionEntry_revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb_0 -> Block2_0; +Block2_0 [fillcolor="#FF746C", style=filled, label="\ +Block 0; (0, max 0)\nLiveIn: \l\ +LiveOut: \l\nUsed: \l\nrevert(0x00, 0x00)\l\ +"]; +Block2_0Exit [label="Terminated"]; +Block2_0 -> Block2_0Exit; +} + +Stack layout for main graph + Block 0 (junk=true, stackIn=[]) + memoryguard: [] -> [] + shuffling: + shuffled to: [] + result: [v0] + mstore: [v0] -> [v0, lit0] + shuffling: + shuffled to: [v0, lit0] + result: [] + callvalue: [] -> [] + shuffling: + shuffled to: [] + result: [v1] + stack out = [] + Block 1 (junk=true, stackIn=[]) + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb: [] -> [] + shuffling: + shuffled to: [] + result: [] + stack out = [] + Block 2 (junk=true, stackIn=[]) + allocate_unbounded: [] -> [FunctionCallReturnLabel[0]] + shuffling: + shuffled to: [FunctionCallReturnLabel[0]] + result: [v2] + datasize: [v2] -> [] + shuffling: + shuffled to: [v2] + result: [v2, v3] + dataoffset: [v2, v3] -> [] + shuffling: + shuffled to: [v2, v3] + result: [v2, v3, v4] + codecopy: [v2, v3, v4] -> [v3, v4, v2] + shuffling: + shuffled to: [v2, v3, v4, v2] + result: [v2] + datasize: [v2] -> [] + shuffling: + shuffled to: [v2] + result: [v2, v5] + return: [v2, v5] -> [v5, v2] + shuffling: + shuffled to: [v5, v2] + result: [] + stack out = [] +Code transform for main + Generating for Block 0 with label 3 + memoryguard: [] -> [] + shuffling: + Builtin call: memoryguard: [] -> [v0] + mstore: [v0] -> [v0, lit0] + shuffling: PUSH(lit0) + Builtin call: mstore: [v0, lit0] -> [] + callvalue: [] -> [] + shuffling: + Builtin call: callvalue: [] -> [v1] + shuffling: + JUMPI creating stack for zero layout (to Block 2) [] -> [] + shuffling: + Generating for Block 2 with label 5 + allocate_unbounded: [] -> [FunctionCallReturnLabel[0]] + shuffling: PUSH(FunctionCallReturnLabel[0]) + Call: allocate_unbounded (label=1): [FunctionCallReturnLabel[0]], returnLabel: 8 -> [v2] + datasize: [v2] -> [v2] + shuffling: + Builtin call: datasize: [v2] -> [v2, v3] + dataoffset: [v2, v3] -> [v2, v3] + shuffling: + Builtin call: dataoffset: [v2, v3] -> [v2, v3, v4] + codecopy: [v2, v3, v4] -> [v2, v3, v4, v2] + shuffling: DUP3 + Builtin call: codecopy: [v2, v3, v4, v2] -> [v2] + datasize: [v2] -> [v2] + shuffling: + Builtin call: datasize: [v2] -> [v2, v5] + return: [v2, v5] -> [v5, v2] + shuffling: SWAP1 + Builtin call: return: [v5, v2] -> [] + shuffling: + Generating for Block 1 with label 4 + revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb: [] -> [] + shuffling: + Call: revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb (label=2): [] -> [] + shuffling: +Stack layout for allocate_unbounded + Block 0 (junk=false, stackIn=[ReturnLabel[1]]) + mload: [ReturnLabel[1]] -> [lit1] + shuffling: + shuffled to: [ReturnLabel[1], lit1] + result: [ReturnLabel[1], v0] + stack out = [v0, ReturnLabel[1]] +Code transform for allocate_unbounded + Generating for Block 0 with label 9 + mload: [ReturnLabel[1]] -> [ReturnLabel[1], lit1] + shuffling: PUSH(lit1) + Builtin call: mload: [ReturnLabel[1], lit1] -> [ReturnLabel[1], v0] + shuffling: SWAP1 +Stack layout for revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb + Block 0 (junk=true, stackIn=[]) + revert: [] -> [lit0, lit0] + shuffling: + shuffled to: [lit0, lit0] + result: [] + stack out = [] +Code transform for revert_error_ca66f745a3ce8ff40e2ccaf1ad45db7774001b90d25810abd9040049be7bf4bb + Generating for Block 0 with label 11 + revert: [] -> [lit0, lit0] + shuffling: PUSH(lit0) DUP1 + Builtin call: revert: [lit0, lit0] -> [] + shuffling: diff --git a/test/cmdlineTests/via_ssa_debug_log_level/input.sol b/test/cmdlineTests/via_ssa_debug_log_level/input.sol new file mode 100644 index 000000000000..82bc60a181c6 --- /dev/null +++ b/test/cmdlineTests/via_ssa_debug_log_level/input.sol @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-3.0 +pragma solidity >=0.0; + +contract C { + uint x; + function f(uint y) public returns (uint) { + x = 1; + for (uint i = 0; i < y; ++i) + x = x * x; + + return x; + } +} diff --git a/test/cmdlineTests/via_ssa_debug_log_level/output b/test/cmdlineTests/via_ssa_debug_log_level/output new file mode 100644 index 000000000000..8fcea765b2e1 --- /dev/null +++ b/test/cmdlineTests/via_ssa_debug_log_level/output @@ -0,0 +1,4 @@ + +======= input.sol:C ======= +Binary: +