From 0b905050313c7eaf88df7af0496f2dcb344e2774 Mon Sep 17 00:00:00 2001 From: Adam Chidlow Date: Fri, 8 Mar 2024 15:13:19 +0800 Subject: [PATCH] feat: pop/popn collapse optimisation refactor: make checking for ABI router only calls (in the context of implicit return elisions) more robust refactor: other non-functional refactorings of the implicit return feature test: ensure there's a multi-valued explicit return combined with implicit returns being tested --- examples/sizes.txt | 2 +- .../voting/out/VotingRoundApp.destructured.ir | 2 +- examples/voting/out/VotingRoundApp.ssa.ir | 4 +- .../out/VotingRoundApp.ssa.opt_pass_1.ir | 2 +- .../out/VotingRoundApp.ssa.opt_pass_2.ir | 2 +- .../out_O2/VotingRoundApp.destructured.ir | 2 +- .../VotingRoundApp.destructured.ir | 2 +- examples/voting/puya.log | 8 +- src/puya/awst_build/validation/arc4_copy.py | 2 +- src/puya/ir/builder/blocks.py | 8 +- src/puya/ir/builder/callsub.py | 95 ++++ src/puya/ir/builder/main.py | 77 +--- src/puya/ir/context.py | 1 - src/puya/ir/main.py | 170 +++---- src/puya/ir/models.py | 14 +- src/puya/teal/optimize/peephole.py | 7 + test_cases/arc4_types/mutable_params.py | 7 +- .../Arc4MutableParamsContract.approval.mir | 275 ++++++------ .../Arc4MutableParamsContract.approval.teal | 55 ++- .../out/Arc4MutableParamsContract.clear.mir | 4 +- .../out/Arc4MutableParamsContract.clear.teal | 2 +- .../Arc4MutableParamsContract.destructured.ir | 51 ++- .../out/Arc4MutableParamsContract.ssa.ir | 117 ++--- ...rc4MutableParamsContract.ssa.opt_pass_1.ir | 77 ++-- ...c4MutableParamsContract.ssa.opt_pass_10.ir | 59 +-- ...c4MutableParamsContract.ssa.opt_pass_11.ir | 57 +-- ...c4MutableParamsContract.ssa.opt_pass_12.ir | 53 +-- ...rc4MutableParamsContract.ssa.opt_pass_2.ir | 71 +-- ...rc4MutableParamsContract.ssa.opt_pass_3.ir | 71 +-- ...rc4MutableParamsContract.ssa.opt_pass_4.ir | 71 +-- ...rc4MutableParamsContract.ssa.opt_pass_5.ir | 71 +-- ...rc4MutableParamsContract.ssa.opt_pass_6.ir | 69 +-- ...rc4MutableParamsContract.ssa.opt_pass_7.ir | 65 +-- ...rc4MutableParamsContract.ssa.opt_pass_8.ir | 63 +-- ...rc4MutableParamsContract.ssa.opt_pass_9.ir | 61 +-- .../out/Arc4StructsTypeContract.approval.teal | 3 +- .../Arc4StructsTypeContract.destructured.ir | 6 +- .../out/Arc4StructsTypeContract.ssa.ir | 16 +- .../Arc4StructsTypeContract.ssa.opt_pass_1.ir | 6 +- .../Arc4StructsTypeContract.ssa.opt_pass_2.ir | 6 +- .../Arc4StructsTypeContract.ssa.opt_pass_3.ir | 6 +- .../Arc4StructsTypeContract.ssa.opt_pass_4.ir | 6 +- .../Arc4StructsTypeContract.ssa.opt_pass_5.ir | 6 +- .../Arc4StructsTypeContract.ssa.opt_pass_6.ir | 6 +- .../Arc4StructsTypeContract.ssa.opt_pass_7.ir | 6 +- .../arc4_types/out/mutable_params.O0.log | 414 +++++++++--------- .../arc4_types/out/mutable_params.O1.log | 309 ++++++------- .../arc4_types/out/mutable_params.O2.log | 307 ++++++------- test_cases/arc4_types/out/mutable_params.awst | 7 +- test_cases/arc4_types/out/structs.O1.log | 3 +- test_cases/arc4_types/out/structs.O2.log | 3 +- .../Arc4MutableParamsContract.approval.teal | 17 +- .../Arc4MutableParamsContract.destructured.ir | 51 ++- .../Arc4StructsTypeContract.approval.teal | 3 +- .../Arc4StructsTypeContract.destructured.ir | 6 +- .../Arc4MutableParamsContract.approval.teal | 74 ++-- .../Arc4MutableParamsContract.clear.teal | 2 +- .../Arc4MutableParamsContract.destructured.ir | 105 ++--- .../Arc4StructsTypeContract.destructured.ir | 8 +- test_cases/arc4_types/puya.log | 269 ++++++------ 60 files changed, 1748 insertions(+), 1594 deletions(-) create mode 100644 src/puya/ir/builder/callsub.py diff --git a/examples/sizes.txt b/examples/sizes.txt index effb248681..11c92214c9 100644 --- a/examples/sizes.txt +++ b/examples/sizes.txt @@ -7,7 +7,7 @@ arc4_types/Arc4Arrays 588 376 376 arc4_types/Arc4BoolEval 569 20 20 arc4_types/Arc4BoolType 329 57 57 arc4_types/Arc4DynamicStringArray 230 112 112 -arc4_types/Arc4MutableParams 344 213 211 +arc4_types/Arc4MutableParams 362 222 220 arc4_types/Arc4Mutation 2803 1452 1451 arc4_types/Arc4NumericTypes 345 8 8 arc4_types/Arc4RefTypes 47 43 43 diff --git a/examples/voting/out/VotingRoundApp.destructured.ir b/examples/voting/out/VotingRoundApp.destructured.ir index 6f932ed1b5..2b62c44a1d 100644 --- a/examples/voting/out/VotingRoundApp.destructured.ir +++ b/examples/voting/out/VotingRoundApp.destructured.ir @@ -97,7 +97,7 @@ contract examples.voting.voting.VotingRoundApp: (app_global_put "quorum" quorum#0) let new_state_value%5#0: bytes = ((extract 2 0) nft_image_url#0) (app_global_put "nft_image_url" new_state_value%5#0) - let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) return subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> bytes: diff --git a/examples/voting/out/VotingRoundApp.ssa.ir b/examples/voting/out/VotingRoundApp.ssa.ir index 6259bf694d..e6903dcddf 100644 --- a/examples/voting/out/VotingRoundApp.ssa.ir +++ b/examples/voting/out/VotingRoundApp.ssa.ir @@ -104,8 +104,8 @@ contract examples.voting.voting.VotingRoundApp: let new_state_value%5#0: bytes = ((extract 2 0) nft_image_url#0) (app_global_put "nft_image_url" new_state_value%5#0) let copy%6#0: bytes = option_counts#0 - let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(copy%6#0) - let copy%6#1: bytes = r_tmp%7#0 + let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(copy%6#0) + let copy%6#1: bytes = store_option_counts%7#0 return subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> bytes: diff --git a/examples/voting/out/VotingRoundApp.ssa.opt_pass_1.ir b/examples/voting/out/VotingRoundApp.ssa.opt_pass_1.ir index ff7c07c048..f40dc3aade 100644 --- a/examples/voting/out/VotingRoundApp.ssa.opt_pass_1.ir +++ b/examples/voting/out/VotingRoundApp.ssa.opt_pass_1.ir @@ -97,7 +97,7 @@ contract examples.voting.voting.VotingRoundApp: (app_global_put "quorum" quorum#0) let new_state_value%5#0: bytes = ((extract 2 0) nft_image_url#0) (app_global_put "nft_image_url" new_state_value%5#0) - let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) return subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> bytes: diff --git a/examples/voting/out/VotingRoundApp.ssa.opt_pass_2.ir b/examples/voting/out/VotingRoundApp.ssa.opt_pass_2.ir index b548443326..ef1b2d9fbe 100644 --- a/examples/voting/out/VotingRoundApp.ssa.opt_pass_2.ir +++ b/examples/voting/out/VotingRoundApp.ssa.opt_pass_2.ir @@ -97,7 +97,7 @@ contract examples.voting.voting.VotingRoundApp: (app_global_put "quorum" quorum#0) let new_state_value%5#0: bytes = ((extract 2 0) nft_image_url#0) (app_global_put "nft_image_url" new_state_value%5#0) - let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) return subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> bytes: diff --git a/examples/voting/out_O2/VotingRoundApp.destructured.ir b/examples/voting/out_O2/VotingRoundApp.destructured.ir index 6f932ed1b5..2b62c44a1d 100644 --- a/examples/voting/out_O2/VotingRoundApp.destructured.ir +++ b/examples/voting/out_O2/VotingRoundApp.destructured.ir @@ -97,7 +97,7 @@ contract examples.voting.voting.VotingRoundApp: (app_global_put "quorum" quorum#0) let new_state_value%5#0: bytes = ((extract 2 0) nft_image_url#0) (app_global_put "nft_image_url" new_state_value%5#0) - let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) + let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) return subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> bytes: diff --git a/examples/voting/out_unoptimized/VotingRoundApp.destructured.ir b/examples/voting/out_unoptimized/VotingRoundApp.destructured.ir index 8219074cb2..e3bc27953d 100644 --- a/examples/voting/out_unoptimized/VotingRoundApp.destructured.ir +++ b/examples/voting/out_unoptimized/VotingRoundApp.destructured.ir @@ -106,7 +106,7 @@ contract examples.voting.voting.VotingRoundApp: let new_state_value%5#0: bytes = ((extract 2 0) nft_image_url#0) (app_global_put "nft_image_url" new_state_value%5#0) let copy%6#0: bytes = option_counts#0 - let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(copy%6#0) + let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(copy%6#0) return subroutine examples.voting.voting.VotingRoundApp.store_option_counts(option_counts: bytes) -> bytes: diff --git a/examples/voting/puya.log b/examples/voting/puya.log index 1ab564942d..acba46ae57 100644 --- a/examples/voting/puya.log +++ b/examples/voting/puya.log @@ -589,10 +589,10 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Found equivalence set: option_counts#0, copy%6#0 debug: Replacing {copy%6#0} with option_counts#0 made 1 modifications -debug: Found equivalence set: r_tmp%7#0, copy%6#1 +debug: Found equivalence set: store_option_counts%7#0, copy%6#1 debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) +debug: Not removing unused assignment since source is not marked as pure: let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -959,7 +959,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) +debug: Not removing unused assignment since source is not marked as pure: let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -1125,7 +1125,7 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) +debug: Not removing unused assignment since source is not marked as pure: let store_option_counts%7#0: bytes = examples.voting.voting.VotingRoundApp.store_option_counts(option_counts#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks diff --git a/src/puya/awst_build/validation/arc4_copy.py b/src/puya/awst_build/validation/arc4_copy.py index eb45d64b02..7e30abd036 100644 --- a/src/puya/awst_build/validation/arc4_copy.py +++ b/src/puya/awst_build/validation/arc4_copy.py @@ -22,7 +22,7 @@ def visit_assignment_statement(self, statement: awst_nodes.AssignmentStatement) def _check_for_arc4_copy(self, expr: awst_nodes.Expression) -> None: match expr.wtype: - case wtypes.ARC4Array(immutable=False) | wtypes.ARC4Struct(immutable=False): + case wtypes.ARC4Type(immutable=False): match expr: case ( awst_nodes.ARC4ArrayEncode() diff --git a/src/puya/ir/builder/blocks.py b/src/puya/ir/builder/blocks.py index 912c4aa5cc..02e0a02e69 100644 --- a/src/puya/ir/builder/blocks.py +++ b/src/puya/ir/builder/blocks.py @@ -11,6 +11,7 @@ ControlOp, Goto, Op, + Parameter, Register, SubroutineReturn, ) @@ -129,13 +130,14 @@ def goto_and_activate(self, block: BasicBlock) -> None: self.goto(block) self.activate_block(block) - def maybe_add_implicit_subroutine_return(self, implicit_returns: Sequence[Register]) -> None: + def maybe_add_implicit_subroutine_return(self, params: Sequence[Parameter]) -> None: if not self._blocks[-1].terminated: self.terminate( SubroutineReturn( result=[ - self.ssa.read_variable(r.name, r.atype, self._blocks[-1]) - for r in implicit_returns + self.ssa.read_variable(p.name, p.atype, self._blocks[-1]) + for p in params + if p.implicit_return ], source_location=None, ) diff --git a/src/puya/ir/builder/callsub.py b/src/puya/ir/builder/callsub.py new file mode 100644 index 0000000000..0a634d329f --- /dev/null +++ b/src/puya/ir/builder/callsub.py @@ -0,0 +1,95 @@ +from collections.abc import Sequence + +import attrs + +from puya.awst import ( + nodes as awst_nodes, + wtypes, +) +from puya.ir.builder._utils import reassign +from puya.ir.context import IRFunctionBuildContext +from puya.ir.models import InvokeSubroutine, Register, Value, ValueProvider, ValueTuple +from puya.ir.utils import format_tuple_index + + +def visit_subroutine_call_expression( + context: IRFunctionBuildContext, expr: awst_nodes.SubroutineCallExpression +) -> ValueProvider | None: + sref = context.resolve_function_reference(expr.target, expr.source_location) + target = context.subroutines[sref] + + arg_lookup = _build_arg_lookup(context, expr.args) + + resolved_args = [] + implicit_args = [] + for idx, param in enumerate(target.parameters): + arg_val = arg_lookup.get(index=idx, name=param.name) + resolved_args.append(arg_val) + if param.implicit_return: + implicit_args.append(arg_val) + + invoke_expr = InvokeSubroutine( + source_location=expr.source_location, args=resolved_args, target=target + ) + if not implicit_args: + return invoke_expr + + return_values = list( + context.visitor.materialise_value_provider(invoke_expr, target.method_name) + ) + while implicit_args: + in_arg = implicit_args.pop() + out_register = return_values.pop() + if isinstance(in_arg, Register): + reassign( + context, + source=out_register, + reg=in_arg, + source_location=expr.source_location, + ) + + return ( + ValueTuple(values=return_values, source_location=expr.source_location) + if return_values + else None + ) + + +@attrs.define +class _ArgLookup: + _positional_args: dict[int, Value] = attrs.field(factory=dict, init=False) + _named_args: dict[str, Value] = attrs.field(factory=dict, init=False) + _arg_idx: int = attrs.field(default=0, init=False) + + def add(self, name: str | None, value: Value) -> None: + if name is None: + self._positional_args[self._arg_idx] = value + else: + self._named_args[name] = value + self._arg_idx += 1 + + def get(self, index: int, name: str | None) -> Value: + if name is not None: + by_name = self._named_args.get(name) + if by_name is not None: + return by_name + return self._positional_args[index] + + +def _build_arg_lookup( + context: IRFunctionBuildContext, args: Sequence[awst_nodes.CallArg] +) -> _ArgLookup: + lookup = _ArgLookup() + for expr_arg in args: + if not isinstance(expr_arg.value.wtype, wtypes.WTuple): + value = context.visitor.visit_and_materialise_single(expr_arg.value) + lookup.add(name=expr_arg.name, value=value) + else: + values = context.visitor.visit_and_materialise(expr_arg.value) + for tup_idx, tup_value in enumerate(values): + if expr_arg.name is None: + tup_item_name = None + else: + tup_item_name = format_tuple_index(expr_arg.name, tup_idx) + lookup.add(name=tup_item_name, value=tup_value) + return lookup diff --git a/src/puya/ir/builder/main.py b/src/puya/ir/builder/main.py index 55c4270938..367b4d7378 100644 --- a/src/puya/ir/builder/main.py +++ b/src/puya/ir/builder/main.py @@ -20,9 +20,9 @@ assert_value, assign, mkblocks, - reassign, ) from puya.ir.builder.assignment import handle_assignment, handle_assignment_expr +from puya.ir.builder.callsub import visit_subroutine_call_expression from puya.ir.builder.iteration import handle_for_in_loop from puya.ir.builder.itxn import InnerTransactionBuilder from puya.ir.context import IRBuildContext, IRFunctionBuildContext @@ -37,7 +37,6 @@ MethodConstant, Op, ProgramExit, - Register, Subroutine, SubroutineReturn, UInt64Constant, @@ -86,9 +85,7 @@ def build_body( insert_on_create_call(func_ctx, to=on_create) function.body.accept(builder) if function.return_type == wtypes.void_wtype: - func_ctx.block_builder.maybe_add_implicit_subroutine_return( - subroutine.implicit_returns - ) + func_ctx.block_builder.maybe_add_implicit_subroutine_return(subroutine.parameters) func_ctx.ssa.verify_complete() func_ctx.block_builder.validate_block_predecessors() result = list(func_ctx.block_builder.blocks) @@ -108,7 +105,7 @@ def visit_copy(self, expr: puya.awst.nodes.Copy) -> TExpression: # will effectively be a copy. We assign the copy to a new register in case it is # mutated. match expr.value.wtype: - case wtypes.ARC4Array() | wtypes.ARC4Struct(): + case wtypes.ARC4Type(immutable=False): # Arc4 encoded types are value types original_value = self.visit_and_materialise_single(expr.value) (copy,) = assign( @@ -540,58 +537,7 @@ def visit_bytes_comparison_expression( def visit_subroutine_call_expression( self, expr: awst_nodes.SubroutineCallExpression ) -> TExpression: - sref = self.context.resolve_function_reference(expr.target, expr.source_location) - target = self.context.subroutines[sref] - # TODO: what if args are multi-valued? - args_expanded = list[tuple[str | None, Value]]() - for expr_arg in expr.args: - if not isinstance(expr_arg.value.wtype, wtypes.WTuple): - arg = self.visit_and_materialise_single(expr_arg.value) - args_expanded.append((expr_arg.name, arg)) - else: - tup_args = self.visit_and_materialise(expr_arg.value) - for tup_idx, tup_arg in enumerate(tup_args): - if expr_arg.name is None: - tup_name: str | None = None - else: - tup_name = format_tuple_index(expr_arg.name, tup_idx) - args_expanded.append((tup_name, tup_arg)) - target_name_to_index = {par.name: idx for idx, par in enumerate(target.parameters)} - resolved_args = [val for name, val in args_expanded] - for name, val in args_expanded: - if name is not None: - name_idx = target_name_to_index[name] - resolved_args[name_idx] = val - invoke_expr = InvokeSubroutine( - source_location=expr.source_location, args=resolved_args, target=target - ) - if not target.implicit_returns: - return invoke_expr - - return_values = self.materialise_value_provider(invoke_expr, "r_tmp") - - for value, register in zip( - return_values[-len(target.implicit_returns) :], target.implicit_returns, strict=True - ): - arg_index = target_name_to_index[register.name] - arg_value = resolved_args[arg_index] - if isinstance(arg_value, Register): - reassign( - self.context, - source_location=expr.source_location, - source=value, - reg=arg_value, - ) - - explicit_return_values = list(return_values[0 : -len(target.implicit_returns)]) - return ( - ValueTuple( - values=explicit_return_values, - source_location=expr.source_location, - ) - if explicit_return_values - else None - ) + return visit_subroutine_call_expression(self.context, expr) def visit_bytes_binary_operation(self, expr: awst_nodes.BytesBinaryOperation) -> TExpression: left = self.visit_and_materialise_single(expr.left) @@ -743,14 +689,15 @@ def visit_return_statement(self, statement: awst_nodes.ReturnStatement) -> TStat else: result = [] - for implicit_return in self.context.subroutine.implicit_returns: - result.append( - self.context.ssa.read_variable( - implicit_return.name, - implicit_return.atype, - self.context.block_builder.active_block, + for param in self.context.subroutine.parameters: + if param.implicit_return: + result.append( + self.context.ssa.read_variable( + param.name, + param.atype, + self.context.block_builder.active_block, + ) ) - ) return_types = [r.atype for r in result] if not ( len(return_types) == len(self.context.subroutine.returns) diff --git a/src/puya/ir/context.py b/src/puya/ir/context.py index 7fa9568178..b315d3cef7 100644 --- a/src/puya/ir/context.py +++ b/src/puya/ir/context.py @@ -24,7 +24,6 @@ class IRBuildContext(CompileContext): module_awsts: Mapping[str, awst_nodes.Module] subroutines: dict[awst_nodes.Function, Subroutine] - function_call_sites: dict[awst_nodes.Function, list[awst_nodes.Function]] embedded_funcs: Sequence[awst_nodes.Function] = attrs.field() contract: awst_nodes.ContractFragment | None = None diff --git a/src/puya/ir/main.py b/src/puya/ir/main.py index 09e5c70704..c9c48a6374 100644 --- a/src/puya/ir/main.py +++ b/src/puya/ir/main.py @@ -1,6 +1,7 @@ import contextlib import itertools import typing +from collections import defaultdict from collections.abc import Iterable, Iterator, Sequence from pathlib import Path @@ -16,23 +17,20 @@ from puya.awst.function_traverser import FunctionTraverser from puya.context import CompileContext from puya.errors import CodeError, InternalError -from puya.ir.arc4_router import ( - create_abi_router, - create_default_clear_state, -) +from puya.ir.arc4_router import create_abi_router, create_default_clear_state from puya.ir.builder.main import FunctionIRBuilder from puya.ir.context import IRBuildContext, IRBuildContextWithFallback from puya.ir.destructure.main import destructure_ssa from puya.ir.models import ( Contract, + Parameter, Program, - Register, Subroutine, ) from puya.ir.optimize.dead_code_elimination import remove_unused_subroutines from puya.ir.optimize.main import optimize_contract_ir from puya.ir.to_text_visitor import output_contract_ir_to_path -from puya.ir.types_ import wtype_to_avm_type +from puya.ir.types_ import wtype_to_avm_type, wtype_to_avm_types from puya.ir.utils import format_tuple_index from puya.models import ARC4Method, ARC4MethodConfig, ContractMetaData, ContractState from puya.parse import EMBEDDED_MODULES @@ -41,6 +39,9 @@ logger = structlog.get_logger() +CalleesLookup: typing.TypeAlias = defaultdict[awst_nodes.Function, set[awst_nodes.Function]] + + def build_module_irs( context: CompileContext, module_asts: dict[str, awst_nodes.Module] ) -> dict[str, list[Contract]]: @@ -53,7 +54,6 @@ def build_module_irs( build_context: IRBuildContext = attrs_extend( IRBuildContext, context, - function_call_sites={}, subroutines={}, module_awsts=module_asts, embedded_funcs=embedded_funcs, @@ -101,7 +101,7 @@ def optimize_and_destructure_ir( def _build_embedded_ir(ctx: IRBuildContext) -> None: for func in ctx.embedded_funcs: - ctx.subroutines[func] = _make_subroutine(func, ctx) + ctx.subroutines[func] = _make_subroutine(func, allow_implicits=False) for func in ctx.embedded_funcs: sub = ctx.subroutines[func] @@ -118,18 +118,26 @@ def _build_ir(ctx: IRBuildContextWithFallback, contract: awst_nodes.ContractFrag contract.source_location, ) # visit call graph starting at entry point(s) to collect all references for each - approval_subs_srefs = SubroutineCollector.collect(ctx, start=folded.approval_program) - clear_subs_srefs = SubroutineCollector.collect(ctx, start=folded.clear_program) + callees = CalleesLookup(set) + approval_subs_srefs = SubroutineCollector.collect( + ctx, start=folded.approval_program, callees=callees + ) + clear_subs_srefs = SubroutineCollector.collect( + ctx, start=folded.clear_program, callees=callees + ) if folded.init: - approval_subs_srefs.append(folded.init) - init_sub_srefs = SubroutineCollector.collect(ctx, start=folded.init) - approval_subs_srefs.extend(init_sub_srefs) + approval_subs_srefs.add(folded.init) + init_sub_srefs = SubroutineCollector.collect(ctx, start=folded.init, callees=callees) + approval_subs_srefs |= init_sub_srefs # construct unique Subroutine objects for each function # that was referenced through either entry point for func in itertools.chain(approval_subs_srefs, clear_subs_srefs): if func not in ctx.subroutines: + allow_implicits = _should_include_implicit_returns( + func, callees=callees[func], approval_program=folded.approval_program + ) # make the emtpy subroutine, because functions reference other functions - ctx.subroutines[func] = _make_subroutine(func, ctx) + ctx.subroutines[func] = _make_subroutine(func, allow_implicits=allow_implicits) # now construct the subroutine IR for func, sub in ctx.subroutines.items(): if not sub.body: # in case something is pre-built (ie from embedded lib) @@ -164,56 +172,36 @@ def _build_ir(ctx: IRBuildContextWithFallback, contract: awst_nodes.ContractFrag return result -def _get_mutable_params( - args: Sequence[awst_nodes.SubroutineArgument], -) -> Iterator[tuple[Register, wtypes.WType]]: - for arg in args: - if isinstance(arg.wtype, wtypes.WTuple): - for tup_idx, tup_type in enumerate(arg.wtype.types): - if tup_type.immutable: - continue - yield Register( - source_location=arg.source_location, - version=0, - name=format_tuple_index(arg.name, tup_idx), - atype=wtype_to_avm_type(tup_type), - ), tup_type - else: - if arg.wtype.immutable: - continue - yield ( - Register( - source_location=arg.source_location, - version=0, - name=arg.name, - atype=wtype_to_avm_type(arg.wtype), - ), - arg.wtype, - ) - - -def _expand_tuple_params(args: Sequence[awst_nodes.SubroutineArgument]) -> Iterator[Register]: +def _build_parameter_list( + args: Sequence[awst_nodes.SubroutineArgument], *, allow_implicits: bool +) -> Iterator[Parameter]: for arg in args: if isinstance(arg.wtype, wtypes.WTuple): for tup_idx, tup_type in enumerate(arg.wtype.types): - yield Register( + yield Parameter( source_location=arg.source_location, version=0, name=format_tuple_index(arg.name, tup_idx), atype=wtype_to_avm_type(tup_type), + implicit_return=allow_implicits and not tup_type.immutable, ) else: yield ( - Register( + Parameter( source_location=arg.source_location, version=0, name=arg.name, atype=wtype_to_avm_type(arg.wtype), + implicit_return=allow_implicits and not arg.wtype.immutable, ) ) -def _should_include_implicit_returns(func: awst_nodes.Function, ctx: IRBuildContext) -> bool: +def _should_include_implicit_returns( + func: awst_nodes.Function, + callees: set[awst_nodes.Function], + approval_program: awst_nodes.Function, +) -> bool: """ Determine if a function should implicitly return mutable reference parameters. @@ -221,41 +209,20 @@ def _should_include_implicit_returns(func: awst_nodes.Function, ctx: IRBuildCont implicitly return anything as we know our router is not interested in anything but the explicit return value. - Anything else would require further analysis, so err on the side of caution and include include + Anything else would require further analysis, so err on the side of caution and include the implicit returns. """ - if not isinstance(func, awst_nodes.ContractMethod) or not func.abimethod_config: - return True - # REFACTOR OPPORTUNITY: Use a more robust method to identify the approval_program than by name - return any( - f - for f in ctx.function_call_sites.get(func, []) - if isinstance(f, awst_nodes.ContractMethod) and f.name != "approval_program" - ) + if isinstance(func, awst_nodes.ContractMethod) and func.abimethod_config: + return bool(callees - {approval_program}) + return True -def _make_subroutine(func: awst_nodes.Function, ctx: IRBuildContext) -> Subroutine: +def _make_subroutine(func: awst_nodes.Function, *, allow_implicits: bool) -> Subroutine: """Pre-construct subroutine with an empty body""" - parameters = list(_expand_tuple_params(func.args)) - - if isinstance(func.return_type, wtypes.WTuple): - returns = [wtype_to_avm_type(t) for t in func.return_type.types] - elif func.return_type is wtypes.void_wtype: - returns = [] - else: - returns = [wtype_to_avm_type(func.return_type)] - - if _should_include_implicit_returns(func, ctx): - # We implicitly return any mutable parameter so the calling code can gain access - # to the mutated value. This is required because on the AVM we pass 'by value' but wish to - # maintain the 'by ref' semantics of the source language - mutable_params_and_wtypes = list(_get_mutable_params(func.args)) - implicit_returns, implicit_returns_wtypes = ( - zip(*mutable_params_and_wtypes) if mutable_params_and_wtypes else ([], []) - ) - returns.extend(wtype_to_avm_type(t) for t in implicit_returns_wtypes) - else: - implicit_returns = [] + + parameters = list(_build_parameter_list(func.args, allow_implicits=allow_implicits)) + + returns = wtype_to_avm_types(func.return_type) return Subroutine( source_location=func.source_location, @@ -264,7 +231,6 @@ def _make_subroutine(func: awst_nodes.Function, ctx: IRBuildContext) -> Subrouti method_name=func.name, parameters=parameters, returns=returns, - implicit_returns=implicit_returns, body=[], ) @@ -285,7 +251,6 @@ def _make_program( class_name=main.class_name, method_name=main.name, parameters=[], - implicit_returns=[], returns=[AVMType.uint64], body=[], ) @@ -368,44 +333,35 @@ def fold_state_and_special_methods( class SubroutineCollector(FunctionTraverser): - def __init__(self, context: IRBuildContext) -> None: + def __init__(self, context: IRBuildContext, callees: CalleesLookup) -> None: self.context = context - # use dictionary with empty values to have quick set semantics, - # but maintain ordering - self.result = dict[awst_nodes.Function, None]() + self.result = StableSet[awst_nodes.Function]() + self.callees = callees self._func_stack = list[awst_nodes.Function]() - @contextlib.contextmanager - def enter_func(self, func: awst_nodes.Function) -> Iterator[None]: - self._func_stack.append(func) - try: - yield - finally: - self._func_stack.pop() - - def record_func_call(self, func: awst_nodes.Function) -> None: - call_site = self._func_stack[-1] - if func in self.context.function_call_sites: - if call_site not in self.context.function_call_sites[func]: - self.context.function_call_sites[func].append(call_site) - else: - self.context.function_call_sites[func] = [call_site] - @classmethod def collect( - cls, context: IRBuildContext, start: awst_nodes.Function - ) -> list[awst_nodes.Function]: - collector = cls(context) - with collector.enter_func(start): + cls, context: IRBuildContext, start: awst_nodes.Function, callees: CalleesLookup + ) -> StableSet[awst_nodes.Function]: + collector = cls(context, callees) + with collector._enter_func(start): # noqa: SLF001 start.body.accept(collector) - - return list(collector.result.keys()) + return collector.result def visit_subroutine_call_expression(self, expr: awst_nodes.SubroutineCallExpression) -> None: super().visit_subroutine_call_expression(expr) func = self.context.resolve_function_reference(expr.target, expr.source_location) - self.record_func_call(func) + callee = self._func_stack[-1] + self.callees[func].add(callee) if func not in self.result: - self.result[func] = None - with self.enter_func(func): + self.result.add(func) + with self._enter_func(func): func.body.accept(self) + + @contextlib.contextmanager + def _enter_func(self, func: awst_nodes.Function) -> Iterator[None]: + self._func_stack.append(func) + try: + yield + finally: + self._func_stack.pop() diff --git a/src/puya/ir/models.py b/src/puya/ir/models.py index 36665ff9a7..0cad035da0 100644 --- a/src/puya/ir/models.py +++ b/src/puya/ir/models.py @@ -654,6 +654,11 @@ def _frozen_data(self) -> object: return self.comment +@attrs.frozen +class Parameter(Register): + implicit_return: bool + + @attrs.define(eq=False) class Subroutine(Context): # source_location might be None if it was synthesized e.g. ARC4 approval method @@ -661,11 +666,14 @@ class Subroutine(Context): module_name: str class_name: str | None # None if a function (vs a method) method_name: str - parameters: Sequence[Register] - returns: Sequence[AVMType] - implicit_returns: Sequence[Register] + parameters: Sequence[Parameter] + _returns: Sequence[AVMType] body: list[BasicBlock] = attrs.field() + @property + def returns(self) -> Sequence[AVMType]: + return [*self._returns, *(p.atype for p in self.parameters if p.implicit_return)] + @body.validator def _check_blocks(self, _attribute: object, body: list[BasicBlock]) -> None: blocks = frozenset(body) diff --git a/src/puya/teal/optimize/peephole.py b/src/puya/teal/optimize/peephole.py index d55f4d17cb..ee1a3a7bb9 100644 --- a/src/puya/teal/optimize/peephole.py +++ b/src/puya/teal/optimize/peephole.py @@ -87,6 +87,13 @@ def _optimize_pair(a: models.TealOp, b: models.TealOp) -> tuple[list[models.Teal (n2,) = b.immediates or (1,) assert isinstance(n2, int) return [models.DupN(n=n1 + n2, source_location=a.source_location)], True + # combine consecutive pop/popn's + case models.TealOp(op_code="pop" | "popn"), models.TealOp(op_code="pop" | "popn"): + (n1,) = a.immediates or (1,) + assert isinstance(n1, int) + (n2,) = b.immediates or (1,) + assert isinstance(n2, int) + return [models.PopN(n=n1 + n2, source_location=a.source_location)], True # `dig 1; dig 1` -> `dup2` case models.TealOpN(op_code="dig", n=1), models.TealOpN(op_code="dig", n=1): return [models.Dup2(source_location=a.source_location or b.source_location)], True diff --git a/test_cases/arc4_types/mutable_params.py b/test_cases/arc4_types/mutable_params.py index de77605cd0..edf61753c8 100644 --- a/test_cases/arc4_types/mutable_params.py +++ b/test_cases/arc4_types/mutable_params.py @@ -49,7 +49,9 @@ def mutating_copies(self) -> None: assert my_array[2] == UInt8(5), "my_array should be mutated" # Pass to subroutine without a copy - self.other_routine(my_array, my_struct) + t, f = self.other_routine(my_array, my_struct) + assert t + assert not f assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" @@ -88,9 +90,10 @@ def mutating_copies(self) -> None: self.other_routine_2(nested.test_array.copy()) @subroutine - def other_routine(self, array: TestArray, struct: TestStruct) -> None: + def other_routine(self, array: TestArray, struct: TestStruct) -> tuple[bool, bool]: array[1] = UInt8(5) struct.s_val_1 = String("AARRGH!") + return True, False @subroutine def other_routine_2(self, array: TestArray) -> TestArray: diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir b/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir index 330f2a13d3..1ff9af7cbf 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.mir @@ -27,151 +27,164 @@ mutating_copies_block@0: // virtual: store tmp%19#0 to l-stack (no copy) my_array#1,tmp%19#0 my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 // virtual: load tmp%19#0 from l-stack (no copy) my_array#1,tmp%19#0 assert my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 assert // my_array should be mutated // my_array#1 assert my_array[2] == UInt8(5), "my_array should be mutated" arc4_types/mutable_params.py:49 - // virtual: load my_array#1 from l-stack (no copy) my_array#1 # Pass to subroutine without a copy\nself.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 + // virtual: load my_array#1 from l-stack (no copy) my_array#1 to subroutine without a copy\nt, f = self.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 byte 0x80320006000d00054861707079000444617973 // my_array#1,0x80320006000d00054861707079000444617973 TestStruct(\nb_val=Bool(True),\nu_val=UInt8(50),\ns_val_1=String("Happy"),\ns_val_2=String("Days"... arc4_types/mutable_params.py:36-41 - callsub other_routine // {other_routine}.0,{other_routine}.1 # Pass to subroutine without a copy\nself.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 - swap // store my_struct#1 to l-stack (no copy) my_struct#1,{other_routine}.0 # Pass to subroutine without a copy\nself.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 - // virtual: store my_array#1 to l-stack (no copy) my_struct#1,my_array#1 # Pass to subroutine without a copy\nself.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 - dup // load my_array#1 from l-stack (copy) my_struct#1,my_array#1,my_array#1 my_array[1] arc4_types/mutable_params.py:54 - extract 1 1 // my_struct#1,my_array#1,{extract} my_array[1] arc4_types/mutable_params.py:54 - // virtual: store tmp%23#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%23#0 my_array[1] arc4_types/mutable_params.py:54 - // virtual: load tmp%23#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%23#0 my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:54 - byte 0x05 // my_struct#1,my_array#1,tmp%23#0,0x05 5 arc4_types/mutable_params.py:54 - b== // my_struct#1,my_array#1,{b==} my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:54 - // virtual: store tmp%24#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%24#0 my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:54 - // virtual: load tmp%24#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%24#0 assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:54 - assert // my_array has been mutated by the subroutine // my_struct#1,my_array#1 assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:54 - dig 1 // load my_struct#1 from l-stack (copy) my_struct#1,my_array#1,my_struct#1 my_struct.s_val_1 arc4_types/mutable_params.py:56 - int 2 // my_struct#1,my_array#1,my_struct#1,2 my_struct.s_val_1 arc4_types/mutable_params.py:56 - extract_uint16 // my_struct#1,my_array#1,{extract_uint16} my_struct.s_val_1 arc4_types/mutable_params.py:56 - // virtual: store item_index%25#0 to l-stack (no copy) my_struct#1,my_array#1,item_index%25#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - dig 2 // load my_struct#1 from l-stack (copy) my_struct#1,my_array#1,item_index%25#0,my_struct#1 my_struct.s_val_1 arc4_types/mutable_params.py:56 - dig 1 // load item_index%25#0 from l-stack (copy) my_struct#1,my_array#1,item_index%25#0,my_struct#1,item_index%25#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - extract_uint16 // my_struct#1,my_array#1,item_index%25#0,{extract_uint16} my_struct.s_val_1 arc4_types/mutable_params.py:56 - // virtual: store item_length%26#0 to l-stack (no copy) my_struct#1,my_array#1,item_index%25#0,item_length%26#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - // virtual: load item_length%26#0 from l-stack (no copy) my_struct#1,my_array#1,item_index%25#0,item_length%26#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - int 2 // my_struct#1,my_array#1,item_index%25#0,item_length%26#0,2 my_struct.s_val_1 arc4_types/mutable_params.py:56 - + // my_struct#1,my_array#1,item_index%25#0,{+} my_struct.s_val_1 arc4_types/mutable_params.py:56 - // virtual: store item_length_plus_2%27#0 to l-stack (no copy) my_struct#1,my_array#1,item_index%25#0,item_length_plus_2%27#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - uncover 3 // load my_struct#1 from l-stack (no copy) my_array#1,item_index%25#0,item_length_plus_2%27#0,my_struct#1 my_struct.s_val_1 arc4_types/mutable_params.py:56 - uncover 2 // load item_index%25#0 from l-stack (no copy) my_array#1,item_length_plus_2%27#0,my_struct#1,item_index%25#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - uncover 2 // load item_length_plus_2%27#0 from l-stack (no copy) my_array#1,my_struct#1,item_index%25#0,item_length_plus_2%27#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - extract3 // my_array#1,{extract3} my_struct.s_val_1 arc4_types/mutable_params.py:56 - // virtual: store tmp%28#0 to l-stack (no copy) my_array#1,tmp%28#0 my_struct.s_val_1 arc4_types/mutable_params.py:56 - // virtual: load tmp%28#0 from l-stack (no copy) my_array#1,tmp%28#0 my_struct.s_val_1 == String(\n"AARRGH!"\n) arc4_types/mutable_params.py:56-58 - byte "\x00\x07AARRGH!" // my_array#1,tmp%28#0,"\x00\x07AARRGH!" String(\n"AARRGH!"\n) arc4_types/mutable_params.py:56-58 - == // my_array#1,{==} my_struct.s_val_1 == String(\n"AARRGH!"\n) arc4_types/mutable_params.py:56-58 - // virtual: store tmp%29#0 to l-stack (no copy) my_array#1,tmp%29#0 my_struct.s_val_1 == String(\n"AARRGH!"\n) arc4_types/mutable_params.py:56-58 - // virtual: load tmp%29#0 from l-stack (no copy) my_array#1,tmp%29#0 assert my_struct.s_val_1 == String(\n"AARRGH!"\n), "my_struct has been mutated by the subroutine" arc4_types/mutable_params.py:56-58 - assert // my_struct has been mutated by the subroutine // my_array#1 assert my_struct.s_val_1 == String(\n"AARRGH!"\n), "my_struct has been mutated by the subroutine" arc4_types/mutable_params.py:56-58 + callsub other_routine // {other_routine}.0,{other_routine}.1,{other_routine}.2,{other_routine}.3 to subroutine without a copy\nt, f = self.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 + cover 3 // store my_struct#1 to l-stack (no copy) my_struct#1,{other_routine}.0,{other_routine}.1,{other_routine}.2 to subroutine without a copy\nt, f = self.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 + cover 2 // store my_array#1 to l-stack (no copy) my_struct#1,my_array#1,{other_routine}.0,{other_routine}.1 to subroutine without a copy\nt, f = self.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 + swap // store f#0 to l-stack (no copy) my_struct#1,my_array#1,f#0,{other_routine}.0 to subroutine without a copy\nt, f = self.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 + // virtual: store t#0 to l-stack (no copy) my_struct#1,my_array#1,f#0,t#0 to subroutine without a copy\nt, f = self.other_routine(my_array, my_struct) arc4_types/mutable_params.py:51-52 + // virtual: load t#0 from l-stack (no copy) my_struct#1,my_array#1,f#0,t#0 assert t arc4_types/mutable_params.py:53 + assert // my_struct#1,my_array#1,f#0 assert t arc4_types/mutable_params.py:53 + // virtual: load f#0 from l-stack (no copy) my_struct#1,my_array#1,f#0 not f arc4_types/mutable_params.py:54 + ! // my_struct#1,my_array#1,{!} not f arc4_types/mutable_params.py:54 + // virtual: store tmp%24#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%24#0 not f arc4_types/mutable_params.py:54 + // virtual: load tmp%24#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%24#0 assert not f arc4_types/mutable_params.py:54 + assert // my_struct#1,my_array#1 assert not f arc4_types/mutable_params.py:54 + dup // load my_array#1 from l-stack (copy) my_struct#1,my_array#1,my_array#1 my_array[1] arc4_types/mutable_params.py:56 + extract 1 1 // my_struct#1,my_array#1,{extract} my_array[1] arc4_types/mutable_params.py:56 + // virtual: store tmp%26#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%26#0 my_array[1] arc4_types/mutable_params.py:56 + // virtual: load tmp%26#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%26#0 my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 + byte 0x05 // my_struct#1,my_array#1,tmp%26#0,0x05 5 arc4_types/mutable_params.py:56 + b== // my_struct#1,my_array#1,{b==} my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 + // virtual: store tmp%27#0 to l-stack (no copy) my_struct#1,my_array#1,tmp%27#0 my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 + // virtual: load tmp%27#0 from l-stack (no copy) my_struct#1,my_array#1,tmp%27#0 assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 + assert // my_array has been mutated by the subroutine // my_struct#1,my_array#1 assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" arc4_types/mutable_params.py:56 + dig 1 // load my_struct#1 from l-stack (copy) my_struct#1,my_array#1,my_struct#1 my_struct.s_val_1 arc4_types/mutable_params.py:58 + int 2 // my_struct#1,my_array#1,my_struct#1,2 my_struct.s_val_1 arc4_types/mutable_params.py:58 + extract_uint16 // my_struct#1,my_array#1,{extract_uint16} my_struct.s_val_1 arc4_types/mutable_params.py:58 + // virtual: store item_index%28#0 to l-stack (no copy) my_struct#1,my_array#1,item_index%28#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + dig 2 // load my_struct#1 from l-stack (copy) my_struct#1,my_array#1,item_index%28#0,my_struct#1 my_struct.s_val_1 arc4_types/mutable_params.py:58 + dig 1 // load item_index%28#0 from l-stack (copy) my_struct#1,my_array#1,item_index%28#0,my_struct#1,item_index%28#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + extract_uint16 // my_struct#1,my_array#1,item_index%28#0,{extract_uint16} my_struct.s_val_1 arc4_types/mutable_params.py:58 + // virtual: store item_length%29#0 to l-stack (no copy) my_struct#1,my_array#1,item_index%28#0,item_length%29#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + // virtual: load item_length%29#0 from l-stack (no copy) my_struct#1,my_array#1,item_index%28#0,item_length%29#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + int 2 // my_struct#1,my_array#1,item_index%28#0,item_length%29#0,2 my_struct.s_val_1 arc4_types/mutable_params.py:58 + + // my_struct#1,my_array#1,item_index%28#0,{+} my_struct.s_val_1 arc4_types/mutable_params.py:58 + // virtual: store item_length_plus_2%30#0 to l-stack (no copy) my_struct#1,my_array#1,item_index%28#0,item_length_plus_2%30#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + uncover 3 // load my_struct#1 from l-stack (no copy) my_array#1,item_index%28#0,item_length_plus_2%30#0,my_struct#1 my_struct.s_val_1 arc4_types/mutable_params.py:58 + uncover 2 // load item_index%28#0 from l-stack (no copy) my_array#1,item_length_plus_2%30#0,my_struct#1,item_index%28#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + uncover 2 // load item_length_plus_2%30#0 from l-stack (no copy) my_array#1,my_struct#1,item_index%28#0,item_length_plus_2%30#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + extract3 // my_array#1,{extract3} my_struct.s_val_1 arc4_types/mutable_params.py:58 + // virtual: store tmp%31#0 to l-stack (no copy) my_array#1,tmp%31#0 my_struct.s_val_1 arc4_types/mutable_params.py:58 + // virtual: load tmp%31#0 from l-stack (no copy) my_array#1,tmp%31#0 my_struct.s_val_1 == String(\n"AARRGH!"\n) arc4_types/mutable_params.py:58-60 + byte "\x00\x07AARRGH!" // my_array#1,tmp%31#0,"\x00\x07AARRGH!" String(\n"AARRGH!"\n) arc4_types/mutable_params.py:58-60 + == // my_array#1,{==} my_struct.s_val_1 == String(\n"AARRGH!"\n) arc4_types/mutable_params.py:58-60 + // virtual: store tmp%32#0 to l-stack (no copy) my_array#1,tmp%32#0 my_struct.s_val_1 == String(\n"AARRGH!"\n) arc4_types/mutable_params.py:58-60 + // virtual: load tmp%32#0 from l-stack (no copy) my_array#1,tmp%32#0 assert my_struct.s_val_1 == String(\n"AARRGH!"\n), "my_struct has been mutated by the subroutine" arc4_types/mutable_params.py:58-60 + assert // my_struct has been mutated by the subroutine // my_array#1 assert my_struct.s_val_1 == String(\n"AARRGH!"\n), "my_struct has been mutated by the subroutine" arc4_types/mutable_params.py:58-60 byte 0x01020304 // my_array#1,0x01020304 StaticArray(UInt8(1), UInt8(2), UInt8(3), UInt8(4)) arc4_types/mutable_params.py:35 byte 0x80320006000d00054861707079000444617973 // my_array#1,0x01020304,0x80320006000d00054861707079000444617973 TestStruct(\nb_val=Bool(True),\nu_val=UInt8(50),\ns_val_1=String("Happy"),\ns_val_2=String("Days"... arc4_types/mutable_params.py:36-41 - callsub other_routine // my_array#1,{other_routine}.0,{other_routine}.1 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:60-61 - pop // my_array#1,{other_routine}.0 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:60-61 - pop // my_array#1 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:60-61 + callsub other_routine // my_array#1,{other_routine}.0,{other_routine}.1,{other_routine}.2,{other_routine}.3 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:62-63 + pop // my_array#1,{other_routine}.0,{other_routine}.1,{other_routine}.2 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:62-63 + pop // my_array#1,{other_routine}.0,{other_routine}.1 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:62-63 + pop // my_array#1,{other_routine}.0 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:62-63 + pop // my_array#1 # Pass to subroutine with copy\nself.other_routine(my_array_copy.copy(), my_struct_copy.copy()) arc4_types/mutable_params.py:62-63 byte 0x01020304 // my_array#1,0x01020304 StaticArray(UInt8(1), UInt8(2), UInt8(3), UInt8(4)) arc4_types/mutable_params.py:35 - callsub other_routine_2 // my_array#1,{other_routine_2}.0,{other_routine_2}.1 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:73 - pop // my_array#1,{other_routine_2}.0 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:73 - // virtual: store my_array_copy_2#2 to l-stack (no copy) my_array#1,my_array_copy_2#2 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:73 - dup // load my_array_copy_2#2 from l-stack (copy) my_array#1,my_array_copy_2#2,my_array_copy_2#2 my_array_copy_2[0] arc4_types/mutable_params.py:75 - extract 0 1 // my_array#1,my_array_copy_2#2,{extract} my_array_copy_2[0] arc4_types/mutable_params.py:75 - // virtual: store tmp%46#0 to l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%46#0 my_array_copy_2[0] arc4_types/mutable_params.py:75 - // virtual: load tmp%46#0 from l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%46#0 my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:75 - byte 0x01 // my_array#1,my_array_copy_2#2,tmp%46#0,0x01 1 arc4_types/mutable_params.py:75 - b== // my_array#1,my_array_copy_2#2,{b==} my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:75 - // virtual: store tmp%47#0 to l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%47#0 my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:75 - // virtual: load tmp%47#0 from l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%47#0 assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:75 - assert // my_array_copy_2 should have original value // my_array#1,my_array_copy_2#2 assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:75 - // virtual: load my_array_copy_2#2 from l-stack (no copy) my_array#1,my_array_copy_2#2 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:77 - callsub other_routine_2 // my_array#1,{other_routine_2}.0,{other_routine_2}.1 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:77 - swap // store my_array_copy_2#2 to l-stack (no copy) my_array#1,my_array_copy_2#2,{other_routine_2}.0 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:77 - pop // my_array#1,my_array_copy_2#2 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:77 - // virtual: load my_array_copy_2#2 from l-stack (no copy) my_array#1,my_array_copy_2#2 my_array_copy_2[0] arc4_types/mutable_params.py:78 - extract 0 1 // my_array#1,{extract} my_array_copy_2[0] arc4_types/mutable_params.py:78 - // virtual: store tmp%51#0 to l-stack (no copy) my_array#1,tmp%51#0 my_array_copy_2[0] arc4_types/mutable_params.py:78 - // virtual: load tmp%51#0 from l-stack (no copy) my_array#1,tmp%51#0 my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:78 - byte 0x0a // my_array#1,tmp%51#0,0x0a 10 arc4_types/mutable_params.py:78 - b== // my_array#1,{b==} my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:78 - // virtual: store tmp%52#0 to l-stack (no copy) my_array#1,tmp%52#0 my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:78 - // virtual: load tmp%52#0 from l-stack (no copy) my_array#1,tmp%52#0 assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:78 - assert // my_array_copy_2 should have mutated value // my_array#1 assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:78 - // virtual: load my_array#1 from l-stack (no copy) my_array#1 nested.test_array arc4_types/mutable_params.py:88 - extract 0 4 // {extract} nested.test_array arc4_types/mutable_params.py:88 - // virtual: store tmp%56#0 to l-stack (no copy) tmp%56#0 nested.test_array arc4_types/mutable_params.py:88 - // virtual: load tmp%56#0 from l-stack (no copy) tmp%56#0 self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:88 - callsub other_routine_2 // {other_routine_2}.0,{other_routine_2}.1 self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:88 - pop // {other_routine_2}.0 self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:88 - pop // self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:88 + callsub other_routine_2 // my_array#1,{other_routine_2}.0,{other_routine_2}.1 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:75 + pop // my_array#1,{other_routine_2}.0 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:75 + // virtual: store my_array_copy_2#2 to l-stack (no copy) my_array#1,my_array_copy_2#2 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:75 + dup // load my_array_copy_2#2 from l-stack (copy) my_array#1,my_array_copy_2#2,my_array_copy_2#2 my_array_copy_2[0] arc4_types/mutable_params.py:77 + extract 0 1 // my_array#1,my_array_copy_2#2,{extract} my_array_copy_2[0] arc4_types/mutable_params.py:77 + // virtual: store tmp%51#0 to l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%51#0 my_array_copy_2[0] arc4_types/mutable_params.py:77 + // virtual: load tmp%51#0 from l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%51#0 my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 + byte 0x01 // my_array#1,my_array_copy_2#2,tmp%51#0,0x01 1 arc4_types/mutable_params.py:77 + b== // my_array#1,my_array_copy_2#2,{b==} my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 + // virtual: store tmp%52#0 to l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%52#0 my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 + // virtual: load tmp%52#0 from l-stack (no copy) my_array#1,my_array_copy_2#2,tmp%52#0 assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 + assert // my_array_copy_2 should have original value // my_array#1,my_array_copy_2#2 assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" arc4_types/mutable_params.py:77 + // virtual: load my_array_copy_2#2 from l-stack (no copy) my_array#1,my_array_copy_2#2 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:79 + callsub other_routine_2 // my_array#1,{other_routine_2}.0,{other_routine_2}.1 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:79 + swap // store my_array_copy_2#2 to l-stack (no copy) my_array#1,my_array_copy_2#2,{other_routine_2}.0 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:79 + pop // my_array#1,my_array_copy_2#2 self.other_routine_2(my_array_copy_2) arc4_types/mutable_params.py:79 + // virtual: load my_array_copy_2#2 from l-stack (no copy) my_array#1,my_array_copy_2#2 my_array_copy_2[0] arc4_types/mutable_params.py:80 + extract 0 1 // my_array#1,{extract} my_array_copy_2[0] arc4_types/mutable_params.py:80 + // virtual: store tmp%56#0 to l-stack (no copy) my_array#1,tmp%56#0 my_array_copy_2[0] arc4_types/mutable_params.py:80 + // virtual: load tmp%56#0 from l-stack (no copy) my_array#1,tmp%56#0 my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 + byte 0x0a // my_array#1,tmp%56#0,0x0a 10 arc4_types/mutable_params.py:80 + b== // my_array#1,{b==} my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 + // virtual: store tmp%57#0 to l-stack (no copy) my_array#1,tmp%57#0 my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 + // virtual: load tmp%57#0 from l-stack (no copy) my_array#1,tmp%57#0 assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 + assert // my_array_copy_2 should have mutated value // my_array#1 assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" arc4_types/mutable_params.py:80 + // virtual: load my_array#1 from l-stack (no copy) my_array#1 nested.test_array arc4_types/mutable_params.py:90 + extract 0 4 // {extract} nested.test_array arc4_types/mutable_params.py:90 + // virtual: store tmp%61#0 to l-stack (no copy) tmp%61#0 nested.test_array arc4_types/mutable_params.py:90 + // virtual: load tmp%61#0 from l-stack (no copy) tmp%61#0 self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:90 + callsub other_routine_2 // {other_routine_2}.0,{other_routine_2}.1 self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:90 + pop // {other_routine_2}.0 self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:90 + pop // self.other_routine_2(nested.test_array.copy()) arc4_types/mutable_params.py:90 retsub // -// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> bytes, bytes: +// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> uint64, uint64, bytes, bytes: other_routine: - proto 2 2 // (𝕡) array#0,struct#0 | @subroutine\ndef other_routine(self, array: TestArray, struct: TestStruct) -> None: arc4_types/mutable_params.py:90-91 + proto 2 4 // (𝕡) array#0,struct#0 | @subroutine\ndef other_routine(self, array: TestArray, struct: TestStruct) -> tuple[bool, bool]: arc4_types/mutable_params.py:92-93 other_routine_block@0: - frame_dig -2 // load array#0 from parameters (𝕡) array#0,struct#0 | array#0 array[1] = UInt8(5) arc4_types/mutable_params.py:92 - byte 0x05 // (𝕡) array#0,struct#0 | array#0,0x05 5 arc4_types/mutable_params.py:92 - replace2 1 // (𝕡) array#0,struct#0 | {replace2} array[1] = UInt8(5) arc4_types/mutable_params.py:92 - frame_bury -2 // store array#0 to parameters (no copy) (𝕡) array#0,struct#0 | array[1] = UInt8(5) arc4_types/mutable_params.py:92 - frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - int 2 // (𝕡) array#0,struct#0 | struct#0,2 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - extract_uint16 // (𝕡) array#0,struct#0 | {extract_uint16} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store item_offset%3#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - int 0 // (𝕡) array#0,struct#0 | item_offset%3#0,struct#0,0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - dig 2 // load item_offset%3#0 from l-stack (copy) (𝕡) array#0,struct#0 | item_offset%3#0,struct#0,0,item_offset%3#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - extract3 // (𝕡) array#0,struct#0 | item_offset%3#0,{extract3} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store data_up_to_item%4#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - int 4 // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,struct#0,4 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - extract_uint16 // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,{extract_uint16} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store next_item_offset%5#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - len // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,{len} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store total_data_length%6#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,total_data_length%6#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,total_data_length%6#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - uncover 2 // load next_item_offset%5#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,total_data_length%6#0,struct#0,next_item_offset%5#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - uncover 2 // load total_data_length%6#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,struct#0,next_item_offset%5#0,total_data_length%6#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - substring3 // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,{substring3} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store data_beyond_item%7#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,data_beyond_item%7#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - swap // load data_up_to_item%4#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,data_up_to_item%4#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - byte "\x00\x07AARRGH!" // (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,data_up_to_item%4#0,"\x00\x07AARRGH!" String("AARRGH!") arc4_types/mutable_params.py:93 - concat // (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,{concat} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store updated_data%8#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: load updated_data%8#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - swap // load data_beyond_item%7#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,updated_data%8#0,data_beyond_item%7#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - concat // (𝕡) array#0,struct#0 | item_offset%3#0,{concat} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store updated_data%8#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - swap // load item_offset%3#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,item_offset%3#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - int 9 // (𝕡) array#0,struct#0 | updated_data%8#0,item_offset%3#0,9 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - + // (𝕡) array#0,struct#0 | updated_data%8#0,{+} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store tail_cursor%10#0 to l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,tail_cursor%10#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: load tail_cursor%10#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,tail_cursor%10#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - itob // (𝕡) array#0,struct#0 | updated_data%8#0,{itob} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store updated_header_bytes%11#0 to l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: load updated_header_bytes%11#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - substring 6 8 // (𝕡) array#0,struct#0 | updated_data%8#0,{substring} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: store updated_header_bytes%11#0 to l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: load updated_data%8#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_header_bytes%11#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - // virtual: load updated_header_bytes%11#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - replace2 4 // (𝕡) array#0,struct#0 | {replace2} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - frame_bury -1 // store struct#0 to parameters (no copy) (𝕡) array#0,struct#0 | struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:93 - frame_dig -2 // load array#0 from parameters (𝕡) array#0,struct#0 | array#0 - frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | array#0,struct#0 - retsub // array#0,struct#0 + frame_dig -2 // load array#0 from parameters (𝕡) array#0,struct#0 | array#0 array[1] = UInt8(5) arc4_types/mutable_params.py:94 + byte 0x05 // (𝕡) array#0,struct#0 | array#0,0x05 5 arc4_types/mutable_params.py:94 + replace2 1 // (𝕡) array#0,struct#0 | {replace2} array[1] = UInt8(5) arc4_types/mutable_params.py:94 + frame_bury -2 // store array#0 to parameters (no copy) (𝕡) array#0,struct#0 | array[1] = UInt8(5) arc4_types/mutable_params.py:94 + frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + int 2 // (𝕡) array#0,struct#0 | struct#0,2 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + extract_uint16 // (𝕡) array#0,struct#0 | {extract_uint16} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store item_offset%3#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + int 0 // (𝕡) array#0,struct#0 | item_offset%3#0,struct#0,0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + dig 2 // load item_offset%3#0 from l-stack (copy) (𝕡) array#0,struct#0 | item_offset%3#0,struct#0,0,item_offset%3#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + extract3 // (𝕡) array#0,struct#0 | item_offset%3#0,{extract3} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store data_up_to_item%4#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + int 4 // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,struct#0,4 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + extract_uint16 // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,{extract_uint16} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store next_item_offset%5#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + len // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,{len} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store total_data_length%6#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,total_data_length%6#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,next_item_offset%5#0,total_data_length%6#0,struct#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + uncover 2 // load next_item_offset%5#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,total_data_length%6#0,struct#0,next_item_offset%5#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + uncover 2 // load total_data_length%6#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,struct#0,next_item_offset%5#0,total_data_length%6#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + substring3 // (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,{substring3} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store data_beyond_item%7#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_up_to_item%4#0,data_beyond_item%7#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + swap // load data_up_to_item%4#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,data_up_to_item%4#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + byte "\x00\x07AARRGH!" // (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,data_up_to_item%4#0,"\x00\x07AARRGH!" String("AARRGH!") arc4_types/mutable_params.py:95 + concat // (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,{concat} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store updated_data%8#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: load updated_data%8#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,data_beyond_item%7#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + swap // load data_beyond_item%7#0 from l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,updated_data%8#0,data_beyond_item%7#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + concat // (𝕡) array#0,struct#0 | item_offset%3#0,{concat} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store updated_data%8#0 to l-stack (no copy) (𝕡) array#0,struct#0 | item_offset%3#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + swap // load item_offset%3#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,item_offset%3#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + int 9 // (𝕡) array#0,struct#0 | updated_data%8#0,item_offset%3#0,9 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + + // (𝕡) array#0,struct#0 | updated_data%8#0,{+} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store tail_cursor%10#0 to l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,tail_cursor%10#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: load tail_cursor%10#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,tail_cursor%10#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + itob // (𝕡) array#0,struct#0 | updated_data%8#0,{itob} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store updated_header_bytes%11#0 to l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: load updated_header_bytes%11#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + substring 6 8 // (𝕡) array#0,struct#0 | updated_data%8#0,{substring} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: store updated_header_bytes%11#0 to l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: load updated_data%8#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_header_bytes%11#0,updated_data%8#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + // virtual: load updated_header_bytes%11#0 from l-stack (no copy) (𝕡) array#0,struct#0 | updated_data%8#0,updated_header_bytes%11#0 struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + replace2 4 // (𝕡) array#0,struct#0 | {replace2} struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + frame_bury -1 // store struct#0 to parameters (no copy) (𝕡) array#0,struct#0 | struct.s_val_1 = String("AARRGH!") arc4_types/mutable_params.py:95 + int 1 // (𝕡) array#0,struct#0 | 1 True arc4_types/mutable_params.py:96 + int 0 // (𝕡) array#0,struct#0 | 1,0 False arc4_types/mutable_params.py:96 + frame_dig -2 // load array#0 from parameters (𝕡) array#0,struct#0 | 1,0,array#0 return True, False arc4_types/mutable_params.py:96 + frame_dig -1 // load struct#0 from parameters (𝕡) array#0,struct#0 | 1,0,array#0,struct#0 return True, False arc4_types/mutable_params.py:96 + retsub // 1,0,array#0,struct#0 return True, False arc4_types/mutable_params.py:96 // test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> bytes, bytes: other_routine_2: - proto 1 2 // (𝕡) array#0 | @subroutine\ndef other_routine_2(self, array: TestArray) -> TestArray: arc4_types/mutable_params.py:95-96 + proto 1 2 // (𝕡) array#0 | @subroutine\ndef other_routine_2(self, array: TestArray) -> TestArray: arc4_types/mutable_params.py:98-99 other_routine_2_block@0: - frame_dig -1 // load array#0 from parameters (𝕡) array#0 | array#0 array[0] = UInt8(10) arc4_types/mutable_params.py:98 - byte 0x0a // (𝕡) array#0 | array#0,0x0a 10 arc4_types/mutable_params.py:98 - replace2 0 // (𝕡) array#0 | {replace2} array[0] = UInt8(10) arc4_types/mutable_params.py:98 - // virtual: store array#1 to l-stack (no copy) (𝕡) array#0 | array#1 array[0] = UInt8(10) arc4_types/mutable_params.py:98 - frame_dig -1 // load array#0 from parameters (𝕡) array#0 | array#1,array#0 return copy arc4_types/mutable_params.py:99 - swap // load array#1 from l-stack (no copy) (𝕡) array#0 | array#0,array#1 return copy arc4_types/mutable_params.py:99 - retsub // array#0,array#1 return copy arc4_types/mutable_params.py:99 + frame_dig -1 // load array#0 from parameters (𝕡) array#0 | array#0 array[0] = UInt8(10) arc4_types/mutable_params.py:101 + byte 0x0a // (𝕡) array#0 | array#0,0x0a 10 arc4_types/mutable_params.py:101 + replace2 0 // (𝕡) array#0 | {replace2} array[0] = UInt8(10) arc4_types/mutable_params.py:101 + // virtual: store array#1 to l-stack (no copy) (𝕡) array#0 | array#1 array[0] = UInt8(10) arc4_types/mutable_params.py:101 + frame_dig -1 // load array#0 from parameters (𝕡) array#0 | array#1,array#0 return copy arc4_types/mutable_params.py:102 + swap // load array#1 from l-stack (no copy) (𝕡) array#0 | array#0,array#1 return copy arc4_types/mutable_params.py:102 + retsub // array#0,array#1 return copy arc4_types/mutable_params.py:102 diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.teal b/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.teal index de6a2e040d..6c5c75d970 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.teal +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.approval.teal @@ -40,17 +40,26 @@ mutating_copies: byte 0x80320006000d00054861707079000444617973 // arc4_types/mutable_params.py:51-52 // # Pass to subroutine without a copy - // self.other_routine(my_array, my_struct) + // t, f = self.other_routine(my_array, my_struct) callsub other_routine + cover 3 + cover 2 swap + // arc4_types/mutable_params.py:53 + // assert t + assert // arc4_types/mutable_params.py:54 + // assert not f + ! + assert + // arc4_types/mutable_params.py:56 // assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" dup extract 1 1 byte 0x05 b== assert // my_array has been mutated by the subroutine - // arc4_types/mutable_params.py:56 + // arc4_types/mutable_params.py:58 // assert my_struct.s_val_1 == String( dig 1 int 2 @@ -64,7 +73,7 @@ mutating_copies: uncover 2 uncover 2 extract3 - // arc4_types/mutable_params.py:56-58 + // arc4_types/mutable_params.py:58-60 // assert my_struct.s_val_1 == String( // "AARRGH!" // ), "my_struct has been mutated by the subroutine" @@ -82,58 +91,56 @@ mutating_copies: // s_val_2=String("Days"), // ) byte 0x80320006000d00054861707079000444617973 - // arc4_types/mutable_params.py:60-61 + // arc4_types/mutable_params.py:62-63 // # Pass to subroutine with copy // self.other_routine(my_array_copy.copy(), my_struct_copy.copy()) callsub other_routine - pop - pop + popn 4 // arc4_types/mutable_params.py:35 // my_array = StaticArray(UInt8(1), UInt8(2), UInt8(3), UInt8(4)) byte 0x01020304 - // arc4_types/mutable_params.py:73 + // arc4_types/mutable_params.py:75 // my_array_copy_2 = self.other_routine_2(my_array_copy_2) callsub other_routine_2 pop - // arc4_types/mutable_params.py:75 + // arc4_types/mutable_params.py:77 // assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" dup extract 0 1 byte 0x01 b== assert // my_array_copy_2 should have original value - // arc4_types/mutable_params.py:77 + // arc4_types/mutable_params.py:79 // self.other_routine_2(my_array_copy_2) callsub other_routine_2 bury 1 - // arc4_types/mutable_params.py:78 + // arc4_types/mutable_params.py:80 // assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" extract 0 1 byte 0x0a b== assert // my_array_copy_2 should have mutated value - // arc4_types/mutable_params.py:88 + // arc4_types/mutable_params.py:90 // self.other_routine_2(nested.test_array.copy()) extract 0 4 callsub other_routine_2 - pop - pop + popn 2 retsub -// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> bytes, bytes: +// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> uint64, uint64, bytes, bytes: other_routine: - // arc4_types/mutable_params.py:90-91 + // arc4_types/mutable_params.py:92-93 // @subroutine - // def other_routine(self, array: TestArray, struct: TestStruct) -> None: - proto 2 2 - // arc4_types/mutable_params.py:92 + // def other_routine(self, array: TestArray, struct: TestStruct) -> tuple[bool, bool]: + proto 2 4 + // arc4_types/mutable_params.py:94 // array[1] = UInt8(5) frame_dig -2 byte 0x05 replace2 1 frame_bury -2 - // arc4_types/mutable_params.py:93 + // arc4_types/mutable_params.py:95 // struct.s_val_1 = String("AARRGH!") frame_dig -1 int 2 @@ -162,6 +169,10 @@ other_routine: substring 6 8 replace2 4 frame_bury -1 + // arc4_types/mutable_params.py:96 + // return True, False + int 1 + int 0 frame_dig -2 frame_dig -1 retsub @@ -169,16 +180,16 @@ other_routine: // test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> bytes, bytes: other_routine_2: - // arc4_types/mutable_params.py:95-96 + // arc4_types/mutable_params.py:98-99 // @subroutine // def other_routine_2(self, array: TestArray) -> TestArray: proto 1 2 - // arc4_types/mutable_params.py:98 + // arc4_types/mutable_params.py:101 // array[0] = UInt8(10) frame_dig -1 byte 0x0a replace2 0 - // arc4_types/mutable_params.py:99 + // arc4_types/mutable_params.py:102 // return copy frame_dig -1 swap diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.mir b/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.mir index 05ed84ff50..50996ccc8e 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.mir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.mir @@ -4,6 +4,6 @@ // test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: main_block@0: - int 1 // 1 True arc4_types/mutable_params.py:119 - return // return True arc4_types/mutable_params.py:119 + int 1 // 1 True arc4_types/mutable_params.py:122 + return // return True arc4_types/mutable_params.py:122 diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.teal b/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.teal index 1d4ab23766..1713261473 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.teal +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.clear.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program: - // arc4_types/mutable_params.py:119 + // arc4_types/mutable_params.py:122 // return True int 1 return diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.destructured.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.destructured.ir index 4c001f41ba..f2332c219a 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.destructured.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.destructured.ir @@ -11,31 +11,34 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#1: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#1) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let (t#0: uint64, f#0: uint64, my_array#1: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#1) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#2: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#1) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#2: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#1) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#0: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -48,14 +51,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#0: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#0: bytes = ((replace2 4) updated_data%8#0 updated_header_bytes%11#0) - return array#0 struct#0 + return 1u 0u array#0 struct#0 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.ir index 38f83e9a03..842d61b5b7 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.ir @@ -46,62 +46,67 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = (extract3 my_array#1 item_index%17#0 1u) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (r_tmp%20#0: bytes, r_tmp%21#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let my_array#2: bytes = r_tmp%20#0 - let my_struct#1: bytes = r_tmp%21#0 - let item_index%22#0: uint64 = (* 1u 1u) - let tmp%23#0: bytes = (extract3 my_array#2 item_index%22#0 1u) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let copy%30#0: bytes = my_array_copy#0 - let copy%31#0: bytes = my_struct_copy#0 - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(copy%30#0, copy%31#0) - let copy%30#1: bytes = r_tmp%32#0 - let copy%31#1: bytes = r_tmp%33#0 - let item_index%34#0: uint64 = (* 1u 1u) - let tmp%35#0: bytes = (extract3 my_array_copy#0 item_index%34#0 1u) - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct_copy#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct_copy#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct_copy#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine - let copy%42#0: bytes = my_array_copy#0 - let my_array_copy_2#0: bytes = copy%42#0 - let (r_tmp%43#0: bytes, r_tmp%44#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#0) - let my_array_copy_2#1: bytes = r_tmp%44#0 - let my_array_copy_2#2: bytes = (r_tmp%43#0) - let item_index%45#0: uint64 = (* 0u 1u) - let tmp%46#0: bytes = (extract3 my_array_copy_2#2 item_index%45#0 1u) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, r_tmp%49#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let my_array_copy_2#3: bytes = r_tmp%49#0 + let (other_routine%20#0: uint64, other_routine%21#0: uint64, other_routine%22#0: bytes, other_routine%23#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + let my_struct#1: bytes = other_routine%23#0 + let my_array#2: bytes = other_routine%22#0 + let t#0: uint64 = other_routine%20#0 + let f#0: uint64 = other_routine%21#0 + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let item_index%25#0: uint64 = (* 1u 1u) + let tmp%26#0: bytes = (extract3 my_array#2 item_index%25#0 1u) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let copy%33#0: bytes = my_array_copy#0 + let copy%34#0: bytes = my_struct_copy#0 + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(copy%33#0, copy%34#0) + let copy%34#1: bytes = other_routine%38#0 + let copy%33#1: bytes = other_routine%37#0 + let item_index%39#0: uint64 = (* 1u 1u) + let tmp%40#0: bytes = (extract3 my_array_copy#0 item_index%39#0 1u) + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct_copy#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct_copy#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct_copy#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine + let copy%47#0: bytes = my_array_copy#0 + let my_array_copy_2#0: bytes = copy%47#0 + let (other_routine_2%48#0: bytes, other_routine_2%49#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#0) + let my_array_copy_2#1: bytes = other_routine_2%49#0 + let my_array_copy_2#2: bytes = (other_routine_2%48#0) let item_index%50#0: uint64 = (* 0u 1u) - let tmp%51#0: bytes = (extract3 my_array_copy_2#3 item_index%50#0 1u) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let copy%53#0: bytes = my_array#2 - let current_tail_offset%54#0: uint64 = 4u - let encoded_tuple_buffer%55#0: bytes = 0x - let encoded_tuple_buffer%55#1: bytes = (concat encoded_tuple_buffer%55#0 copy%53#0) - let nested#0: bytes = encoded_tuple_buffer%55#1 - let tmp%56#0: bytes = (extract3 nested#0 0u 4u) - let copy%57#0: bytes = tmp%56#0 - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(copy%57#0) - let copy%57#1: bytes = r_tmp%59#0 + let tmp%51#0: bytes = (extract3 my_array_copy_2#2 item_index%50#0 1u) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, other_routine_2%54#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let my_array_copy_2#3: bytes = other_routine_2%54#0 + let item_index%55#0: uint64 = (* 0u 1u) + let tmp%56#0: bytes = (extract3 my_array_copy_2#3 item_index%55#0 1u) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let copy%58#0: bytes = my_array#2 + let current_tail_offset%59#0: uint64 = 4u + let encoded_tuple_buffer%60#0: bytes = 0x + let encoded_tuple_buffer%60#1: bytes = (concat encoded_tuple_buffer%60#0 copy%58#0) + let nested#0: bytes = encoded_tuple_buffer%60#1 + let tmp%61#0: bytes = (extract3 nested#0 0u 4u) + let copy%62#0: bytes = tmp%61#0 + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(copy%62#0) + let copy%62#1: bytes = other_routine_2%64#0 return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let assigned_value%0#0: bytes = 0x05 let updated_target%1#0: bytes = (replace3 array#0 1u assigned_value%0#0) let array#1: bytes = updated_target%1#0 @@ -119,10 +124,10 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let updated_data%8#2: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) let struct#1: bytes = updated_data%8#2 - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let copy%0#0: bytes = array#0 let copy#0: bytes = copy%0#0 let assigned_value%1#0: bytes = 0x0a @@ -132,5 +137,5 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_1.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_1.ir index 37f95b6fc0..5933c038f1 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_1.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_1.ir @@ -33,45 +33,48 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = (extract3 my_array#1 item_index%17#0 1u) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let item_index%22#0: uint64 = 1u - let tmp%23#0: bytes = (extract3 my_array#2 item_index%22#0 1u) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) - let item_index%34#0: uint64 = 1u - let tmp%35#0: bytes = (extract3 my_array#0 item_index%34#0 1u) - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let item_index%25#0: uint64 = 1u + let tmp%26#0: bytes = (extract3 my_array#2 item_index%25#0 1u) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) + let item_index%39#0: uint64 = 1u + let tmp%40#0: bytes = (extract3 my_array#0 item_index%39#0 1u) + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array#0) - let item_index%45#0: uint64 = 0u - let tmp%46#0: bytes = (extract3 my_array_copy_2#2 item_index%45#0 1u) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) let item_index%50#0: uint64 = 0u - let tmp%51#0: bytes = (extract3 my_array_copy_2#3 item_index%50#0 1u) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value + let tmp%51#0: bytes = (extract3 my_array_copy_2#2 item_index%50#0 1u) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let item_index%55#0: uint64 = 0u + let tmp%56#0: bytes = (extract3 my_array_copy_2#3 item_index%55#0 1u) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value let nested#0: bytes = my_array#2 - let tmp%56#0: bytes = ((extract 0 4) nested#0) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%61#0: bytes = ((extract 0 4) nested#0) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -85,14 +88,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_10.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_10.ir index ec2d2414c7..2ed6a5c2fd 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_10.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_10.ir @@ -11,34 +11,37 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) - let tmp%40#0: bytes = 0x00054861707079 - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let tmp%45#0: bytes = 0x00054861707079 + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -51,14 +54,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_11.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_11.ir index b4c5609a15..4b306da814 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_11.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_11.ir @@ -11,33 +11,36 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) - let tmp%41#0: uint64 = 1u - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let tmp%46#0: uint64 = 1u + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -50,14 +53,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_12.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_12.ir index 04a328ba14..9f3ce7b420 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_12.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_12.ir @@ -11,31 +11,34 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -48,14 +51,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_2.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_2.ir index 38dc919c2e..627ac45f16 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_2.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_2.ir @@ -25,40 +25,43 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) - let tmp%35#0: bytes = ((extract 1 1) my_array#0) - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) + let tmp%40#0: bytes = ((extract 1 1) my_array#0) + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array#0) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -71,14 +74,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_3.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_3.ir index fa116291f4..806f13fb8b 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_3.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_3.ir @@ -21,40 +21,43 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) - let tmp%35#0: bytes = ((extract 1 1) my_array#0) - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) + let tmp%40#0: bytes = ((extract 1 1) my_array#0) + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array#0) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -67,14 +70,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_4.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_4.ir index f24c9735e5..aaa26cf053 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_4.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_4.ir @@ -18,40 +18,43 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) - let tmp%35#0: bytes = ((extract 1 1) my_array#0) - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) + let tmp%40#0: bytes = ((extract 1 1) my_array#0) + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array#0) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -64,14 +67,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_5.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_5.ir index c164d334e8..2bb29a4f8b 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_5.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_5.ir @@ -16,40 +16,43 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) - let tmp%35#0: bytes = 0x02 - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) + let tmp%40#0: bytes = 0x02 + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -62,14 +65,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_6.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_6.ir index a1b4b8f186..f952b43195 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_6.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_6.ir @@ -14,39 +14,42 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) - let tmp%36#0: uint64 = 1u - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, my_struct#0) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) + let tmp%41#0: uint64 = 1u + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -59,14 +62,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_7.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_7.ir index cb3e88f47b..7a47df42a9 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_7.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_7.ir @@ -11,37 +11,40 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) - let item_index%37#0: uint64 = 6u - let item_length%38#0: uint64 = (extract_uint16 0x80320006000d00054861707079000444617973 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 0x80320006000d00054861707079000444617973 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let item_index%42#0: uint64 = 6u + let item_length%43#0: uint64 = (extract_uint16 0x80320006000d00054861707079000444617973 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 0x80320006000d00054861707079000444617973 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -54,14 +57,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_8.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_8.ir index 3a4f16e437..2068c66026 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_8.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_8.ir @@ -11,36 +11,39 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) - let item_length%38#0: uint64 = 5u - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 0x80320006000d00054861707079000444617973 6u item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let item_length%43#0: uint64 = 5u + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 0x80320006000d00054861707079000444617973 6u item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -53,14 +56,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_9.ir b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_9.ir index 6fc37c9ecc..6ffbd09ca7 100644 --- a/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_9.ir +++ b/test_cases/arc4_types/out/Arc4MutableParamsContract.ssa.opt_pass_9.ir @@ -11,35 +11,38 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#2) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) - let item_length_plus_2%39#0: uint64 = 7u - let tmp%40#0: bytes = (extract3 0x80320006000d00054861707079000444617973 6u item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine + let (t#0: uint64, f#0: uint64, my_array#2: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#2) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let item_length_plus_2%44#0: uint64 = 7u + let tmp%45#0: bytes = (extract3 0x80320006000d00054861707079000444617973 6u item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) - let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#3) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#2) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#3: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#3) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#2) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#1: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -52,14 +55,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#1: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#1: bytes = ((replace2 4) updated_data%8#1 updated_header_bytes%11#1) - return array#1 struct#1 + return 1u 0u array#1 struct#1 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.approval.teal b/test_cases/arc4_types/out/Arc4StructsTypeContract.approval.teal index 2a662e1df0..f5f6f18387 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.approval.teal +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.approval.teal @@ -11,8 +11,7 @@ test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program: // arc4_types/structs.py:29 // coord_3 = add(coord_1.copy(), coord_2.copy()) callsub add - pop - pop + popn 2 // arc4_types/structs.py:30 // for val in (coord_3.x, coord_3.y): dup diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.destructured.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.destructured.ir index 2d4ac31184..db57057262 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.destructured.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.destructured.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -16,9 +16,9 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let tuple_index%11#3: uint64 = (+ tuple_index%11#0 1u) goto tuple_index%11#0 ? block@5 : block@2 block@5: // after_for_L30 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) (log 0xa0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.ir index b55e64886f..14c0139c85 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.ir @@ -14,10 +14,10 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let coord_2#0: bytes = encoded_tuple_buffer%3#2 let copy%4#0: bytes = coord_1#0 let copy%5#0: bytes = coord_2#0 - let (r_tmp%6#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(copy%4#0, copy%5#0) - let copy%4#1: bytes = r_tmp%7#0 - let copy%5#1: bytes = r_tmp%8#0 - let coord_3#0: bytes = (r_tmp%6#0) + let (add%6#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(copy%4#0, copy%5#0) + let copy%5#1: bytes = add%8#0 + let copy%4#1: bytes = add%7#0 + let coord_3#0: bytes = (add%6#0) let tmp%9#0: bytes = (extract3 coord_3#0 0u 8u) let tmp%10#0: bytes = (extract3 coord_3#0 8u 8u) goto block@1 @@ -52,8 +52,8 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let encoded_tuple_buffer%17#4: any = (setbit encoded_tuple_buffer%17#3 3u is_true%20#0) let flags#0: any = encoded_tuple_buffer%17#4 let copy%21#0: any = flags#0 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(copy%21#0) - let copy%21#1: bytes = r_tmp%22#0 + let check%22#0: bytes = test_cases.arc4_types.structs.check(copy%21#0) + let copy%21#1: bytes = check%22#0 (log flags#0) let copy%23#0: bytes = coord_1#0 let copy%24#0: any = flags#0 @@ -61,8 +61,8 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let encoded_tuple_buffer%26#0: bytes = 0x let encoded_tuple_buffer%26#1: bytes = (concat encoded_tuple_buffer%26#0 copy%23#0) let encoded_tuple_buffer%26#2: bytes = (concat encoded_tuple_buffer%26#1 copy%24#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) - let encoded_tuple_buffer%26#3: bytes = r_tmp%27#0 + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let encoded_tuple_buffer%26#3: bytes = nested_decode%27#0 return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_1.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_1.ir index 6ac7c97bf8..7bbfa7a746 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_1.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_1.ir @@ -6,7 +6,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let coord_1#0: bytes = (concat encoded_tuple_buffer%1#1 0x000000230384b842) let encoded_tuple_buffer%3#1: bytes = 0x000000083cfbf217 let coord_2#0: bytes = (concat encoded_tuple_buffer%3#1 0x000000230384b842) - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(coord_1#0, coord_2#0) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(coord_1#0, coord_2#0) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -31,11 +31,11 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let encoded_tuple_buffer%17#3: any = (setbit encoded_tuple_buffer%17#2 2u is_true%19#0) let is_true%20#0: uint64 = (getbit tmp%15#0 0u) let flags#0: any = (setbit encoded_tuple_buffer%17#3 3u is_true%20#0) - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) (log flags#0) let encoded_tuple_buffer%26#1: bytes = coord_1#0 let encoded_tuple_buffer%26#2: bytes = (concat encoded_tuple_buffer%26#1 flags#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_2.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_2.ir index d432233aab..eabcf9dad5 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_2.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_2.ir @@ -4,7 +4,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: block@0: // L26 let coord_1#0: bytes = 0x000000083cfbf217000000230384b842 let coord_2#0: bytes = 0x000000083cfbf217000000230384b842 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(coord_1#0, coord_2#0) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(coord_1#0, coord_2#0) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -24,10 +24,10 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let encoded_tuple_buffer%17#3: any = (setbit encoded_tuple_buffer%17#2 2u is_true%19#0) let is_true%20#0: uint64 = 0u let flags#0: any = (setbit encoded_tuple_buffer%17#3 3u is_true%20#0) - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) (log flags#0) let encoded_tuple_buffer%26#2: bytes = (concat coord_1#0 flags#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_3.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_3.ir index e487699045..5ff515d8aa 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_3.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_3.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -19,10 +19,10 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let encoded_tuple_buffer%17#2: any = 0x80 let encoded_tuple_buffer%17#3: any = (setbit encoded_tuple_buffer%17#2 2u 1u) let flags#0: any = (setbit encoded_tuple_buffer%17#3 3u 0u) - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) (log flags#0) let encoded_tuple_buffer%26#2: bytes = (concat 0x000000083cfbf217000000230384b842 flags#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_4.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_4.ir index 734f5e3cd3..901e5c3d50 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_4.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_4.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -18,10 +18,10 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: block@5: // after_for_L30 let encoded_tuple_buffer%17#3: any = 0xa0 let flags#0: any = (setbit encoded_tuple_buffer%17#3 3u 0u) - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) (log flags#0) let encoded_tuple_buffer%26#2: bytes = (concat 0x000000083cfbf217000000230384b842 flags#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_5.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_5.ir index 9ddc639b6b..fcd2aaab5b 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_5.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_5.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -17,10 +17,10 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: goto tuple_index%11#1 ? block@5 : block@2 block@5: // after_for_L30 let flags#0: any = 0xa0 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) (log flags#0) let encoded_tuple_buffer%26#2: bytes = (concat 0x000000083cfbf217000000230384b842 flags#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_6.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_6.ir index 5595a3f717..97398b90f9 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_6.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_6.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -16,10 +16,10 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let tuple_index%11#3: uint64 = (+ tuple_index%11#1 1u) goto tuple_index%11#1 ? block@5 : block@2 block@5: // after_for_L30 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) (log 0xa0) let encoded_tuple_buffer%26#2: bytes = 0x000000083cfbf217000000230384b842a0 - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_7.ir b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_7.ir index 84ca59143e..44842eb2a5 100644 --- a/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_7.ir +++ b/test_cases/arc4_types/out/Arc4StructsTypeContract.ssa.opt_pass_7.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -16,9 +16,9 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let tuple_index%11#3: uint64 = (+ tuple_index%11#1 1u) goto tuple_index%11#1 ? block@5 : block@2 block@5: // after_for_L30 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) (log 0xa0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out/mutable_params.O0.log b/test_cases/arc4_types/out/mutable_params.O0.log index 2dc08bbce0..405cd5bee2 100644 --- a/test_cases/arc4_types/out/mutable_params.O0.log +++ b/test_cases/arc4_types/out/mutable_params.O0.log @@ -69,205 +69,219 @@ PC Teal Stack 138 b== 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 1 139 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973 140 callsub other_routine 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973 -261 proto 2 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973 -264 byte 0x05 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x05 -265 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x05, 0x01020504 -267 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x05, 0x01020504, 1 -268 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504, 1, 0x05 -270 replace3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x01050504 -271 frame_bury -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973 -273 byte "\x00\x07AARRGH!" 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821 -275 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973 -277 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973, 2 -278 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6 -279 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973 -281 int 0 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0 -282 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0, 6 -284 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D -285 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 -287 int 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 -288 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13 -289 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 -291 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19 -292 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 -294 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 19, 0x80320006000D00054861707079000444617973, 13 -296 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 -298 substring3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x000444617973 -299 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D -300 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 -302 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D000741415252474821 -303 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821, 0x000444617973 -304 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821000444617973 -305 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D000741415252474821000444617973, 6 -306 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 0x000741415252474821 -308 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 -309 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 -310 itob 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F -311 substring 6 8 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F -314 replace2 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 -316 frame_bury -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973 -318 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 0x01050504 -320 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 -322 retsub 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973 -143 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504 -144 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 -145 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1, 1 -146 * 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 -147 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1, 0x01050504 -149 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504, 1 -150 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504, 1, 1 -151 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05 -152 byte 0x05 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05, 0x05 -153 b== 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 -154 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504 -155 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 -157 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973, 2 -158 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6 -159 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973 -161 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973, 6 -163 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7 -164 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7, 2 -165 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 9 -166 uncover 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 9, 0x80320006000F000741415252474821000444617973 -168 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 9, 0x80320006000F000741415252474821000444617973, 6 -170 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 6, 9 -172 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x000741415252474821 -173 byte "\x00\x07AARRGH!" 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x000741415252474821, 0x000741415252474821 -175 == 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 -176 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504 -177 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304 -179 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -181 callsub other_routine 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -261 proto 2 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -264 byte 0x05 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x05 -265 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x05, 0x01020304 -267 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x05, 0x01020304, 1 -268 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304, 1, 0x05 -270 replace3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01050304 -271 frame_bury -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973 -273 byte "\x00\x07AARRGH!" 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821 -275 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973 -277 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973, 2 -278 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6 -279 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973 -281 int 0 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0 -282 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0, 6 -284 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D -285 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 -287 int 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 -288 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13 -289 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 -291 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19 -292 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 -294 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 19, 0x80320006000D00054861707079000444617973, 13 -296 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 -298 substring3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x000444617973 -299 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D -300 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 -302 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D000741415252474821 -303 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821, 0x000444617973 -304 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821000444617973 -305 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D000741415252474821000444617973, 6 -306 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 0x000741415252474821 -308 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 -309 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 -310 itob 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F -311 substring 6 8 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F -314 replace2 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 -316 frame_bury -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 -318 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 0x01050304 -320 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 0x01050304, 0x80320006000F000741415252474821000444617973 -322 retsub 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 -184 pop 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304 -185 pop 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504 -186 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 -187 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 1 -188 * 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 -189 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 0x01020304 -191 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 1 -192 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 1, 1 -193 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x02 -194 byte 0x02 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x02, 0x02 -196 b== 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 -197 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504 -198 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973 -200 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 2 -201 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6 -202 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 0x80320006000D00054861707079000444617973 -204 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 0x80320006000D00054861707079000444617973, 6 -206 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 5 -207 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 5, 2 -208 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 7 -209 uncover 4 0x01020304, 0x01050504, 6, 7, 0x80320006000D00054861707079000444617973 -211 uncover 2 0x01020304, 0x01050504, 7, 0x80320006000D00054861707079000444617973, 6 -213 uncover 2 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 6, 7 -215 extract3 0x01020304, 0x01050504, 0x00054861707079 -216 byte "\x00\x05Happy" 0x01020304, 0x01050504, 0x00054861707079, 0x00054861707079 -217 == 0x01020304, 0x01050504, 1 -218 assert 0x01020304, 0x01050504 -219 swap 0x01050504, 0x01020304 -220 callsub other_routine_2 0x01050504, 0x01020304 -323 proto 1 2 0x01050504, 0x01020304 -326 frame_dig -1 0x01050504, 0x01020304, 0x01020304 -328 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A -330 frame_dig -1 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304 -332 int 0 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304, 0 -333 uncover 2 0x01050504, 0x01020304, 0x01020304, 0x01020304, 0, 0x0A -335 replace3 0x01050504, 0x01020304, 0x01020304, 0x0A020304 -336 dup 0x01050504, 0x01020304, 0x01020304, 0x0A020304, 0x0A020304 -337 frame_bury -1 0x01050504, 0x0A020304, 0x01020304, 0x0A020304 -339 retsub 0x01050504, 0x01020304, 0x0A020304 -223 pop 0x01050504, 0x01020304 -224 int 0 0x01050504, 0x01020304, 0 -225 int 1 0x01050504, 0x01020304, 0, 1 -226 * 0x01050504, 0x01020304, 0 -227 dig 1 0x01050504, 0x01020304, 0, 0x01020304 -229 swap 0x01050504, 0x01020304, 0x01020304, 0 -230 int 1 0x01050504, 0x01020304, 0x01020304, 0, 1 -231 extract3 0x01050504, 0x01020304, 0x01 -232 byte 0x01 0x01050504, 0x01020304, 0x01, 0x01 -233 b== 0x01050504, 0x01020304, 1 -234 assert 0x01050504, 0x01020304 -235 callsub other_routine_2 0x01050504, 0x01020304 -323 proto 1 2 0x01050504, 0x01020304 -326 frame_dig -1 0x01050504, 0x01020304, 0x01020304 -328 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A -330 frame_dig -1 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304 -332 int 0 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304, 0 -333 uncover 2 0x01050504, 0x01020304, 0x01020304, 0x01020304, 0, 0x0A -335 replace3 0x01050504, 0x01020304, 0x01020304, 0x0A020304 -336 dup 0x01050504, 0x01020304, 0x01020304, 0x0A020304, 0x0A020304 -337 frame_bury -1 0x01050504, 0x0A020304, 0x01020304, 0x0A020304 -339 retsub 0x01050504, 0x01020304, 0x0A020304 -238 swap 0x01050504, 0x0A020304, 0x01020304 -239 pop 0x01050504, 0x0A020304 -240 int 0 0x01050504, 0x0A020304, 0 -241 int 1 0x01050504, 0x0A020304, 0, 1 -242 * 0x01050504, 0x0A020304, 0 -243 int 1 0x01050504, 0x0A020304, 0, 1 -244 extract3 0x01050504, 0x0A -245 byte 0x0a 0x01050504, 0x0A, 0x0A -247 b== 0x01050504, 1 -248 assert 0x01050504 -249 byte 0x 0x01050504, 0x -250 swap 0x, 0x01050504 -251 concat 0x01050504 -252 int 0 0x01050504, 0 -253 int 4 0x01050504, 0, 4 -254 extract3 0x01050504 -255 callsub other_routine_2 0x01050504 -323 proto 1 2 0x01050504 -326 frame_dig -1 0x01050504, 0x01050504 -328 byte 0x0a 0x01050504, 0x01050504, 0x0A -330 frame_dig -1 0x01050504, 0x01050504, 0x0A, 0x01050504 -332 int 0 0x01050504, 0x01050504, 0x0A, 0x01050504, 0 -333 uncover 2 0x01050504, 0x01050504, 0x01050504, 0, 0x0A -335 replace3 0x01050504, 0x01050504, 0x0A050504 -336 dup 0x01050504, 0x01050504, 0x0A050504, 0x0A050504 -337 frame_bury -1 0x0A050504, 0x01050504, 0x0A050504 -339 retsub 0x01050504, 0x0A050504 -258 pop 0x01050504 -259 pop -260 retsub +277 proto 2 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973 +280 byte 0x05 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x05 +281 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x05, 0x01020504 +283 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x05, 0x01020504, 1 +284 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504, 1, 0x05 +286 replace3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01020504, 0x80320006000D00054861707079000444617973, 0x01050504 +287 frame_bury -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973 +289 byte "\x00\x07AARRGH!" 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821 +291 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973 +293 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973, 2 +294 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6 +295 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973 +297 int 0 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0 +298 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0, 6 +300 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D +301 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 +303 int 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 +304 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13 +305 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 +307 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19 +308 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 +310 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 19, 0x80320006000D00054861707079000444617973, 13 +312 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 +314 substring3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x000444617973 +315 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D +316 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 +318 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D000741415252474821 +319 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821, 0x000444617973 +320 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821000444617973 +321 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D000741415252474821000444617973, 6 +322 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 0x000741415252474821 +324 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 +325 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 +326 itob 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F +327 substring 6 8 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F +330 replace2 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 +332 frame_bury -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973 +334 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 1 +335 int 0 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0 +336 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504 +338 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504, 0x80320006000F000741415252474821000444617973 +340 retsub 0x80320006000D00054861707079000444617973, 0x01020304, 1, 0, 0x01050504, 0x80320006000F000741415252474821000444617973 +143 cover 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504 +145 cover 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0 +147 cover 3 0x80320006000D00054861707079000444617973, 0x01020304, 0, 0x01050504, 0x80320006000F000741415252474821000444617973, 1 +149 cover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0, 1, 0x01050504, 0x80320006000F000741415252474821000444617973 +151 cover 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0, 1, 0x01050504 +153 cover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0, 1 +155 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0 +156 ! 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +157 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504 +158 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +159 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1, 1 +160 * 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +161 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1, 0x01050504 +163 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504, 1 +164 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504, 1, 1 +165 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05 +166 byte 0x05 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05, 0x05 +167 b== 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +168 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504 +169 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 +171 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973, 2 +172 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6 +173 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973 +175 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973, 6 +177 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7 +178 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7, 2 +179 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 9 +180 uncover 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 9, 0x80320006000F000741415252474821000444617973 +182 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 9, 0x80320006000F000741415252474821000444617973, 6 +184 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000F000741415252474821000444617973, 6, 9 +186 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x000741415252474821 +187 byte "\x00\x07AARRGH!" 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x000741415252474821, 0x000741415252474821 +189 == 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 +190 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504 +191 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304 +193 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +195 callsub other_routine 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +277 proto 2 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +280 byte 0x05 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x05 +281 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x05, 0x01020304 +283 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x05, 0x01020304, 1 +284 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304, 1, 0x05 +286 replace3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01050304 +287 frame_bury -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973 +289 byte "\x00\x07AARRGH!" 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821 +291 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973 +293 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D00054861707079000444617973, 2 +294 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6 +295 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973 +297 int 0 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0 +298 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D00054861707079000444617973, 0, 6 +300 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D +301 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 +303 int 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 +304 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13 +305 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 +307 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19 +308 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 +310 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 19, 0x80320006000D00054861707079000444617973, 13 +312 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 +314 substring3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D, 0x000444617973 +315 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D +316 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 +318 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x000444617973, 0x80320006000D000741415252474821 +319 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821, 0x000444617973 +320 concat 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 6, 0x80320006000D000741415252474821000444617973 +321 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x000741415252474821, 0x80320006000D000741415252474821000444617973, 6 +322 uncover 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 0x000741415252474821 +324 len 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 +325 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 +326 itob 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F +327 substring 6 8 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F +330 replace2 4 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 +332 frame_bury -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 +334 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1 +335 int 0 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0 +336 frame_dig -2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050304 +338 frame_dig -1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050304, 0x80320006000F000741415252474821000444617973 +340 retsub 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 0, 0x01050304, 0x80320006000F000741415252474821000444617973 +198 pop 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 0, 0x01050304 +199 pop 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 0 +200 pop 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 +201 pop 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504 +202 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 +203 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 1 +204 * 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 +205 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1, 0x01020304 +207 swap 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 1 +208 int 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x01020304, 1, 1 +209 extract3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x02 +210 byte 0x02 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x02, 0x02 +212 b== 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 1 +213 assert 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504 +214 dig 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973 +216 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 2 +217 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6 +218 dig 3 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 0x80320006000D00054861707079000444617973 +220 dig 1 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 0x80320006000D00054861707079000444617973, 6 +222 extract_uint16 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 5 +223 int 2 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 5, 2 +224 + 0x80320006000D00054861707079000444617973, 0x01020304, 0x01050504, 6, 7 +225 uncover 4 0x01020304, 0x01050504, 6, 7, 0x80320006000D00054861707079000444617973 +227 uncover 2 0x01020304, 0x01050504, 7, 0x80320006000D00054861707079000444617973, 6 +229 uncover 2 0x01020304, 0x01050504, 0x80320006000D00054861707079000444617973, 6, 7 +231 extract3 0x01020304, 0x01050504, 0x00054861707079 +232 byte "\x00\x05Happy" 0x01020304, 0x01050504, 0x00054861707079, 0x00054861707079 +233 == 0x01020304, 0x01050504, 1 +234 assert 0x01020304, 0x01050504 +235 swap 0x01050504, 0x01020304 +236 callsub other_routine_2 0x01050504, 0x01020304 +341 proto 1 2 0x01050504, 0x01020304 +344 frame_dig -1 0x01050504, 0x01020304, 0x01020304 +346 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A +348 frame_dig -1 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304 +350 int 0 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304, 0 +351 uncover 2 0x01050504, 0x01020304, 0x01020304, 0x01020304, 0, 0x0A +353 replace3 0x01050504, 0x01020304, 0x01020304, 0x0A020304 +354 dup 0x01050504, 0x01020304, 0x01020304, 0x0A020304, 0x0A020304 +355 frame_bury -1 0x01050504, 0x0A020304, 0x01020304, 0x0A020304 +357 retsub 0x01050504, 0x01020304, 0x0A020304 +239 pop 0x01050504, 0x01020304 +240 int 0 0x01050504, 0x01020304, 0 +241 int 1 0x01050504, 0x01020304, 0, 1 +242 * 0x01050504, 0x01020304, 0 +243 dig 1 0x01050504, 0x01020304, 0, 0x01020304 +245 swap 0x01050504, 0x01020304, 0x01020304, 0 +246 int 1 0x01050504, 0x01020304, 0x01020304, 0, 1 +247 extract3 0x01050504, 0x01020304, 0x01 +248 byte 0x01 0x01050504, 0x01020304, 0x01, 0x01 +249 b== 0x01050504, 0x01020304, 1 +250 assert 0x01050504, 0x01020304 +251 callsub other_routine_2 0x01050504, 0x01020304 +341 proto 1 2 0x01050504, 0x01020304 +344 frame_dig -1 0x01050504, 0x01020304, 0x01020304 +346 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A +348 frame_dig -1 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304 +350 int 0 0x01050504, 0x01020304, 0x01020304, 0x0A, 0x01020304, 0 +351 uncover 2 0x01050504, 0x01020304, 0x01020304, 0x01020304, 0, 0x0A +353 replace3 0x01050504, 0x01020304, 0x01020304, 0x0A020304 +354 dup 0x01050504, 0x01020304, 0x01020304, 0x0A020304, 0x0A020304 +355 frame_bury -1 0x01050504, 0x0A020304, 0x01020304, 0x0A020304 +357 retsub 0x01050504, 0x01020304, 0x0A020304 +254 swap 0x01050504, 0x0A020304, 0x01020304 +255 pop 0x01050504, 0x0A020304 +256 int 0 0x01050504, 0x0A020304, 0 +257 int 1 0x01050504, 0x0A020304, 0, 1 +258 * 0x01050504, 0x0A020304, 0 +259 int 1 0x01050504, 0x0A020304, 0, 1 +260 extract3 0x01050504, 0x0A +261 byte 0x0a 0x01050504, 0x0A, 0x0A +263 b== 0x01050504, 1 +264 assert 0x01050504 +265 byte 0x 0x01050504, 0x +266 swap 0x, 0x01050504 +267 concat 0x01050504 +268 int 0 0x01050504, 0 +269 int 4 0x01050504, 0, 4 +270 extract3 0x01050504 +271 callsub other_routine_2 0x01050504 +341 proto 1 2 0x01050504 +344 frame_dig -1 0x01050504, 0x01050504 +346 byte 0x0a 0x01050504, 0x01050504, 0x0A +348 frame_dig -1 0x01050504, 0x01050504, 0x0A, 0x01050504 +350 int 0 0x01050504, 0x01050504, 0x0A, 0x01050504, 0 +351 uncover 2 0x01050504, 0x01050504, 0x01050504, 0, 0x0A +353 replace3 0x01050504, 0x01050504, 0x0A050504 +354 dup 0x01050504, 0x01050504, 0x0A050504, 0x0A050504 +355 frame_bury -1 0x0A050504, 0x01050504, 0x0A050504 +357 retsub 0x01050504, 0x0A050504 +274 pop 0x01050504 +275 pop +276 retsub 41 int 1 1 42 return 1 \ No newline at end of file diff --git a/test_cases/arc4_types/out/mutable_params.O1.log b/test_cases/arc4_types/out/mutable_params.O1.log index 36a686e154..d100252a5b 100644 --- a/test_cases/arc4_types/out/mutable_params.O1.log +++ b/test_cases/arc4_types/out/mutable_params.O1.log @@ -1,153 +1,160 @@ PC Teal Stack 1 -4 -45 callsub mutating_copies -51 proto 0 0 -54 byte 0x01020304 0x01020304 -55 byte 0x05 0x01020304, 0x05 -56 replace2 2 0x01020504 -58 dup 0x01020504, 0x01020504 -59 extract 2 1 0x01020504, 0x05 -62 byte 0x05 0x01020504, 0x05, 0x05 -63 b== 0x01020504, 1 -64 assert 0x01020504 -65 byte 0x80320006000d00054861707079000444617973 0x01020504, 0x80320006000D00054861707079000444617973 -66 callsub other_routine 0x01020504, 0x80320006000D00054861707079000444617973 -140 proto 2 2 0x01020504, 0x80320006000D00054861707079000444617973 -143 frame_dig -2 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504 -145 byte 0x05 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504, 0x05 -146 replace2 1 0x01020504, 0x80320006000D00054861707079000444617973, 0x01050504 -148 frame_bury -2 0x01050504, 0x80320006000D00054861707079000444617973 -150 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 -152 int 2 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 -153 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6 -154 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 -156 int 0 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 -158 dig 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 -160 extract3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D -161 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 -163 int 4 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 -165 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 -166 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 -168 len 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 -169 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 -171 cover 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 -173 substring3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 -174 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D -175 byte "\x00\x07AARRGH!" 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 -176 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 -177 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 -178 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 -179 swap 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 -180 int 9 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 -182 + 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 -183 itob 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F -184 substring 6 8 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F -187 replace2 4 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 -189 frame_bury -1 0x01050504, 0x80320006000F000741415252474821000444617973 -191 frame_dig -2 0x01050504, 0x80320006000F000741415252474821000444617973, 0x01050504 -193 frame_dig -1 0x01050504, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 -195 retsub 0x01050504, 0x80320006000F000741415252474821000444617973 -69 swap 0x80320006000F000741415252474821000444617973, 0x01050504 -70 dup 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504 -71 extract 1 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05 -74 byte 0x05 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05, 0x05 -75 b== 0x80320006000F000741415252474821000444617973, 0x01050504, 1 -76 assert 0x80320006000F000741415252474821000444617973, 0x01050504 -77 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 -79 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973, 2 -80 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6 -81 dig 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973 -83 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973, 6 -85 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7 -86 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7, 2 -87 + 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 9 -88 uncover 3 0x01050504, 6, 9, 0x80320006000F000741415252474821000444617973 -90 uncover 2 0x01050504, 9, 0x80320006000F000741415252474821000444617973, 6 -92 uncover 2 0x01050504, 0x80320006000F000741415252474821000444617973, 6, 9 -94 extract3 0x01050504, 0x000741415252474821 -95 byte "\x00\x07AARRGH!" 0x01050504, 0x000741415252474821, 0x000741415252474821 -96 == 0x01050504, 1 -97 assert 0x01050504 -98 byte 0x01020304 0x01050504, 0x01020304 -99 byte 0x80320006000d00054861707079000444617973 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -100 callsub other_routine 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -140 proto 2 2 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -143 frame_dig -2 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304 -145 byte 0x05 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304, 0x05 -146 replace2 1 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01050304 -148 frame_bury -2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973 -150 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 -152 int 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 -153 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6 -154 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 -156 int 0 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 -158 dig 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 -160 extract3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D -161 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 -163 int 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 -165 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 -166 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 -168 len 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 -169 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 -171 cover 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 -173 substring3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 -174 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D -175 byte "\x00\x07AARRGH!" 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 -176 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 -177 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 -178 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 -179 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 -180 int 9 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 -182 + 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 -183 itob 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F -184 substring 6 8 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F -187 replace2 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 -189 frame_bury -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 -191 frame_dig -2 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 0x01050304 -193 frame_dig -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 0x01050304, 0x80320006000F000741415252474821000444617973 -195 retsub 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 -103 pop 0x01050504, 0x01050304 -104 pop 0x01050504 -105 byte 0x01020304 0x01050504, 0x01020304 -106 callsub other_routine_2 0x01050504, 0x01020304 -196 proto 1 2 0x01050504, 0x01020304 -199 frame_dig -1 0x01050504, 0x01020304, 0x01020304 -201 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A -203 replace2 0 0x01050504, 0x01020304, 0x0A020304 -205 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 -207 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 -208 retsub 0x01050504, 0x01020304, 0x0A020304 -109 pop 0x01050504, 0x01020304 -110 dup 0x01050504, 0x01020304, 0x01020304 -111 extract 0 1 0x01050504, 0x01020304, 0x01 -114 byte 0x01 0x01050504, 0x01020304, 0x01, 0x01 -117 b== 0x01050504, 0x01020304, 1 -118 assert 0x01050504, 0x01020304 -119 callsub other_routine_2 0x01050504, 0x01020304 -196 proto 1 2 0x01050504, 0x01020304 -199 frame_dig -1 0x01050504, 0x01020304, 0x01020304 -201 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A -203 replace2 0 0x01050504, 0x01020304, 0x0A020304 -205 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 -207 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 -208 retsub 0x01050504, 0x01020304, 0x0A020304 -122 bury 1 0x01050504, 0x0A020304 -124 extract 0 1 0x01050504, 0x0A -127 byte 0x0a 0x01050504, 0x0A, 0x0A -129 b== 0x01050504, 1 -130 assert 0x01050504 -131 extract 0 4 0x01050504 -134 callsub other_routine_2 0x01050504 -196 proto 1 2 0x01050504 -199 frame_dig -1 0x01050504, 0x01050504 -201 byte 0x0a 0x01050504, 0x01050504, 0x0A -203 replace2 0 0x01050504, 0x0A050504 -205 frame_dig -1 0x01050504, 0x0A050504, 0x01050504 -207 swap 0x01050504, 0x01050504, 0x0A050504 -208 retsub 0x01050504, 0x0A050504 -137 pop 0x01050504 -138 pop -139 retsub -48 int 1 1 -50 return 1 \ No newline at end of file +6 +47 callsub mutating_copies +52 proto 0 0 +55 byte 0x01020304 0x01020304 +56 byte 0x05 0x01020304, 0x05 +57 replace2 2 0x01020504 +59 dup 0x01020504, 0x01020504 +60 extract 2 1 0x01020504, 0x05 +63 byte 0x05 0x01020504, 0x05, 0x05 +64 b== 0x01020504, 1 +65 assert 0x01020504 +66 byte 0x80320006000d00054861707079000444617973 0x01020504, 0x80320006000D00054861707079000444617973 +67 callsub other_routine 0x01020504, 0x80320006000D00054861707079000444617973 +148 proto 2 4 0x01020504, 0x80320006000D00054861707079000444617973 +151 frame_dig -2 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504 +153 byte 0x05 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504, 0x05 +154 replace2 1 0x01020504, 0x80320006000D00054861707079000444617973, 0x01050504 +156 frame_bury -2 0x01050504, 0x80320006000D00054861707079000444617973 +158 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 +160 int 2 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 +161 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6 +162 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 +164 int 0 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 +165 dig 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 +167 extract3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D +168 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 +170 int 4 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 +172 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 +173 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 +175 len 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 +176 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 +178 cover 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 +180 substring3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 +181 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D +182 byte "\x00\x07AARRGH!" 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 +183 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 +184 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 +185 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 +186 swap 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 +187 int 9 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 +189 + 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 +190 itob 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F +191 substring 6 8 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F +194 replace2 4 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 +196 frame_bury -1 0x01050504, 0x80320006000F000741415252474821000444617973 +198 int 1 0x01050504, 0x80320006000F000741415252474821000444617973, 1 +199 int 0 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0 +200 frame_dig -2 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504 +202 frame_dig -1 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504, 0x80320006000F000741415252474821000444617973 +204 retsub 1, 0, 0x01050504, 0x80320006000F000741415252474821000444617973 +70 cover 3 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504 +72 cover 2 0x80320006000F000741415252474821000444617973, 0x01050504, 1, 0 +74 swap 0x80320006000F000741415252474821000444617973, 0x01050504, 0, 1 +75 assert 0x80320006000F000741415252474821000444617973, 0x01050504, 0 +76 ! 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +77 assert 0x80320006000F000741415252474821000444617973, 0x01050504 +78 dup 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504 +79 extract 1 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05 +82 byte 0x05 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05, 0x05 +83 b== 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +84 assert 0x80320006000F000741415252474821000444617973, 0x01050504 +85 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 +87 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973, 2 +88 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6 +89 dig 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973 +91 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973, 6 +93 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7 +94 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7, 2 +95 + 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 9 +96 uncover 3 0x01050504, 6, 9, 0x80320006000F000741415252474821000444617973 +98 uncover 2 0x01050504, 9, 0x80320006000F000741415252474821000444617973, 6 +100 uncover 2 0x01050504, 0x80320006000F000741415252474821000444617973, 6, 9 +102 extract3 0x01050504, 0x000741415252474821 +103 byte "\x00\x07AARRGH!" 0x01050504, 0x000741415252474821, 0x000741415252474821 +104 == 0x01050504, 1 +105 assert 0x01050504 +106 byte 0x01020304 0x01050504, 0x01020304 +107 byte 0x80320006000d00054861707079000444617973 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +108 callsub other_routine 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +148 proto 2 4 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +151 frame_dig -2 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304 +153 byte 0x05 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304, 0x05 +154 replace2 1 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01050304 +156 frame_bury -2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973 +158 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 +160 int 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 +161 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6 +162 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 +164 int 0 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 +165 dig 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 +167 extract3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D +168 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 +170 int 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 +172 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 +173 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 +175 len 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 +176 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 +178 cover 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 +180 substring3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 +181 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D +182 byte "\x00\x07AARRGH!" 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 +183 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 +184 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 +185 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 +186 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 +187 int 9 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 +189 + 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 +190 itob 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F +191 substring 6 8 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F +194 replace2 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 +196 frame_bury -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 +198 int 1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1 +199 int 0 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0 +200 frame_dig -2 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050304 +202 frame_dig -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050304, 0x80320006000F000741415252474821000444617973 +204 retsub 0x01050504, 1, 0, 0x01050304, 0x80320006000F000741415252474821000444617973 +111 popn 4 0x01050504 +113 byte 0x01020304 0x01050504, 0x01020304 +114 callsub other_routine_2 0x01050504, 0x01020304 +205 proto 1 2 0x01050504, 0x01020304 +208 frame_dig -1 0x01050504, 0x01020304, 0x01020304 +210 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A +212 replace2 0 0x01050504, 0x01020304, 0x0A020304 +214 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 +216 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 +217 retsub 0x01050504, 0x01020304, 0x0A020304 +117 pop 0x01050504, 0x01020304 +118 dup 0x01050504, 0x01020304, 0x01020304 +119 extract 0 1 0x01050504, 0x01020304, 0x01 +122 byte 0x01 0x01050504, 0x01020304, 0x01, 0x01 +125 b== 0x01050504, 0x01020304, 1 +126 assert 0x01050504, 0x01020304 +127 callsub other_routine_2 0x01050504, 0x01020304 +205 proto 1 2 0x01050504, 0x01020304 +208 frame_dig -1 0x01050504, 0x01020304, 0x01020304 +210 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A +212 replace2 0 0x01050504, 0x01020304, 0x0A020304 +214 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 +216 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 +217 retsub 0x01050504, 0x01020304, 0x0A020304 +130 bury 1 0x01050504, 0x0A020304 +132 extract 0 1 0x01050504, 0x0A +135 byte 0x0a 0x01050504, 0x0A, 0x0A +137 b== 0x01050504, 1 +138 assert 0x01050504 +139 extract 0 4 0x01050504 +142 callsub other_routine_2 0x01050504 +205 proto 1 2 0x01050504 +208 frame_dig -1 0x01050504, 0x01050504 +210 byte 0x0a 0x01050504, 0x01050504, 0x0A +212 replace2 0 0x01050504, 0x0A050504 +214 frame_dig -1 0x01050504, 0x0A050504, 0x01050504 +216 swap 0x01050504, 0x01050504, 0x0A050504 +217 retsub 0x01050504, 0x0A050504 +145 popn 2 +147 retsub +50 int 1 1 +51 return 1 \ No newline at end of file diff --git a/test_cases/arc4_types/out/mutable_params.O2.log b/test_cases/arc4_types/out/mutable_params.O2.log index a8c5d44756..ea3593f670 100644 --- a/test_cases/arc4_types/out/mutable_params.O2.log +++ b/test_cases/arc4_types/out/mutable_params.O2.log @@ -1,152 +1,159 @@ PC Teal Stack 1 -4 -45 callsub mutating_copies -51 proto 0 0 -54 byte 0x01020304 0x01020304 -55 byte 0x05 0x01020304, 0x05 -56 replace2 2 0x01020504 -58 dup 0x01020504, 0x01020504 -59 extract 2 1 0x01020504, 0x05 -62 byte 0x05 0x01020504, 0x05, 0x05 -63 b== 0x01020504, 1 -64 assert 0x01020504 -65 byte 0x80320006000d00054861707079000444617973 0x01020504, 0x80320006000D00054861707079000444617973 -66 callsub other_routine 0x01020504, 0x80320006000D00054861707079000444617973 -138 proto 2 2 0x01020504, 0x80320006000D00054861707079000444617973 -141 frame_dig -2 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504 -143 byte 0x05 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504, 0x05 -144 replace2 1 0x01020504, 0x80320006000D00054861707079000444617973, 0x01050504 -146 frame_bury -2 0x01050504, 0x80320006000D00054861707079000444617973 -148 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 -150 int 2 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 -151 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6 -152 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 -154 int 0 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 -156 dig 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 -158 extract3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D -159 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 -161 int 4 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 -163 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 -164 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 -166 len 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 -167 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 -169 cover 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 -171 substring3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 -172 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D -173 byte "\x00\x07AARRGH!" 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 -174 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 -175 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 -176 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 -177 swap 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 -178 int 9 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 -180 + 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 -181 itob 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F -182 substring 6 8 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F -185 replace2 4 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 -187 frame_bury -1 0x01050504, 0x80320006000F000741415252474821000444617973 -189 frame_dig -2 0x01050504, 0x80320006000F000741415252474821000444617973, 0x01050504 -191 frame_dig -1 0x01050504, 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 -193 retsub 0x01050504, 0x80320006000F000741415252474821000444617973 -69 swap 0x80320006000F000741415252474821000444617973, 0x01050504 -70 dup 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504 -71 extract 1 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05 -74 byte 0x05 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05, 0x05 -75 b== 0x80320006000F000741415252474821000444617973, 0x01050504, 1 -76 assert 0x80320006000F000741415252474821000444617973, 0x01050504 -77 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 -79 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973, 2 -80 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6 -81 dig 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973 -83 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973, 6 -85 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7 -86 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7, 2 -87 + 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 9 -88 uncover 2 0x80320006000F000741415252474821000444617973, 6, 9, 0x01050504 -90 cover 3 0x01050504, 0x80320006000F000741415252474821000444617973, 6, 9 -92 extract3 0x01050504, 0x000741415252474821 -93 byte "\x00\x07AARRGH!" 0x01050504, 0x000741415252474821, 0x000741415252474821 -94 == 0x01050504, 1 -95 assert 0x01050504 -96 byte 0x01020304 0x01050504, 0x01020304 -97 byte 0x80320006000d00054861707079000444617973 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -98 callsub other_routine 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -138 proto 2 2 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 -141 frame_dig -2 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304 -143 byte 0x05 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304, 0x05 -144 replace2 1 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01050304 -146 frame_bury -2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973 -148 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 -150 int 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 -151 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6 -152 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 -154 int 0 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 -156 dig 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 -158 extract3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D -159 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 -161 int 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 -163 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 -164 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 -166 len 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 -167 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 -169 cover 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 -171 substring3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 -172 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D -173 byte "\x00\x07AARRGH!" 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 -174 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 -175 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 -176 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 -177 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 -178 int 9 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 -180 + 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 -181 itob 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F -182 substring 6 8 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F -185 replace2 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 -187 frame_bury -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 -189 frame_dig -2 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 0x01050304 -191 frame_dig -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 0x01050304, 0x80320006000F000741415252474821000444617973 -193 retsub 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 -101 pop 0x01050504, 0x01050304 -102 pop 0x01050504 -103 byte 0x01020304 0x01050504, 0x01020304 -104 callsub other_routine_2 0x01050504, 0x01020304 -194 proto 1 2 0x01050504, 0x01020304 -197 frame_dig -1 0x01050504, 0x01020304, 0x01020304 -199 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A -201 replace2 0 0x01050504, 0x01020304, 0x0A020304 -203 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 -205 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 -206 retsub 0x01050504, 0x01020304, 0x0A020304 -107 pop 0x01050504, 0x01020304 -108 dup 0x01050504, 0x01020304, 0x01020304 -109 extract 0 1 0x01050504, 0x01020304, 0x01 -112 byte 0x01 0x01050504, 0x01020304, 0x01, 0x01 -115 b== 0x01050504, 0x01020304, 1 -116 assert 0x01050504, 0x01020304 -117 callsub other_routine_2 0x01050504, 0x01020304 -194 proto 1 2 0x01050504, 0x01020304 -197 frame_dig -1 0x01050504, 0x01020304, 0x01020304 -199 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A -201 replace2 0 0x01050504, 0x01020304, 0x0A020304 -203 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 -205 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 -206 retsub 0x01050504, 0x01020304, 0x0A020304 -120 bury 1 0x01050504, 0x0A020304 -122 extract 0 1 0x01050504, 0x0A -125 byte 0x0a 0x01050504, 0x0A, 0x0A -127 b== 0x01050504, 1 -128 assert 0x01050504 -129 extract 0 4 0x01050504 -132 callsub other_routine_2 0x01050504 -194 proto 1 2 0x01050504 -197 frame_dig -1 0x01050504, 0x01050504 -199 byte 0x0a 0x01050504, 0x01050504, 0x0A -201 replace2 0 0x01050504, 0x0A050504 -203 frame_dig -1 0x01050504, 0x0A050504, 0x01050504 -205 swap 0x01050504, 0x01050504, 0x0A050504 -206 retsub 0x01050504, 0x0A050504 -135 pop 0x01050504 -136 pop -137 retsub -48 int 1 1 -50 return 1 \ No newline at end of file +6 +47 callsub mutating_copies +52 proto 0 0 +55 byte 0x01020304 0x01020304 +56 byte 0x05 0x01020304, 0x05 +57 replace2 2 0x01020504 +59 dup 0x01020504, 0x01020504 +60 extract 2 1 0x01020504, 0x05 +63 byte 0x05 0x01020504, 0x05, 0x05 +64 b== 0x01020504, 1 +65 assert 0x01020504 +66 byte 0x80320006000d00054861707079000444617973 0x01020504, 0x80320006000D00054861707079000444617973 +67 callsub other_routine 0x01020504, 0x80320006000D00054861707079000444617973 +146 proto 2 4 0x01020504, 0x80320006000D00054861707079000444617973 +149 frame_dig -2 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504 +151 byte 0x05 0x01020504, 0x80320006000D00054861707079000444617973, 0x01020504, 0x05 +152 replace2 1 0x01020504, 0x80320006000D00054861707079000444617973, 0x01050504 +154 frame_bury -2 0x01050504, 0x80320006000D00054861707079000444617973 +156 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 +158 int 2 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 +159 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6 +160 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 +162 int 0 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 +163 dig 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 +165 extract3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D +166 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 +168 int 4 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 +170 extract_uint16 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 +171 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 +173 len 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 +174 frame_dig -1 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 +176 cover 2 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 +178 substring3 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 +179 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D +180 byte "\x00\x07AARRGH!" 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 +181 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 +182 swap 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 +183 concat 0x01050504, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 +184 swap 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 +185 int 9 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 +187 + 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 +188 itob 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F +189 substring 6 8 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F +192 replace2 4 0x01050504, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 +194 frame_bury -1 0x01050504, 0x80320006000F000741415252474821000444617973 +196 int 1 0x01050504, 0x80320006000F000741415252474821000444617973, 1 +197 int 0 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0 +198 frame_dig -2 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504 +200 frame_dig -1 0x01050504, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504, 0x80320006000F000741415252474821000444617973 +202 retsub 1, 0, 0x01050504, 0x80320006000F000741415252474821000444617973 +70 cover 3 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050504 +72 cover 2 0x80320006000F000741415252474821000444617973, 0x01050504, 1, 0 +74 swap 0x80320006000F000741415252474821000444617973, 0x01050504, 0, 1 +75 assert 0x80320006000F000741415252474821000444617973, 0x01050504, 0 +76 ! 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +77 assert 0x80320006000F000741415252474821000444617973, 0x01050504 +78 dup 0x80320006000F000741415252474821000444617973, 0x01050504, 0x01050504 +79 extract 1 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05 +82 byte 0x05 0x80320006000F000741415252474821000444617973, 0x01050504, 0x05, 0x05 +83 b== 0x80320006000F000741415252474821000444617973, 0x01050504, 1 +84 assert 0x80320006000F000741415252474821000444617973, 0x01050504 +85 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973 +87 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 0x80320006000F000741415252474821000444617973, 2 +88 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6 +89 dig 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973 +91 dig 1 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 0x80320006000F000741415252474821000444617973, 6 +93 extract_uint16 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7 +94 int 2 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 7, 2 +95 + 0x80320006000F000741415252474821000444617973, 0x01050504, 6, 9 +96 uncover 2 0x80320006000F000741415252474821000444617973, 6, 9, 0x01050504 +98 cover 3 0x01050504, 0x80320006000F000741415252474821000444617973, 6, 9 +100 extract3 0x01050504, 0x000741415252474821 +101 byte "\x00\x07AARRGH!" 0x01050504, 0x000741415252474821, 0x000741415252474821 +102 == 0x01050504, 1 +103 assert 0x01050504 +104 byte 0x01020304 0x01050504, 0x01020304 +105 byte 0x80320006000d00054861707079000444617973 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +106 callsub other_routine 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +146 proto 2 4 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973 +149 frame_dig -2 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304 +151 byte 0x05 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01020304, 0x05 +152 replace2 1 0x01050504, 0x01020304, 0x80320006000D00054861707079000444617973, 0x01050304 +154 frame_bury -2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973 +156 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973 +158 int 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D00054861707079000444617973, 2 +159 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6 +160 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973 +162 int 0 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0 +163 dig 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D00054861707079000444617973, 0, 6 +165 extract3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D +166 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973 +168 int 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 4 +170 extract_uint16 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13 +171 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 0x80320006000D00054861707079000444617973 +173 len 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19 +174 frame_dig -1 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 13, 19, 0x80320006000D00054861707079000444617973 +176 cover 2 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x80320006000D00054861707079000444617973, 13, 19 +178 substring3 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D, 0x000444617973 +179 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D +180 byte "\x00\x07AARRGH!" 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D, 0x000741415252474821 +181 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x000444617973, 0x80320006000D000741415252474821 +182 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821, 0x000444617973 +183 concat 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 6, 0x80320006000D000741415252474821000444617973 +184 swap 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6 +185 int 9 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 6, 9 +187 + 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 15 +188 itob 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000000000000000F +189 substring 6 8 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000D000741415252474821000444617973, 0x000F +192 replace2 4 0x01050504, 0x01050304, 0x80320006000D00054861707079000444617973, 0x80320006000F000741415252474821000444617973 +194 frame_bury -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973 +196 int 1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1 +197 int 0 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0 +198 frame_dig -2 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050304 +200 frame_dig -1 0x01050504, 0x01050304, 0x80320006000F000741415252474821000444617973, 1, 0, 0x01050304, 0x80320006000F000741415252474821000444617973 +202 retsub 0x01050504, 1, 0, 0x01050304, 0x80320006000F000741415252474821000444617973 +109 popn 4 0x01050504 +111 byte 0x01020304 0x01050504, 0x01020304 +112 callsub other_routine_2 0x01050504, 0x01020304 +203 proto 1 2 0x01050504, 0x01020304 +206 frame_dig -1 0x01050504, 0x01020304, 0x01020304 +208 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A +210 replace2 0 0x01050504, 0x01020304, 0x0A020304 +212 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 +214 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 +215 retsub 0x01050504, 0x01020304, 0x0A020304 +115 pop 0x01050504, 0x01020304 +116 dup 0x01050504, 0x01020304, 0x01020304 +117 extract 0 1 0x01050504, 0x01020304, 0x01 +120 byte 0x01 0x01050504, 0x01020304, 0x01, 0x01 +123 b== 0x01050504, 0x01020304, 1 +124 assert 0x01050504, 0x01020304 +125 callsub other_routine_2 0x01050504, 0x01020304 +203 proto 1 2 0x01050504, 0x01020304 +206 frame_dig -1 0x01050504, 0x01020304, 0x01020304 +208 byte 0x0a 0x01050504, 0x01020304, 0x01020304, 0x0A +210 replace2 0 0x01050504, 0x01020304, 0x0A020304 +212 frame_dig -1 0x01050504, 0x01020304, 0x0A020304, 0x01020304 +214 swap 0x01050504, 0x01020304, 0x01020304, 0x0A020304 +215 retsub 0x01050504, 0x01020304, 0x0A020304 +128 bury 1 0x01050504, 0x0A020304 +130 extract 0 1 0x01050504, 0x0A +133 byte 0x0a 0x01050504, 0x0A, 0x0A +135 b== 0x01050504, 1 +136 assert 0x01050504 +137 extract 0 4 0x01050504 +140 callsub other_routine_2 0x01050504 +203 proto 1 2 0x01050504 +206 frame_dig -1 0x01050504, 0x01050504 +208 byte 0x0a 0x01050504, 0x01050504, 0x0A +210 replace2 0 0x01050504, 0x0A050504 +212 frame_dig -1 0x01050504, 0x0A050504, 0x01050504 +214 swap 0x01050504, 0x01050504, 0x0A050504 +215 retsub 0x01050504, 0x0A050504 +143 popn 2 +145 retsub +50 int 1 1 +51 return 1 \ No newline at end of file diff --git a/test_cases/arc4_types/out/mutable_params.awst b/test_cases/arc4_types/out/mutable_params.awst index 5b2bc9902b..8909bd472c 100644 --- a/test_cases/arc4_types/out/mutable_params.awst +++ b/test_cases/arc4_types/out/mutable_params.awst @@ -31,7 +31,9 @@ contract Arc4MutableParamsContract my_array[2u]: puyapy.arc4.UIntN[typing.Literal[8]] = 5arc4u8 assert(reinterpret_cast(my_array_copy[2u]) == reinterpret_cast(3arc4u8), comment="my_array_copy should be unchanged") assert(reinterpret_cast(my_array[2u]) == reinterpret_cast(5arc4u8), comment="my_array should be mutated") - this::other_routine(my_array, my_struct) + (t, f): tuple[bool, bool] = this::other_routine(my_array, my_struct) + assert(t) + assert(!(f)) assert(reinterpret_cast(my_array[1u]) == reinterpret_cast(5arc4u8), comment="my_array has been mutated by the subroutine") assert(reinterpret_cast(my_struct[2u]) == reinterpret_cast(arc4_encode('AARRGH!', puyapy.arc4.String)), comment="my_struct has been mutated by the subroutine") this::other_routine(my_array_copy.copy(), my_struct_copy.copy()) @@ -46,10 +48,11 @@ contract Arc4MutableParamsContract this::other_routine_2(nested[0u].copy()) } - subroutine other_routine(array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], struct: test_cases.arc4_types.mutable_params.TestStruct): None + subroutine other_routine(array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]], struct: test_cases.arc4_types.mutable_params.TestStruct): tuple[bool, bool] { array[1u]: puyapy.arc4.UIntN[typing.Literal[8]] = 5arc4u8 struct[2u]: puyapy.arc4.String = arc4_encode('AARRGH!', puyapy.arc4.String) + return (true, false) } subroutine other_routine_2(array: puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]]): puyapy.arc4.StaticArray[puyapy.arc4.UIntN[typing.Literal[8]], typing.Literal[4]] diff --git a/test_cases/arc4_types/out/structs.O1.log b/test_cases/arc4_types/out/structs.O1.log index 04ffb6c6b5..80123ca85b 100644 --- a/test_cases/arc4_types/out/structs.O1.log +++ b/test_cases/arc4_types/out/structs.O1.log @@ -26,8 +26,7 @@ PC Teal Stack 132 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842 134 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 136 retsub 0x, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 -36 pop 0x, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842 -37 pop 0x, 0x0000001079F7E42E0000004607097084 +36 popn 2 0x, 0x0000001079F7E42E0000004607097084 38 dup 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 39 extract 0 8 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E 42 swap 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 diff --git a/test_cases/arc4_types/out/structs.O2.log b/test_cases/arc4_types/out/structs.O2.log index 04ffb6c6b5..80123ca85b 100644 --- a/test_cases/arc4_types/out/structs.O2.log +++ b/test_cases/arc4_types/out/structs.O2.log @@ -26,8 +26,7 @@ PC Teal Stack 132 frame_dig -2 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842 134 frame_dig -1 0x, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 136 retsub 0x, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842, 0x000000083CFBF217000000230384B842 -36 pop 0x, 0x0000001079F7E42E0000004607097084, 0x000000083CFBF217000000230384B842 -37 pop 0x, 0x0000001079F7E42E0000004607097084 +36 popn 2 0x, 0x0000001079F7E42E0000004607097084 38 dup 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E0000004607097084 39 extract 0 8 0x, 0x0000001079F7E42E0000004607097084, 0x0000001079F7E42E 42 swap 0x, 0x0000001079F7E42E, 0x0000001079F7E42E0000004607097084 diff --git a/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.approval.teal b/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.approval.teal index 2750cf5cbb..3915657706 100644 --- a/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.approval.teal +++ b/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.approval.teal @@ -19,7 +19,12 @@ mutating_copies: assert // my_array should be mutated byte 0x80320006000d00054861707079000444617973 callsub other_routine + cover 3 + cover 2 swap + assert + ! + assert dup extract 1 1 byte 0x05 @@ -42,8 +47,7 @@ mutating_copies: byte 0x01020304 byte 0x80320006000d00054861707079000444617973 callsub other_routine - pop - pop + popn 4 byte 0x01020304 callsub other_routine_2 pop @@ -60,14 +64,13 @@ mutating_copies: assert // my_array_copy_2 should have mutated value extract 0 4 callsub other_routine_2 - pop - pop + popn 2 retsub -// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> bytes, bytes: +// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> uint64, uint64, bytes, bytes: other_routine: - proto 2 2 + proto 2 4 frame_dig -2 byte 0x05 replace2 1 @@ -99,6 +102,8 @@ other_routine: substring 6 8 replace2 4 frame_bury -1 + int 1 + int 0 frame_dig -2 frame_dig -1 retsub diff --git a/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.destructured.ir b/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.destructured.ir index 4c001f41ba..f2332c219a 100644 --- a/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.destructured.ir +++ b/test_cases/arc4_types/out_O2/Arc4MutableParamsContract.destructured.ir @@ -11,31 +11,34 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = ((extract 2 1) my_array#1) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (my_array#1: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) - let tmp%23#0: bytes = ((extract 1 1) my_array#1) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#1 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#1 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#1 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) + let (t#0: uint64, f#0: uint64, my_array#1: bytes, my_struct#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#1, 0x80320006000d00054861707079000444617973) + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let tmp%26#0: bytes = ((extract 1 1) my_array#1) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#1 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#1 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#1 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) let (my_array_copy_2#2: bytes, my_array_copy_2#1: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(0x01020304) - let tmp%46#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, my_array_copy_2#2: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) let tmp%51#0: bytes = ((extract 0 1) my_array_copy_2#2) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let tmp%56#0: bytes = ((extract 0 4) my_array#1) - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, my_array_copy_2#2: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#2) + let tmp%56#0: bytes = ((extract 0 1) my_array_copy_2#2) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let tmp%61#0: bytes = ((extract 0 4) my_array#1) + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let array#0: bytes = ((replace2 1) array#0 0x05) let item_offset%3#0: uint64 = (extract_uint16 struct#0 2u) let data_up_to_item%4#0: bytes = (extract3 struct#0 0u item_offset%3#0) @@ -48,14 +51,14 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = (itob tail_cursor%10#0) let updated_header_bytes%11#0: bytes = ((substring 6 8) updated_header_bytes%11#0) let struct#0: bytes = ((replace2 4) updated_data%8#0 updated_header_bytes%11#0) - return array#0 struct#0 + return 1u 0u array#0 struct#0 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let array#1: bytes = ((replace2 0) array#0 0x0a) return array#0 array#1 program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.approval.teal b/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.approval.teal index e8aaf478ae..3d524d183a 100644 --- a/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.approval.teal +++ b/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.approval.teal @@ -5,8 +5,7 @@ test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program: byte 0x000000083cfbf217000000230384b842 byte 0x000000083cfbf217000000230384b842 callsub add - pop - pop + popn 2 dup extract 0 8 swap diff --git a/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.destructured.ir b/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.destructured.ir index 2d4ac31184..db57057262 100644 --- a/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.destructured.ir +++ b/test_cases/arc4_types/out_O2/Arc4StructsTypeContract.destructured.ir @@ -2,7 +2,7 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: program approval: subroutine test_cases.arc4_types.structs.Arc4StructsTypeContract.approval_program() -> uint64: block@0: // L26 - let (coord_3#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) + let (coord_3#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(0x000000083cfbf217000000230384b842, 0x000000083cfbf217000000230384b842) let val#0: bytes = ((extract 0 8) coord_3#0) let val#1: bytes = ((extract 8 8) coord_3#0) let tuple_index%11#0: uint64 = 0u @@ -16,9 +16,9 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let tuple_index%11#3: uint64 = (+ tuple_index%11#0 1u) goto tuple_index%11#0 ? block@5 : block@2 block@5: // after_for_L30 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) (log 0xa0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal index 23f414edca..41e2c7930b 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal +++ b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.approval.teal @@ -140,10 +140,22 @@ mutating_copies: assert // my_array should be mutated // arc4_types/mutable_params.py:51-52 // # Pass to subroutine without a copy - // self.other_routine(my_array, my_struct) + // t, f = self.other_routine(my_array, my_struct) callsub other_routine - swap + cover 3 + cover 3 + cover 3 + cover 2 + cover 3 + cover 2 + // arc4_types/mutable_params.py:53 + // assert t + assert // arc4_types/mutable_params.py:54 + // assert not f + ! + assert + // arc4_types/mutable_params.py:56 // assert my_array[1] == UInt8(5), "my_array has been mutated by the subroutine" int 1 int 1 @@ -155,7 +167,7 @@ mutating_copies: byte 0x05 b== assert // my_array has been mutated by the subroutine - // arc4_types/mutable_params.py:56 + // arc4_types/mutable_params.py:58 // assert my_struct.s_val_1 == String( dig 1 int 2 @@ -169,14 +181,14 @@ mutating_copies: uncover 2 uncover 2 extract3 - // arc4_types/mutable_params.py:56-58 + // arc4_types/mutable_params.py:58-60 // assert my_struct.s_val_1 == String( // "AARRGH!" // ), "my_struct has been mutated by the subroutine" byte "\x00\x07AARRGH!" == assert // my_struct has been mutated by the subroutine - // arc4_types/mutable_params.py:60-61 + // arc4_types/mutable_params.py:62-63 // # Pass to subroutine with copy // self.other_routine(my_array_copy.copy(), my_struct_copy.copy()) dig 1 @@ -184,7 +196,9 @@ mutating_copies: callsub other_routine pop pop - // arc4_types/mutable_params.py:63 + pop + pop + // arc4_types/mutable_params.py:65 // assert my_array_copy[1] == UInt8( int 1 int 1 @@ -193,19 +207,19 @@ mutating_copies: swap int 1 extract3 - // arc4_types/mutable_params.py:64 + // arc4_types/mutable_params.py:66 // 2 byte 0x02 - // arc4_types/mutable_params.py:63-64 + // arc4_types/mutable_params.py:65-66 // assert my_array_copy[1] == UInt8( // 2 b== - // arc4_types/mutable_params.py:63-65 + // arc4_types/mutable_params.py:65-67 // assert my_array_copy[1] == UInt8( // 2 // ), "my_array_copy should not be mutated by the subroutine" assert // my_array_copy should not be mutated by the subroutine - // arc4_types/mutable_params.py:67 + // arc4_types/mutable_params.py:69 // assert my_struct_copy.s_val_1 == String( dig 2 int 2 @@ -219,21 +233,21 @@ mutating_copies: uncover 2 uncover 2 extract3 - // arc4_types/mutable_params.py:67-69 + // arc4_types/mutable_params.py:69-71 // assert my_struct_copy.s_val_1 == String( // "Happy" // ), "my_struct_copy should not be mutated by the subroutine" byte "\x00\x05Happy" == assert // my_struct_copy should not be mutated by the subroutine - // arc4_types/mutable_params.py:71 + // arc4_types/mutable_params.py:73 // my_array_copy_2 = my_array_copy.copy() swap - // arc4_types/mutable_params.py:73 + // arc4_types/mutable_params.py:75 // my_array_copy_2 = self.other_routine_2(my_array_copy_2) callsub other_routine_2 pop - // arc4_types/mutable_params.py:75 + // arc4_types/mutable_params.py:77 // assert my_array_copy_2[0] == UInt8(1), "my_array_copy_2 should have original value" int 0 int 1 @@ -245,12 +259,12 @@ mutating_copies: byte 0x01 b== assert // my_array_copy_2 should have original value - // arc4_types/mutable_params.py:77 + // arc4_types/mutable_params.py:79 // self.other_routine_2(my_array_copy_2) callsub other_routine_2 swap pop - // arc4_types/mutable_params.py:78 + // arc4_types/mutable_params.py:80 // assert my_array_copy_2[0] == UInt8(10), "my_array_copy_2 should have mutated value" int 0 int 1 @@ -260,13 +274,13 @@ mutating_copies: byte 0x0a b== assert // my_array_copy_2 should have mutated value - // arc4_types/mutable_params.py:86-87 + // arc4_types/mutable_params.py:88-89 // # Nested array items should still require a copy // nested = StructWithArray(test_array=my_array.copy()) byte 0x swap concat - // arc4_types/mutable_params.py:88 + // arc4_types/mutable_params.py:90 // self.other_routine_2(nested.test_array.copy()) int 0 int 4 @@ -277,13 +291,13 @@ mutating_copies: retsub -// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> bytes, bytes: +// test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> uint64, uint64, bytes, bytes: other_routine: - // arc4_types/mutable_params.py:90-91 + // arc4_types/mutable_params.py:92-93 // @subroutine - // def other_routine(self, array: TestArray, struct: TestStruct) -> None: - proto 2 2 - // arc4_types/mutable_params.py:92 + // def other_routine(self, array: TestArray, struct: TestStruct) -> tuple[bool, bool]: + proto 2 4 + // arc4_types/mutable_params.py:94 // array[1] = UInt8(5) byte 0x05 frame_dig -2 @@ -291,7 +305,7 @@ other_routine: uncover 2 replace3 frame_bury -2 - // arc4_types/mutable_params.py:93 + // arc4_types/mutable_params.py:95 // struct.s_val_1 = String("AARRGH!") byte "\x00\x07AARRGH!" frame_dig -1 @@ -323,6 +337,10 @@ other_routine: substring 6 8 replace2 4 frame_bury -1 + // arc4_types/mutable_params.py:96 + // return True, False + int 1 + int 0 frame_dig -2 frame_dig -1 retsub @@ -330,14 +348,14 @@ other_routine: // test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> bytes, bytes: other_routine_2: - // arc4_types/mutable_params.py:95-96 + // arc4_types/mutable_params.py:98-99 // @subroutine // def other_routine_2(self, array: TestArray) -> TestArray: proto 1 2 - // arc4_types/mutable_params.py:97 + // arc4_types/mutable_params.py:100 // copy = array.copy() frame_dig -1 - // arc4_types/mutable_params.py:98 + // arc4_types/mutable_params.py:101 // array[0] = UInt8(10) byte 0x0a frame_dig -1 @@ -346,6 +364,6 @@ other_routine_2: replace3 dup frame_bury -1 - // arc4_types/mutable_params.py:99 + // arc4_types/mutable_params.py:102 // return copy retsub diff --git a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.clear.teal b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.clear.teal index 1d4ab23766..1713261473 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.clear.teal +++ b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.clear.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program: - // arc4_types/mutable_params.py:119 + // arc4_types/mutable_params.py:122 // return True int 1 return diff --git a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.destructured.ir b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.destructured.ir index bea07101b2..16e3dd0de3 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.destructured.ir +++ b/test_cases/arc4_types/out_unoptimized/Arc4MutableParamsContract.destructured.ir @@ -44,57 +44,62 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let tmp%18#0: bytes = (extract3 my_array#0 item_index%17#0 1u) let tmp%19#0: uint64 = (b== tmp%18#0 0x05) (assert tmp%19#0) // my_array should be mutated - let (r_tmp%20#0: bytes, r_tmp%21#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) - let my_array#0: bytes = r_tmp%20#0 - let my_struct#0: bytes = r_tmp%21#0 - let item_index%22#0: uint64 = (* 1u 1u) - let tmp%23#0: bytes = (extract3 my_array#0 item_index%22#0 1u) - let tmp%24#0: uint64 = (b== tmp%23#0 0x05) - (assert tmp%24#0) // my_array has been mutated by the subroutine - let item_index%25#0: uint64 = (extract_uint16 my_struct#0 2u) - let item_length%26#0: uint64 = (extract_uint16 my_struct#0 item_index%25#0) - let item_length_plus_2%27#0: uint64 = (+ item_length%26#0 2u) - let tmp%28#0: bytes = (extract3 my_struct#0 item_index%25#0 item_length_plus_2%27#0) - let tmp%29#0: uint64 = (== tmp%28#0 "\x00\x07AARRGH!") - (assert tmp%29#0) // my_struct has been mutated by the subroutine - let copy%30#0: bytes = my_array_copy#0 - let copy%31#0: bytes = my_struct_copy#0 - let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(copy%30#0, copy%31#0) - let item_index%34#0: uint64 = (* 1u 1u) - let tmp%35#0: bytes = (extract3 my_array_copy#0 item_index%34#0 1u) - let tmp%36#0: uint64 = (b== tmp%35#0 0x02) - (assert tmp%36#0) // my_array_copy should not be mutated by the subroutine - let item_index%37#0: uint64 = (extract_uint16 my_struct_copy#0 2u) - let item_length%38#0: uint64 = (extract_uint16 my_struct_copy#0 item_index%37#0) - let item_length_plus_2%39#0: uint64 = (+ item_length%38#0 2u) - let tmp%40#0: bytes = (extract3 my_struct_copy#0 item_index%37#0 item_length_plus_2%39#0) - let tmp%41#0: uint64 = (== tmp%40#0 "\x00\x05Happy") - (assert tmp%41#0) // my_struct_copy should not be mutated by the subroutine - let copy%42#0: bytes = my_array_copy#0 - let my_array_copy_2#0: bytes = copy%42#0 - let (r_tmp%43#0: bytes, r_tmp%44#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#0) - let my_array_copy_2#0: bytes = r_tmp%43#0 - let item_index%45#0: uint64 = (* 0u 1u) - let tmp%46#0: bytes = (extract3 my_array_copy_2#0 item_index%45#0 1u) - let tmp%47#0: uint64 = (b== tmp%46#0 0x01) - (assert tmp%47#0) // my_array_copy_2 should have original value - let (r_tmp%48#0: bytes, r_tmp%49#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#0) - let my_array_copy_2#0: bytes = r_tmp%49#0 + let (other_routine%20#0: uint64, other_routine%21#0: uint64, other_routine%22#0: bytes, other_routine%23#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) + let my_struct#0: bytes = other_routine%23#0 + let my_array#0: bytes = other_routine%22#0 + let t#0: uint64 = other_routine%20#0 + let f#0: uint64 = other_routine%21#0 + (assert t#0) + let tmp%24#0: uint64 = (! f#0) + (assert tmp%24#0) + let item_index%25#0: uint64 = (* 1u 1u) + let tmp%26#0: bytes = (extract3 my_array#0 item_index%25#0 1u) + let tmp%27#0: uint64 = (b== tmp%26#0 0x05) + (assert tmp%27#0) // my_array has been mutated by the subroutine + let item_index%28#0: uint64 = (extract_uint16 my_struct#0 2u) + let item_length%29#0: uint64 = (extract_uint16 my_struct#0 item_index%28#0) + let item_length_plus_2%30#0: uint64 = (+ item_length%29#0 2u) + let tmp%31#0: bytes = (extract3 my_struct#0 item_index%28#0 item_length_plus_2%30#0) + let tmp%32#0: uint64 = (== tmp%31#0 "\x00\x07AARRGH!") + (assert tmp%32#0) // my_struct has been mutated by the subroutine + let copy%33#0: bytes = my_array_copy#0 + let copy%34#0: bytes = my_struct_copy#0 + let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(copy%33#0, copy%34#0) + let item_index%39#0: uint64 = (* 1u 1u) + let tmp%40#0: bytes = (extract3 my_array_copy#0 item_index%39#0 1u) + let tmp%41#0: uint64 = (b== tmp%40#0 0x02) + (assert tmp%41#0) // my_array_copy should not be mutated by the subroutine + let item_index%42#0: uint64 = (extract_uint16 my_struct_copy#0 2u) + let item_length%43#0: uint64 = (extract_uint16 my_struct_copy#0 item_index%42#0) + let item_length_plus_2%44#0: uint64 = (+ item_length%43#0 2u) + let tmp%45#0: bytes = (extract3 my_struct_copy#0 item_index%42#0 item_length_plus_2%44#0) + let tmp%46#0: uint64 = (== tmp%45#0 "\x00\x05Happy") + (assert tmp%46#0) // my_struct_copy should not be mutated by the subroutine + let copy%47#0: bytes = my_array_copy#0 + let my_array_copy_2#0: bytes = copy%47#0 + let (other_routine_2%48#0: bytes, other_routine_2%49#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#0) + let my_array_copy_2#0: bytes = other_routine_2%48#0 let item_index%50#0: uint64 = (* 0u 1u) let tmp%51#0: bytes = (extract3 my_array_copy_2#0 item_index%50#0 1u) - let tmp%52#0: uint64 = (b== tmp%51#0 0x0a) - (assert tmp%52#0) // my_array_copy_2 should have mutated value - let copy%53#0: bytes = my_array#0 - let encoded_tuple_buffer%55#0: bytes = 0x - let encoded_tuple_buffer%55#0: bytes = (concat encoded_tuple_buffer%55#0 copy%53#0) - let nested#0: bytes = encoded_tuple_buffer%55#0 - let tmp%56#0: bytes = (extract3 nested#0 0u 4u) - let copy%57#0: bytes = tmp%56#0 - let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(copy%57#0) + let tmp%52#0: uint64 = (b== tmp%51#0 0x01) + (assert tmp%52#0) // my_array_copy_2 should have original value + let (other_routine_2%53#0: bytes, other_routine_2%54#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(my_array_copy_2#0) + let my_array_copy_2#0: bytes = other_routine_2%54#0 + let item_index%55#0: uint64 = (* 0u 1u) + let tmp%56#0: bytes = (extract3 my_array_copy_2#0 item_index%55#0 1u) + let tmp%57#0: uint64 = (b== tmp%56#0 0x0a) + (assert tmp%57#0) // my_array_copy_2 should have mutated value + let copy%58#0: bytes = my_array#0 + let encoded_tuple_buffer%60#0: bytes = 0x + let encoded_tuple_buffer%60#0: bytes = (concat encoded_tuple_buffer%60#0 copy%58#0) + let nested#0: bytes = encoded_tuple_buffer%60#0 + let tmp%61#0: bytes = (extract3 nested#0 0u 4u) + let copy%62#0: bytes = tmp%61#0 + let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(copy%62#0) return - subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : - block@0: // L90 + subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(array: bytes, struct: bytes) -> : + block@0: // L92 let assigned_value%0#0: bytes = 0x05 let updated_target%1#0: bytes = (replace3 array#0 1u assigned_value%0#0) let array#0: bytes = updated_target%1#0 @@ -112,10 +117,10 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: let updated_header_bytes%11#0: bytes = ((substring 6 8) updated_header_bytes%11#0) let updated_data%8#0: bytes = ((replace2 4) updated_data%8#0 updated_header_bytes%11#0) let struct#0: bytes = updated_data%8#0 - return array#0 struct#0 + return 1u 0u array#0 struct#0 subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(array: bytes) -> : - block@0: // L95 + block@0: // L98 let copy%0#0: bytes = array#0 let copy#0: bytes = copy%0#0 let assigned_value%1#0: bytes = 0x0a @@ -125,5 +130,5 @@ contract test_cases.arc4_types.mutable_params.Arc4MutableParamsContract: program clear-state: subroutine test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.clear_state_program() -> uint64: - block@0: // L118 + block@0: // L121 return 1u \ No newline at end of file diff --git a/test_cases/arc4_types/out_unoptimized/Arc4StructsTypeContract.destructured.ir b/test_cases/arc4_types/out_unoptimized/Arc4StructsTypeContract.destructured.ir index c81e2898b1..b4a58e017f 100644 --- a/test_cases/arc4_types/out_unoptimized/Arc4StructsTypeContract.destructured.ir +++ b/test_cases/arc4_types/out_unoptimized/Arc4StructsTypeContract.destructured.ir @@ -12,8 +12,8 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let coord_2#0: bytes = encoded_tuple_buffer%3#0 let copy%4#0: bytes = coord_1#0 let copy%5#0: bytes = coord_2#0 - let (r_tmp%6#0: bytes, r_tmp%7#0: bytes, r_tmp%8#0: bytes) = test_cases.arc4_types.structs.add(copy%4#0, copy%5#0) - let coord_3#0: bytes = r_tmp%6#0 + let (add%6#0: bytes, add%7#0: bytes, add%8#0: bytes) = test_cases.arc4_types.structs.add(copy%4#0, copy%5#0) + let coord_3#0: bytes = add%6#0 let tmp%9#0: bytes = (extract3 coord_3#0 0u 8u) let tmp%10#0: bytes = (extract3 coord_3#0 8u 8u) goto block@1 @@ -46,14 +46,14 @@ contract test_cases.arc4_types.structs.Arc4StructsTypeContract: let encoded_tuple_buffer%17#0: bytes = (setbit encoded_tuple_buffer%17#0 3u is_true%20#0) let flags#0: any = encoded_tuple_buffer%17#0 let copy%21#0: any = flags#0 - let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(copy%21#0) + let check%22#0: bytes = test_cases.arc4_types.structs.check(copy%21#0) (log flags#0) let copy%23#0: bytes = coord_1#0 let copy%24#0: any = flags#0 let encoded_tuple_buffer%26#0: bytes = 0x let encoded_tuple_buffer%26#0: bytes = (concat encoded_tuple_buffer%26#0 copy%23#0) let encoded_tuple_buffer%26#0: bytes = (concat encoded_tuple_buffer%26#0 copy%24#0) - let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#0) + let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#0) return 1u subroutine test_cases.arc4_types.structs.add(v1: bytes, v2: bytes) -> : diff --git a/test_cases/arc4_types/puya.log b/test_cases/arc4_types/puya.log index 0b543315b9..21c54eb67c 100644 --- a/test_cases/arc4_types/puya.log +++ b/test_cases/arc4_types/puya.log @@ -1,6 +1,7 @@ debug: PuyaOptions(paths=['arc4_types'], output_teal=True, output_arc32=True, output_awst=True, output_ssa_ir=True, output_optimization_ir=True, output_destructured_ir=True, output_memory_ir=True, debug_level=1, optimization_level=1, log_level=, target_avm_version=10, locals_coalescing_strategy=) -arc4_types/mutable_params.py:77:9 warning: expression result is ignored -arc4_types/mutable_params.py:88:9 warning: expression result is ignored +arc4_types/mutable_params.py:62:9 warning: expression result is ignored +arc4_types/mutable_params.py:79:9 warning: expression result is ignored +arc4_types/mutable_params.py:90:9 warning: expression result is ignored arc4_types/bool_eval.py:56:16 warning: expression is always True arc4_types/bool_eval.py:57:16 warning: expression is always True arc4_types/bool_eval.py:59:16 warning: expression is always True @@ -467,14 +468,14 @@ debug: Sealing block@0: // L4 debug: Terminated block@0: // L4 debug: Sealing block@0: // L33 debug: Terminated block@0: // L33 -debug: Sealing block@0: // L90 -debug: Terminated block@0: // L90 -debug: Sealing block@0: // L95 -debug: Terminated block@0: // L95 +debug: Sealing block@0: // L92 +debug: Terminated block@0: // L92 +debug: Sealing block@0: // L98 +debug: Terminated block@0: // L98 debug: Sealing block@0: // L28 debug: Terminated block@0: // L28 -debug: Sealing block@0: // L118 -debug: Terminated block@0: // L118 +debug: Sealing block@0: // L121 +debug: Terminated block@0: // L121 debug: Sealing block@0: // L143 debug: Terminated block@0: // L143 debug: Sealing block@0: // L166 @@ -3326,29 +3327,33 @@ debug: Optimizing subroutine test_cases.arc4_types.mutable_params.Arc4MutablePar debug: Splitting parallel copies prior to optimization debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation -debug: Found equivalence set: array_data%0#4, my_array#0, copy%10#0, my_array_copy#0, copy%30#0, copy%42#0, my_array_copy_2#0 -debug: Replacing {array_data%0#4, copy%10#0, my_array_copy#0, copy%30#0, copy%42#0, my_array_copy_2#0} with my_array#0 made 5 modifications -debug: Found equivalence set: encoded_tuple_buffer%3#6, my_struct#0, copy%11#0, my_struct_copy#0, copy%31#0 -debug: Replacing {encoded_tuple_buffer%3#6, copy%11#0, my_struct_copy#0, copy%31#0} with my_struct#0 made 5 modifications +debug: Found equivalence set: array_data%0#4, my_array#0, copy%10#0, my_array_copy#0, copy%33#0, copy%47#0, my_array_copy_2#0 +debug: Replacing {array_data%0#4, copy%10#0, my_array_copy#0, copy%33#0, copy%47#0, my_array_copy_2#0} with my_array#0 made 5 modifications +debug: Found equivalence set: encoded_tuple_buffer%3#6, my_struct#0, copy%11#0, my_struct_copy#0, copy%34#0 +debug: Replacing {encoded_tuple_buffer%3#6, copy%11#0, my_struct_copy#0, copy%34#0} with my_struct#0 made 5 modifications debug: Found equivalence set: updated_target%13#0, my_array#1 debug: Replacing {updated_target%13#0} with my_array#1 made 1 modifications -debug: Found equivalence set: r_tmp%20#0, my_array#2, copy%53#0 -debug: Replacing {r_tmp%20#0, copy%53#0} with my_array#2 made 2 modifications -debug: Found equivalence set: r_tmp%21#0, my_struct#1 -debug: Replacing {r_tmp%21#0} with my_struct#1 made 1 modifications -debug: Found equivalence set: r_tmp%32#0, copy%30#1 -debug: Found equivalence set: r_tmp%33#0, copy%31#1 -debug: Found equivalence set: r_tmp%44#0, my_array_copy_2#1 -debug: Replacing {r_tmp%44#0} with my_array_copy_2#1 made 1 modifications -debug: Found equivalence set: r_tmp%43#0, my_array_copy_2#2 -debug: Replacing {r_tmp%43#0} with my_array_copy_2#2 made 1 modifications -debug: Found equivalence set: r_tmp%49#0, my_array_copy_2#3 -debug: Replacing {r_tmp%49#0} with my_array_copy_2#3 made 1 modifications -debug: Found equivalence set: encoded_tuple_buffer%55#1, nested#0 -debug: Replacing {encoded_tuple_buffer%55#1} with nested#0 made 1 modifications -debug: Found equivalence set: tmp%56#0, copy%57#0 -debug: Replacing {copy%57#0} with tmp%56#0 made 1 modifications -debug: Found equivalence set: r_tmp%59#0, copy%57#1 +debug: Found equivalence set: other_routine%23#0, my_struct#1 +debug: Replacing {other_routine%23#0} with my_struct#1 made 1 modifications +debug: Found equivalence set: other_routine%22#0, my_array#2, copy%58#0 +debug: Replacing {other_routine%22#0, copy%58#0} with my_array#2 made 2 modifications +debug: Found equivalence set: other_routine%20#0, t#0 +debug: Replacing {other_routine%20#0} with t#0 made 1 modifications +debug: Found equivalence set: other_routine%21#0, f#0 +debug: Replacing {other_routine%21#0} with f#0 made 1 modifications +debug: Found equivalence set: other_routine%38#0, copy%34#1 +debug: Found equivalence set: other_routine%37#0, copy%33#1 +debug: Found equivalence set: other_routine_2%49#0, my_array_copy_2#1 +debug: Replacing {other_routine_2%49#0} with my_array_copy_2#1 made 1 modifications +debug: Found equivalence set: other_routine_2%48#0, my_array_copy_2#2 +debug: Replacing {other_routine_2%48#0} with my_array_copy_2#2 made 1 modifications +debug: Found equivalence set: other_routine_2%54#0, my_array_copy_2#3 +debug: Replacing {other_routine_2%54#0} with my_array_copy_2#3 made 1 modifications +debug: Found equivalence set: encoded_tuple_buffer%60#1, nested#0 +debug: Replacing {encoded_tuple_buffer%60#1} with nested#0 made 1 modifications +debug: Found equivalence set: tmp%61#0, copy%62#0 +debug: Replacing {copy%62#0} with tmp%61#0 made 1 modifications +debug: Found equivalence set: other_routine_2%64#0, copy%62#1 debug: Optimizer: Intrinsic Simplifier debug: Simplified (concat 0x 0x01) to 0x01 debug: Simplified (setbit 0x00 0u 1u) to 0x80 @@ -3372,10 +3377,10 @@ debug: Removing unused variable encoded_tuple_buffer%3#0 debug: Removing unused variable value_as_bytes%4#0 debug: Removing unused variable current_tail_offset%2#2 debug: Removing unused variable assigned_value%12#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) -debug: Removing unused variable current_tail_offset%54#0 -debug: Removing unused variable encoded_tuple_buffer%55#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) +debug: Removing unused variable current_tail_offset%59#0 +debug: Removing unused variable encoded_tuple_buffer%60#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3464,12 +3469,12 @@ debug: Removing unused variable data_length%6#0 debug: Removing unused variable data_length%9#0 debug: Removing unused variable item_index%14#0 debug: Removing unused variable item_index%17#0 -debug: Removing unused variable item_index%22#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) -debug: Removing unused variable item_index%34#0 -debug: Removing unused variable item_index%45#0 +debug: Removing unused variable item_index%25#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) +debug: Removing unused variable item_index%39#0 debug: Removing unused variable item_index%50#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Removing unused variable item_index%55#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3530,8 +3535,8 @@ debug: Removing unused variable array_data%0#2 debug: Removing unused variable encoded_tuple_buffer%3#2 debug: Removing unused variable current_tail_offset%2#1 debug: Removing unused variable value_as_bytes%7#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3589,8 +3594,8 @@ debug: Optimizer: Remove Unused Variables debug: Removing unused variable array_data%0#3 debug: Removing unused variable encoded_tuple_buffer%3#3 debug: Removing unused variable value_as_uint16%8#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(my_array#0, my_struct#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3648,8 +3653,8 @@ debug: Simplified ((extract 1 1) 0x01020304) to 0x02 debug: Optimizer: Remove Unused Variables debug: Removing unused variable my_array#0 debug: Removing unused variable encoded_tuple_buffer%3#4 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3707,9 +3712,9 @@ debug: Simplified (b== 0x02 0x02) to 1u debug: Optimizer: Remove Unused Variables debug: Removing unused variable encoded_tuple_buffer%3#5 debug: Removing unused variable tmp%15#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) -debug: Removing unused variable tmp%35#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, my_struct#0) +debug: Removing unused variable tmp%40#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3765,9 +3770,9 @@ debug: Simplified (extract_uint16 0x80320006000d00054861707079000444617973 2u) t debug: Optimizer: Remove Unused Variables debug: Removing unused variable my_struct#0 debug: Removing unused variable tmp%16#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Removing unused variable tmp%36#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Removing unused variable tmp%41#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3821,9 +3826,9 @@ debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (extract_uint16 0x80320006000d00054861707079000444617973 6u) to 5u debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Removing unused variable item_index%37#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Removing unused variable item_index%42#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3877,9 +3882,9 @@ debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (+ 5u 2u) to 7u debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Removing unused variable item_length%38#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Removing unused variable item_length%43#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3933,9 +3938,9 @@ debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (extract3 0x80320006000d00054861707079000444617973 6u 7u) to 0x00054861707079 debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Removing unused variable item_length_plus_2%39#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Removing unused variable item_length_plus_2%44#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -3989,9 +3994,9 @@ debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Simplified (== 0x00054861707079 "/x00/x05Happy") to 1u debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Removing unused variable tmp%40#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Removing unused variable tmp%45#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -4044,9 +4049,9 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Removing unused variable tmp%41#0 -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Removing unused variable tmp%46#0 +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -4099,8 +4104,8 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%32#0: bytes, r_tmp%33#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) -debug: Not removing unused assignment since source is not marked as pure: let (r_tmp%58#0: bytes, r_tmp%59#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%56#0) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine%35#0: uint64, other_routine%36#0: uint64, other_routine%37#0: bytes, other_routine%38#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine(0x01020304, 0x80320006000d00054861707079000444617973) +debug: Not removing unused assignment since source is not marked as pure: let (other_routine_2%63#0: bytes, other_routine_2%64#0: bytes) = test_cases.arc4_types.mutable_params.Arc4MutableParamsContract.other_routine_2(tmp%61#0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -4171,50 +4176,56 @@ debug: Inserted mutating_copies_block@0.ops[7]: 'store tmp%18#0 to l-stack (copy debug: Replaced mutating_copies_block@0.ops[9]: 'load tmp%18#0' with 'load tmp%18#0 from l-stack (no copy)' debug: Inserted mutating_copies_block@0.ops[12]: 'store tmp%19#0 to l-stack (copy)' debug: Replaced mutating_copies_block@0.ops[14]: 'load tmp%19#0' with 'load tmp%19#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[20]: 'store my_array#1 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[22]: 'load my_array#1' with 'load my_array#1 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[24]: 'store tmp%23#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[26]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[29]: 'store tmp%24#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[31]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[40]: 'store item_length%26#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[42]: 'load item_length%26#0' with 'load item_length%26#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[50]: 'store tmp%28#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[52]: 'load tmp%28#0' with 'load tmp%28#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[55]: 'store tmp%29#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[57]: 'load tmp%29#0' with 'load tmp%29#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[67]: 'store my_array_copy_2#2 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[69]: 'load my_array_copy_2#2' with 'load my_array_copy_2#2 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[71]: 'store tmp%46#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[73]: 'load tmp%46#0' with 'load tmp%46#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[76]: 'store tmp%47#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[78]: 'load tmp%47#0' with 'load tmp%47#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[86]: 'store tmp%51#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[88]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[91]: 'store tmp%52#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[93]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[97]: 'store tmp%56#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[99]: 'load tmp%56#0' with 'load tmp%56#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[36]: 'store item_index%25#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[39]: 'load item_index%25#0' with 'load item_index%25#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[83]: 'store my_array_copy_2#2 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[86]: 'load my_array_copy_2#2' with 'load my_array_copy_2#2 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[46]: 'store item_length_plus_2%27#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[50]: 'load item_length_plus_2%27#0' with 'load item_length_plus_2%27#0 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[34]: 'store my_struct#1 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[39]: 'load my_struct#1' with 'load my_struct#1 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[40]: 'store my_struct#1 to l-stack (copy)' +debug: Inserted mutating_copies_block@0.ops[22]: 'store t#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[24]: 'load t#0' with 'load t#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[28]: 'store tmp%24#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[30]: 'load tmp%24#0' with 'load tmp%24#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[34]: 'store tmp%26#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[36]: 'load tmp%26#0' with 'load tmp%26#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[39]: 'store tmp%27#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[41]: 'load tmp%27#0' with 'load tmp%27#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[50]: 'store item_length%29#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[52]: 'load item_length%29#0' with 'load item_length%29#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[60]: 'store tmp%31#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[62]: 'load tmp%31#0' with 'load tmp%31#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[65]: 'store tmp%32#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[67]: 'load tmp%32#0' with 'load tmp%32#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[79]: 'store my_array_copy_2#2 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[81]: 'load my_array_copy_2#2' with 'load my_array_copy_2#2 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[83]: 'store tmp%51#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[85]: 'load tmp%51#0' with 'load tmp%51#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[88]: 'store tmp%52#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[90]: 'load tmp%52#0' with 'load tmp%52#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[98]: 'store tmp%56#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[100]: 'load tmp%56#0' with 'load tmp%56#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[103]: 'store tmp%57#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[105]: 'load tmp%57#0' with 'load tmp%57#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[109]: 'store tmp%61#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[111]: 'load tmp%61#0' with 'load tmp%61#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[46]: 'store item_index%28#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[49]: 'load item_index%28#0' with 'load item_index%28#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[95]: 'store my_array_copy_2#2 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[98]: 'load my_array_copy_2#2' with 'load my_array_copy_2#2 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[56]: 'store item_length_plus_2%30#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[60]: 'load item_length_plus_2%30#0' with 'load item_length_plus_2%30#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[21]: 'store f#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[27]: 'load f#0' with 'load f#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[45]: 'store my_struct#1 to l-stack (copy)' debug: Replaced mutating_copies_block@0.ops[50]: 'load my_struct#1' with 'load my_struct#1 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[42]: 'store item_index%25#0 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[52]: 'load item_index%25#0' with 'load item_index%25#0 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[51]: 'store my_struct#1 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[61]: 'load my_struct#1' with 'load my_struct#1 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[53]: 'store item_index%28#0 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[63]: 'load item_index%28#0' with 'load item_index%28#0 from l-stack (no copy)' debug: Inserted mutating_copies_block@0.ops[6]: 'store my_array#1 to l-stack (copy)' debug: Replaced mutating_copies_block@0.ops[17]: 'load my_array#1' with 'load my_array#1 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[76]: 'store my_array_copy_2#2 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[87]: 'load my_array_copy_2#2' with 'load my_array_copy_2#2 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[89]: 'store my_array_copy_2#2 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[100]: 'load my_array_copy_2#2' with 'load my_array_copy_2#2 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[21]: 'store my_array#1 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[35]: 'load my_array#1' with 'load my_array#1 from l-stack (no copy)' debug: Inserted mutating_copies_block@0.ops[20]: 'store my_struct#1 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[35]: 'load my_struct#1' with 'load my_struct#1 from l-stack (no copy)' -debug: Inserted mutating_copies_block@0.ops[25]: 'store my_array#1 to l-stack (copy)' -debug: Replaced mutating_copies_block@0.ops[105]: 'load my_array#1' with 'load my_array#1 from l-stack (no copy)' +debug: Replaced mutating_copies_block@0.ops[47]: 'load my_struct#1' with 'load my_struct#1 from l-stack (no copy)' +debug: Inserted mutating_copies_block@0.ops[37]: 'store my_array#1 to l-stack (copy)' +debug: Replaced mutating_copies_block@0.ops[119]: 'load my_array#1' with 'load my_array#1 from l-stack (no copy)' debug: Inserted other_routine_block@0.ops[28]: 'store updated_data%8#0 to l-stack (copy)' debug: Replaced other_routine_block@0.ops[30]: 'load updated_data%8#0' with 'load updated_data%8#0 from l-stack (no copy)' debug: Inserted other_routine_block@0.ops[37]: 'store tail_cursor%10#0 to l-stack (copy)' @@ -11002,18 +11013,18 @@ debug: Found equivalence set: encoded_tuple_buffer%1#2, coord_1#0, copy%4#0, cop debug: Replacing {encoded_tuple_buffer%1#2, copy%4#0, copy%23#0} with coord_1#0 made 3 modifications debug: Found equivalence set: encoded_tuple_buffer%3#2, coord_2#0, copy%5#0 debug: Replacing {encoded_tuple_buffer%3#2, copy%5#0} with coord_2#0 made 2 modifications -debug: Found equivalence set: r_tmp%7#0, copy%4#1 -debug: Found equivalence set: r_tmp%8#0, copy%5#1 -debug: Found equivalence set: r_tmp%6#0, coord_3#0 -debug: Replacing {r_tmp%6#0} with coord_3#0 made 1 modifications +debug: Found equivalence set: add%8#0, copy%5#1 +debug: Found equivalence set: add%7#0, copy%4#1 +debug: Found equivalence set: add%6#0, coord_3#0 +debug: Replacing {add%6#0} with coord_3#0 made 1 modifications debug: Found equivalence set: tmp%9#0, val#0 debug: Replacing {tmp%9#0} with val#0 made 1 modifications debug: Found equivalence set: tmp%10#0, val#1 debug: Replacing {tmp%10#0} with val#1 made 1 modifications debug: Found equivalence set: encoded_tuple_buffer%17#4, flags#0, copy%21#0, copy%24#0 debug: Replacing {encoded_tuple_buffer%17#4, copy%21#0, copy%24#0} with flags#0 made 3 modifications -debug: Found equivalence set: r_tmp%22#0, copy%21#1 -debug: Found equivalence set: r_tmp%27#0, encoded_tuple_buffer%26#3 +debug: Found equivalence set: check%22#0, copy%21#1 +debug: Found equivalence set: nested_decode%27#0, encoded_tuple_buffer%26#3 debug: Optimizer: Intrinsic Simplifier debug: Simplified (concat 0x 0x000000083cfbf217) to 0x000000083cfbf217 debug: Simplified (concat 0x 0x000000083cfbf217) to 0x000000083cfbf217 @@ -11032,10 +11043,10 @@ debug: Removing unused variable current_tail_offset%2#0 debug: Removing unused variable encoded_tuple_buffer%3#0 debug: Removing unused variable current_tail_offset%16#0 debug: Removing unused variable encoded_tuple_buffer%17#0 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) debug: Removing unused variable current_tail_offset%25#0 debug: Removing unused variable encoded_tuple_buffer%26#0 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) debug: Optimizer: Simplify Control Ops debug: simplified terminator of block@4: // for_footer_L30 from goto_nth [block@2][tuple_index%11#1] else goto block@5 to goto tuple_index%11#1 ? block@5 : block@2 debug: Optimizer: Remove Linear Jump @@ -11123,8 +11134,8 @@ debug: Removing unused variable tmp%13#0 debug: Removing unused variable tmp%14#0 debug: Removing unused variable tmp%15#0 debug: Removing unused variable encoded_tuple_buffer%17#1 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -11186,8 +11197,8 @@ debug: Removing unused variable coord_2#0 debug: Removing unused variable is_true%18#0 debug: Removing unused variable is_true%19#0 debug: Removing unused variable is_true%20#0 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -11243,8 +11254,8 @@ debug: Optimizer: Intrinsic Simplifier debug: Simplified (setbit 0x80 2u 1u) to 0xa0 debug: Optimizer: Remove Unused Variables debug: Removing unused variable encoded_tuple_buffer%17#2 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -11300,8 +11311,8 @@ debug: Optimizer: Intrinsic Simplifier debug: Simplified (setbit 0xa0 3u 0u) to 0xa0 debug: Optimizer: Remove Unused Variables debug: Removing unused variable encoded_tuple_buffer%17#3 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(flags#0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -11357,8 +11368,8 @@ debug: Optimizer: Intrinsic Simplifier debug: Simplified (concat 0x000000083cfbf217000000230384b842 0xa0) to 0x000000083cfbf217000000230384b842a0 debug: Optimizer: Remove Unused Variables debug: Removing unused variable flags#0 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(encoded_tuple_buffer%26#2) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -11412,9 +11423,9 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) debug: Removing unused variable encoded_tuple_buffer%26#2 -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -11468,8 +11479,8 @@ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation debug: Optimizer: Intrinsic Simplifier debug: Optimizer: Remove Unused Variables -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) -debug: Not removing unused assignment since source is not marked as pure: let r_tmp%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) +debug: Not removing unused assignment since source is not marked as pure: let check%22#0: bytes = test_cases.arc4_types.structs.check(0xa0) +debug: Not removing unused assignment since source is not marked as pure: let nested_decode%27#0: bytes = test_cases.arc4_types.structs.nested_decode(0x000000083cfbf217000000230384b842a0) debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks