diff --git a/docs/book/spell-check-custom-words.txt b/docs/book/spell-check-custom-words.txt index a45f2308622..eb828999754 100644 --- a/docs/book/spell-check-custom-words.txt +++ b/docs/book/spell-check-custom-words.txt @@ -275,3 +275,9 @@ Preload preloads Preloads VM's +Decodable +Encodable +callee +decodable +encodable +Vec diff --git a/docs/book/src/SUMMARY.md b/docs/book/src/SUMMARY.md index bf368e49b0b..85778afcf70 100644 --- a/docs/book/src/SUMMARY.md +++ b/docs/book/src/SUMMARY.md @@ -51,6 +51,7 @@ - [Generics and Trait Constraints](./advanced/generics_and_trait_constraints.md) - [Assembly](./advanced/assembly.md) - [Never Type](./advanced/never_type.md) + - [Trivial Encoding](./advanced/trivial_encoding.md) - [Common Collections](./common-collections/index.md) - [Vectors on the Heap](./common-collections/vec.md) - [Storage Vectors](./common-collections/storage_vec.md) diff --git a/docs/book/src/advanced/trivial_encoding.md b/docs/book/src/advanced/trivial_encoding.md new file mode 100644 index 00000000000..505be616149 --- /dev/null +++ b/docs/book/src/advanced/trivial_encoding.md @@ -0,0 +1,96 @@ +# Trivially Encodable & Decodable Types + +When a contract calls another contract, all arguments are **encoded** just before the call is actually executed, +and the callee **decodes** these arguments right before the target method starts. +This adds a small but non‑negligible gas cost, from hundreds to thousands of gas depending on the complexity of the arguments. + +The Sway compiler mitigates this overhead for a subset of types that can be **trivially encoded** and/or **trivially decoded** – +that is, types that their *runtime representation*, how the type bytes are laid out inside the VM, is *identical* to their *encoded representation*, +how their bytes are laid out in the encoded buffer. + +For such types the compiler can skip the encoding/decoding process entirely, saving gas and simplifying the generated code. + +> **Trivial encoding** – encoding is replaced with a simple "transmute". +> **Trivial decoding** – encoding is replaced with a simple "transmute". + +The compiler can skip each individually, but the whole gain comes only when both are skipped together. + +## Checking Triviality + +Each struct that should be treated as trivially encodable/decodable can be annotated with the `#[trivial]` attribute: + +```sway +#[trivial(encode = "require", decode = "require")] +pub struct SomeArgument { + a: bool, + b: SomeEnum, +} +``` + +- `encode = "require"` – the compiler will check if the type is trivially encodable; if not, the build fails. +- `decode = "require"` – similarly for decoding. + +Possible values are: + +- required: compiler will check and error if the check fails; +- optional: compiler will only warn non-compliance; +- any: nothing will be checked. + +This attributed can be used directly on types, but also on entry points such as "main" function for scripts and predicates; and contract methods for contracts. + +## Which Types Are Trivial? + +| Type | Trivially Encodable | Trivially Decodable | Notes | +|------|---------------------|---------------------|-------| +| `bool` | ✅ | ❌ | `bool` encodes to a single byte (`0` or `1`), but decoding must validate that the byte is a legal value. | +| `u8`, `u64`, `u256`, `b256` | ✅ | ✅ | | +| `u16`, `u32` | ❌ | ❌ | Their runtime representation is actually a `u64` | +| Structs | ✅ If all their members are trivial | ✅ If all their member are trivial | Recursively evaluated. | +| Enums | ✅ If all variants are trivial | ❌ | Enums have an `u64` discriminant that cannot be trivially decodable. | +| Arrays | ✅ If the item type is trivial | ✅ if the item type is trivial | +| String Arrays | ✅ See * | ✅ See * | | +| Vec, Dictionary, String, etc. | ❌ | ❌ | Data Structures are never trivial | + +Only when the feature "str_array_no_padding" is turned on. When the feature toggle is off, only string arrays that its length is multiple of 8. + +### Why `bool` and `enum` are not trivially decodable + +Probably the most surprising non trivial base data type is `bool`. Mainly because `bool` is obviously trivially encodable. But there is no guarantee +that buffer does not have a value like `2`, that being "transmuted" into a bool would be allow its runtime representation to be `2`, which is **undefined behaviour**. + +The same limitation applies to enums. Enums are implemented as "tagged unions" which means that their runtime representation has a discriminant value as `u64`. There +is no guarantee that the buffer would have a valid value for its discriminant. + +--- + +## 3. Workaround for Non‑trivial Types + +If you need to expose a `bool` or an enum as a public argument, you can either: + +1. **Manual validation** – expose a raw `u64` (or `u8`) and check its value in the callee. + +```sway +#[trivial(encode = "require", decode = "require")] +pub struct Flag(u8); // manually validate that value <= 1 +``` + +1. **Custom wrappers** – Sway ships with `TrivialBool` and `TrivialEnum` that enforce the bounds at compile time. + + ```sway + use sway::primitive::TrivialBool; + use sway::primitive::TrivialEnum; + + #[trivial(encode = "require", decode = "require")] + pub struct SomeArgument { + a: TrivialBool, + b: TrivialEnum, + } + ``` + + These wrappers automatically provide the guard checks and still let the compiler treat them as trivial. + Their usage is very similar to `Option`. + + ```sway + let a: bool = some_argument.a.unwrap(); + let b: SomeEnum = some_argument.b.unwrap(); + ``` diff --git a/sway-ast/src/attribute.rs b/sway-ast/src/attribute.rs index 515d7a43f77..7c26ae939a3 100644 --- a/sway-ast/src/attribute.rs +++ b/sway-ast/src/attribute.rs @@ -65,6 +65,11 @@ pub const ABI_NAME_NAME_ARG_NAME: &str = "name"; pub const EVENT_ATTRIBUTE_NAME: &str = "event"; pub const INDEXED_ATTRIBUTE_NAME: &str = "indexed"; +// Require Attributes +pub const REQUIRE_ATTRIBUTE_NAME: &str = "require"; +pub const REQUIRE_ARG_NAME_TRIVIALLY_ENCODABLE: &str = "trivially_encodable"; +pub const REQUIRE_ARG_NAME_TRIVIALLY_DECODABLE: &str = "trivially_decodable"; + pub const KNOWN_ATTRIBUTE_NAMES: &[&str] = &[ STORAGE_ATTRIBUTE_NAME, DOC_COMMENT_ATTRIBUTE_NAME, @@ -78,6 +83,7 @@ pub const KNOWN_ATTRIBUTE_NAMES: &[&str] = &[ ABI_NAME_ATTRIBUTE_NAME, EVENT_ATTRIBUTE_NAME, INDEXED_ATTRIBUTE_NAME, + REQUIRE_ATTRIBUTE_NAME, ]; /// An attribute declaration. Attribute declaration diff --git a/sway-core/src/ir_generation.rs b/sway-core/src/ir_generation.rs index 3ea644068e1..aedfd27ce96 100644 --- a/sway-core/src/ir_generation.rs +++ b/sway-core/src/ir_generation.rs @@ -11,7 +11,6 @@ use std::{ collections::HashMap, hash::{DefaultHasher, Hasher}, }; - use sway_error::error::CompileError; use sway_features::ExperimentalFeatures; use sway_ir::{ @@ -359,12 +358,16 @@ pub fn compile_program<'a>( .collect(); let mut ctx = Context::new(engines.se(), experimental, backtrace); - ctx.program_kind = match kind { + let k = match kind { ty::TyProgramKind::Script { .. } => Kind::Script, ty::TyProgramKind::Predicate { .. } => Kind::Predicate, ty::TyProgramKind::Contract { .. } => Kind::Contract, ty::TyProgramKind::Library { .. } => Kind::Library, }; + ctx.program_kind = k; + + let module = Module::new(&mut ctx, k); + let mut md_mgr = MetadataManager::default(); let mut compiled_fn_cache = CompiledFunctionCache::default(); let mut panicking_fn_cache = PanickingFunctionCache::default(); @@ -384,6 +387,8 @@ pub fn compile_program<'a>( &mut panicking_fn_cache, &test_fns, &mut compiled_fn_cache, + &mut md_mgr, + module, ), ty::TyProgramKind::Predicate { entry_function, .. } => compile::compile_predicate( engines, @@ -397,6 +402,8 @@ pub fn compile_program<'a>( &mut panicking_fn_cache, &test_fns, &mut compiled_fn_cache, + &mut md_mgr, + module, ), ty::TyProgramKind::Contract { entry_function, @@ -415,6 +422,8 @@ pub fn compile_program<'a>( &test_fns, engines, &mut compiled_fn_cache, + &mut md_mgr, + module, ), ty::TyProgramKind::Library { .. } => compile::compile_library( engines, @@ -427,6 +436,8 @@ pub fn compile_program<'a>( &mut panicking_fn_cache, &test_fns, &mut compiled_fn_cache, + &mut md_mgr, + module, ), }?; diff --git a/sway-core/src/ir_generation/compile.rs b/sway-core/src/ir_generation/compile.rs index 1a2b95e9ae3..e43cda7c7f4 100644 --- a/sway-core/src/ir_generation/compile.rs +++ b/sway-core/src/ir_generation/compile.rs @@ -1,32 +1,42 @@ +use super::{ + const_eval::{compile_const_decl, LookupEnv}, + convert::convert_resolved_type_id, + function::FnCompiler, + CompiledFunctionCache, +}; use crate::{ decl_engine::{DeclEngineGet, DeclId, DeclRefFunction}, - ir_generation::{KeyedTyFunctionDecl, PanickingFunctionCache}, - language::{ty, Visibility}, + ir_generation::{ + const_eval::compile_constant_expression_to_constant, KeyedTyFunctionDecl, + PanickingFunctionCache, + }, + language::{ + ty::{self, TyExpression}, + Visibility, + }, metadata::MetadataManager, namespace::ResolvedDeclaration, semantic_analysis::namespace, type_system::TypeId, types::{LogId, MessageId}, - Engines, PanicOccurrences, PanickingCallOccurrences, + Engines, PanicOccurrences, PanickingCallOccurrences, TypeInfo, }; - -use super::{ - const_eval::{compile_const_decl, LookupEnv}, - convert::convert_resolved_type_id, - function::FnCompiler, - CompiledFunctionCache, +use std::{ + cell::Cell, + collections::{BTreeSet, HashMap}, + sync::Arc, +}; +use sway_error::{ + error::{CompileError, TrivialCheckFailedData}, + handler::Handler, }; - -use sway_error::{error::CompileError, handler::Handler}; use sway_ir::{metadata::combine as md_combine, *}; -use sway_types::{Ident, Span, Spanned}; - -use std::{cell::Cell, collections::HashMap, sync::Arc}; +use sway_types::{integer_bits::IntegerBits, Ident, Named, ProgramId, Span, Spanned}; #[allow(clippy::too_many_arguments)] pub(super) fn compile_script( engines: &Engines, - context: &mut Context, + ctx: &mut Context, entry_function: &DeclId, namespace: &namespace::Namespace, logged_types_map: &HashMap, @@ -36,17 +46,15 @@ pub(super) fn compile_script( panicking_fn_cache: &mut PanickingFunctionCache, test_fns: &[(Arc, DeclRefFunction)], compiled_fn_cache: &mut CompiledFunctionCache, + md_mgr: &mut MetadataManager, + module: Module, ) -> Result> { - let module = Module::new(context, Kind::Script); - - compile_constants_for_package(engines, context, module, namespace)?; - - let mut md_mgr = MetadataManager::default(); + compile_constants_for_package(engines, ctx, module, namespace)?; compile_configurables( engines, - context, - &mut md_mgr, + ctx, + md_mgr, module, namespace.current_package_root_module(), logged_types_map, @@ -59,8 +67,8 @@ pub(super) fn compile_script( .map_err(|err| vec![err])?; compile_entry_function( engines, - context, - &mut md_mgr, + ctx, + md_mgr, module, entry_function, logged_types_map, @@ -73,8 +81,8 @@ pub(super) fn compile_script( )?; compile_tests( engines, - context, - &mut md_mgr, + ctx, + md_mgr, module, logged_types_map, messages_types_map, @@ -101,17 +109,14 @@ pub(super) fn compile_predicate( panicking_fn_cache: &mut PanickingFunctionCache, test_fns: &[(Arc, DeclRefFunction)], compiled_fn_cache: &mut CompiledFunctionCache, + md_mgr: &mut MetadataManager, + module: Module, ) -> Result> { - let module = Module::new(context, Kind::Predicate); - compile_constants_for_package(engines, context, module, namespace)?; - - let mut md_mgr = MetadataManager::default(); - compile_configurables( engines, context, - &mut md_mgr, + md_mgr, module, namespace.current_package_root_module(), logged_types, @@ -125,7 +130,7 @@ pub(super) fn compile_predicate( compile_entry_function( engines, context, - &mut md_mgr, + md_mgr, module, entry_function, &HashMap::new(), @@ -139,7 +144,7 @@ pub(super) fn compile_predicate( compile_tests( engines, context, - &mut md_mgr, + md_mgr, module, logged_types, messages_types, @@ -168,17 +173,14 @@ pub(super) fn compile_contract( test_fns: &[(Arc, DeclRefFunction)], engines: &Engines, compiled_fn_cache: &mut CompiledFunctionCache, + md_mgr: &mut MetadataManager, + module: Module, ) -> Result> { - let module = Module::new(context, Kind::Contract); - compile_constants_for_package(engines, context, module, namespace)?; - - let mut md_mgr = MetadataManager::default(); - compile_configurables( engines, context, - &mut md_mgr, + md_mgr, module, namespace.current_package_root_module(), logged_types_map, @@ -203,7 +205,7 @@ pub(super) fn compile_contract( compile_entry_function( engines, context, - &mut md_mgr, + md_mgr, module, entry_function, logged_types_map, @@ -220,7 +222,7 @@ pub(super) fn compile_contract( for decl in abi_entries { compile_encoding_v0_abi_method( context, - &mut md_mgr, + md_mgr, module, decl, logged_types_map, @@ -240,7 +242,7 @@ pub(super) fn compile_contract( if decl.is_fallback() { compile_encoding_v0_abi_method( context, - &mut md_mgr, + md_mgr, module, &decl_id, logged_types_map, @@ -259,7 +261,7 @@ pub(super) fn compile_contract( compile_tests( engines, context, - &mut md_mgr, + md_mgr, module, logged_types_map, messages_types_map, @@ -276,7 +278,7 @@ pub(super) fn compile_contract( #[allow(clippy::too_many_arguments)] pub(super) fn compile_library( engines: &Engines, - context: &mut Context, + ctx: &mut Context, namespace: &namespace::Namespace, logged_types_map: &HashMap, messages_types_map: &HashMap, @@ -285,17 +287,14 @@ pub(super) fn compile_library( panicking_fn_cache: &mut PanickingFunctionCache, test_fns: &[(Arc, DeclRefFunction)], compiled_fn_cache: &mut CompiledFunctionCache, + md_mgr: &mut MetadataManager, + module: Module, ) -> Result> { - let module = Module::new(context, Kind::Library); - - compile_constants_for_package(engines, context, module, namespace)?; - - let mut md_mgr = MetadataManager::default(); - + compile_constants_for_package(engines, ctx, module, namespace)?; compile_tests( engines, - context, - &mut md_mgr, + ctx, + md_mgr, module, logged_types_map, messages_types_map, @@ -576,6 +575,300 @@ pub(super) fn compile_entry_function( .map(|f| f.expect("entry point should never contain generics")) } +#[derive(Debug, Clone)] +pub enum CheckDecl { + Ref { + tid: TypeId, + is_decode_trivial_table: HashMap, + type_name_span: Span, + }, + Decl { + tid: TypeId, + is_decode_trivial_table: HashMap, + }, +} + +impl CheckDecl { + pub fn is_decode_trivial_table(&self) -> &HashMap { + match self { + CheckDecl::Ref { + is_decode_trivial_table, + .. + } + | CheckDecl::Decl { + is_decode_trivial_table, + .. + } => is_decode_trivial_table, + } + } + + pub fn tid(&self) -> TypeId { + match self { + CheckDecl::Ref { tid, .. } | CheckDecl::Decl { tid, .. } => *tid, + } + } +} + +/// It is Ok for the function to return check errors. Err is reserved for ICE and other unexpected errors. +pub fn run_ir_decl_checks( + engines: &Engines, + context: &mut Context, + md_mgr: &mut MetadataManager, + module: Module, + decls_check: &[CheckDecl], + workspace_pid: Option, +) -> Result, CompileError> { + let mut errors = vec![]; + + // check types + for check in decls_check.iter() { + let is_decode_trivial_table = check + .is_decode_trivial_table() + .iter() + .filter_map(|(key, expr)| { + let expr = compile_constant_expression_to_constant( + engines, context, md_mgr, module, None, None, expr, + ) + .ok()? + .get_content(context) + .as_bool()?; + Some((key.clone(), expr)) + }) + .collect::>(); + + let type_info = engines.te().get(check.tid()); + let fullname = engines.help_out(type_info.as_ref()).to_string(); + + if is_decode_trivial_table.get(&fullname) == Some(&true) { + continue; + } + + let type_decl_span = match type_info.as_ref() { + TypeInfo::Enum(decl_id) => Some(engines.de().get(decl_id).name().span().clone()), + TypeInfo::Struct(decl_id) => Some(engines.de().get(decl_id).name().span().clone()), + _ => None, + }; + + let type_ref_span = match check { + CheckDecl::Ref { type_name_span, .. } => Some(type_name_span.clone()), + _ => None, + }; + + let mut error = TrivialCheckFailedData { + span: type_ref_span + .clone() + .unwrap_or_else(|| type_decl_span.clone().unwrap()), + can_be_made_trivial: None, + infos: vec![], + helps: vec![], + never_trivial: BTreeSet::default(), + bottom_helps: BTreeSet::default(), + }; + + if let (TypeInfo::Enum(_) | TypeInfo::Struct(_), CheckDecl::Ref { type_name_span, .. }) = + (type_info.as_ref(), check) + { + error.infos.push(( + type_name_span.clone(), + format!( + "This is the reason `{}` is being checked", + type_name_span.as_str() + ), + )); + } + + push_help_if_non_trivially_decodable_type( + engines, + workspace_pid, + type_ref_span, + type_decl_span, + type_info.as_ref(), + &is_decode_trivial_table, + &mut error, + )?; + + let errors_count = error.infos.len() + + error.helps.len() + + error.bottom_helps.len() + + error.never_trivial.len(); + if errors_count > 0 { + errors.push(error); + } + } + + Ok(errors) +} + +#[allow(clippy::too_many_arguments)] +fn push_help_if_non_trivially_decodable_type( + engines: &Engines, + workspace_pid: Option, + type_ref_span: Option, + type_decl_span: Option, + type_info: &TypeInfo, + table: &HashMap, + error: &mut TrivialCheckFailedData, +) -> Result<(), CompileError> { + let fullname = engines.help_out(type_info).to_string(); + + match table.get(&fullname) { + Some(true) => return Ok(()), + Some(false) => {} + None => { + return Err(CompileError::Internal( + "Missing type when evaluating encoding triviality", + Span::dummy(), + )) + } + } + + // Check for decls, like an attribute above a struct decl + if let Some(type_decl_span) = type_decl_span { + match &type_info { + TypeInfo::Struct(decl_id) => { + let struct_decl = engines.de().get(decl_id); + error.span = struct_decl.call_path.suffix.span().clone(); + + //Only suggest change if the decl is in the same workspace + let decl_pid = struct_decl.span.source_id().map(|x| x.program_id()); + match (workspace_pid, decl_pid) { + (Some(a), Some(b)) if a == b => { + error.helps.push(( + type_decl_span.clone(), + format!( + "Consider changing `{}` to make it trivially decodable.", + type_decl_span.as_str() + ), + )); + } + _ => {} + } + + for field in struct_decl.fields.iter() { + let field_tid = field.type_argument.type_id; + let field_type_info = engines.te().get(field_tid); + let field_fullname = engines.help_out(field_tid).to_string(); + + match table.get(&field_fullname) { + Some(true) => continue, + Some(false) => {} + None => { + return Err(CompileError::Internal( + "Missing type when evaluating encoding triviality", + Span::dummy(), + )) + } + } + + error.infos.push(( + field.name.span().clone(), + "This field is not trivially decodable.".to_string(), + )); + + push_help_if_non_trivially_decodable_type( + engines, + workspace_pid, + Some(field.type_argument.span.clone()), + None, + field_type_info.as_ref(), + table, + error, + )?; + } + } + TypeInfo::Enum(decl_id) => { + let enum_decl = engines.de().get(decl_id); + error.span = enum_decl.call_path.suffix.span().clone(); + } + _ => {} + } + } + + // Check when a type is just a ref, like a function argument, or a field inside a decl + if let Some(type_ref_span) = type_ref_span { + match &type_info { + TypeInfo::Boolean => { + error.helps.push(( + type_ref_span.clone(), + "Consider changing this type to `TrivialBool`.".to_string(), + )); + error.never_trivial.insert("bool".to_string()); + } + TypeInfo::UnsignedInteger(IntegerBits::Sixteen) => { + error.helps.push(( + type_ref_span.clone(), + "Consider changing this type to `u64`.".to_string(), + )); + error.never_trivial.insert("u16".to_string()); + } + TypeInfo::UnsignedInteger(IntegerBits::ThirtyTwo) => { + error.helps.push(( + type_ref_span.clone(), + "Consider changing this type to `u64`.".to_string(), + )); + error.never_trivial.insert("u32".to_string()); + } + TypeInfo::Enum(_) => { + error.helps.push(( + type_ref_span.clone(), + format!( + "Consider wrapping this type like `TrivialEnum<{}>`.", + type_ref_span.as_str(), + ), + )); + error.bottom_helps.insert("Enums are represented as tagged unions and because of that they cannot be trivially decoded. But where needed, they can be wrapped by `TrivialEnum`, and their original value can be retrieved later with `unwrap`.".to_string()); + } + TypeInfo::Struct(_) => { + // special types + let full_type = engines.help_out(type_info).to_string(); + if full_type.starts_with("std::vec::Vec<") { + let aray_type_name = full_type + .replace("std::vec::Vec<", "[") + .replace(">", "; 64]"); + error.helps.push(( + type_ref_span.clone(), + format!("`Vec` is never trivially decodable. Consider using array instead, e.g.: `{aray_type_name}`.") + )); + } else if full_type.starts_with("std::string::String") { + error.helps.push(( + type_ref_span.clone(), + "`String` is never trivially decodable. Consider using array instead, e.g.: `str[64]`.".to_string() + )); + } + } + TypeInfo::Tuple(items) => { + for item in items { + let type_info = engines.te().get(item.type_id); + push_help_if_non_trivially_decodable_type( + engines, + workspace_pid, + Some(item.span.clone()), + None, + type_info.as_ref(), + table, + error, + )?; + } + } + TypeInfo::Array(item, _) => { + let type_info = engines.te().get(item.type_id); + push_help_if_non_trivially_decodable_type( + engines, + workspace_pid, + Some(item.span.clone()), + None, + type_info.as_ref(), + table, + error, + )?; + } + _ => {} + } + } + + Ok(()) +} + #[allow(clippy::too_many_arguments)] pub(super) fn compile_tests( engines: &Engines, diff --git a/sway-core/src/ir_generation/const_eval.rs b/sway-core/src/ir_generation/const_eval.rs index fe5f5613517..86ee30a77f5 100644 --- a/sway-core/src/ir_generation/const_eval.rs +++ b/sway-core/src/ir_generation/const_eval.rs @@ -567,44 +567,7 @@ fn const_eval_typed_expr( fn_ref, call_path, .. - } => { - let mut actuals_const: Vec<_> = vec![]; - - for arg in arguments { - let (name, sub_expr) = arg; - let eval_expr_opt = const_eval_typed_expr(lookup, known_consts, sub_expr)?; - if let Some(sub_const) = eval_expr_opt { - actuals_const.push((name, sub_const)); - } else { - // If all actual arguments don't evaluate a constant, bail out. - // TODO: Explore if we could continue here and if it'll be useful. - return Err(ConstEvalError::CannotBeEvaluatedToConst { - span: call_path.span(), - }); - } - } - - assert!(actuals_const.len() == arguments.len()); - - for (name, cval) in actuals_const.into_iter() { - known_consts.push(name.clone(), cval); - } - - let function_decl = lookup.engines.de().get_function(fn_ref); - - // save result here to always run the pop below - let res = if function_decl.is_trait_method_dummy { - Err(ConstEvalError::CompileError) - } else { - const_eval_codeblock(lookup, known_consts, &function_decl.body) - }; - - for (name, _) in arguments { - known_consts.pop(name); - } - - res? - } + } => const_eval_fn_application(lookup, known_consts, arguments, fn_ref, &call_path.span())?, ty::TyExpressionVariant::ConstantExpression { decl, .. } => { let call_path = &decl.call_path; let name = &call_path.suffix; @@ -1076,6 +1039,43 @@ fn const_eval_typed_expr( }) } +fn const_eval_fn_application( + lookup: &mut LookupEnv<'_, '_>, + known_consts: &mut MappedStack, + arguments: &Vec<(sway_types::BaseIdent, ty::TyExpression)>, + fn_ref: &crate::decl_engine::DeclRef>, + call_path_span: &Span, +) -> Result, ConstEvalError> { + let mut actuals_const: Vec<_> = vec![]; + for arg in arguments { + let (name, sub_expr) = arg; + let eval_expr_opt = const_eval_typed_expr(lookup, known_consts, sub_expr)?; + if let Some(sub_const) = eval_expr_opt { + actuals_const.push((name, sub_const)); + } else { + // If all actual arguments don't evaluate a constant, bail out. + // TODO: Explore if we could continue here and if it'll be useful. + return Err(ConstEvalError::CannotBeEvaluatedToConst { + span: call_path_span.clone(), + }); + } + } + assert!(actuals_const.len() == arguments.len()); + for (name, cval) in actuals_const.into_iter() { + known_consts.push(name.clone(), cval); + } + let function_decl = lookup.engines.de().get_function(fn_ref); + let res = if function_decl.is_trait_method_dummy { + Err(ConstEvalError::CompileError) + } else { + const_eval_codeblock(lookup, known_consts, &function_decl.body) + }; + for (name, _) in arguments { + known_consts.pop(name); + } + res +} + // the (constant) value of a codeblock is essentially it's last expression if there is one // or if it makes sense as the last expression, e.g. a dangling let-expression in a codeblock // would be an evaluation error diff --git a/sway-core/src/ir_generation/convert.rs b/sway-core/src/ir_generation/convert.rs index f33c454d83a..e90bd74c84e 100644 --- a/sway-core/src/ir_generation/convert.rs +++ b/sway-core/src/ir_generation/convert.rs @@ -97,7 +97,7 @@ pub(super) fn convert_resolved_typeid_no_span( ) } -fn convert_resolved_type_info( +pub(super) fn convert_resolved_type_info( engines: &Engines, context: &mut Context, md_mgr: &mut MetadataManager, diff --git a/sway-core/src/ir_generation/function.rs b/sway-core/src/ir_generation/function.rs index f7658966e6f..dfb80629dd6 100644 --- a/sway-core/src/ir_generation/function.rs +++ b/sway-core/src/ir_generation/function.rs @@ -28,9 +28,13 @@ use crate::{ types::*, PanicOccurrence, PanicOccurrences, PanickingCallOccurrence, PanickingCallOccurrences, }; - use indexmap::IndexMap; use itertools::Itertools; +use std::convert::TryFrom; +use std::{ + collections::HashMap, + hash::{DefaultHasher, Hash as _}, +}; use sway_ast::intrinsics::Intrinsic; use sway_error::error::CompileError; use sway_ir::{Context, *}; @@ -43,12 +47,6 @@ use sway_types::{ Named, }; -use std::convert::TryFrom; -use std::{ - collections::HashMap, - hash::{DefaultHasher, Hash as _}, -}; - /// The result of compiling an expression can be in memory, or in an (SSA) register. #[derive(Debug, Clone, Copy)] enum CompiledValue { @@ -1980,7 +1978,7 @@ impl<'a> FnCompiler<'a> { let gas = return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - &arguments[3] + &arguments[3], )?) .expect_register(); @@ -2006,13 +2004,13 @@ impl<'a> FnCompiler<'a> { let ptr = return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - &arguments[0] + &arguments[0], )?) .expect_register(); let len = return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - &arguments[1] + &arguments[1], )?) .expect_register(); let r = self @@ -2943,6 +2941,21 @@ impl<'a> FnCompiler<'a> { .binary_op(BinaryOpKind::Sub, end, start); // compile the slice together + let slice = self.slices_from_ptr_and_len(context, elem_ir_type, ptr_to_elem, slice_len)?; + + Ok(TerminatorValue::new( + CompiledValue::InRegister(slice), + context, + )) + } + + fn slices_from_ptr_and_len( + &mut self, + context: &mut Context<'_>, + elem_ir_type: Type, + ptr_to_elem: Value, + slice_len: Value, + ) -> Result { let ptr_to_elem_ty = Type::new_typed_pointer(context, elem_ir_type); let return_type = Type::get_typed_slice(context, elem_ir_type); let slice_as_tuple = self.compile_tuple_from_values( @@ -2960,11 +2973,7 @@ impl<'a> FnCompiler<'a> { return_type, Some(Ident::new_no_span("s".into())), ); - - Ok(TerminatorValue::new( - CompiledValue::InRegister(slice), - context, - )) + Ok(slice) } fn compile_return( @@ -3581,7 +3590,7 @@ impl<'a> FnCompiler<'a> { let addr = return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - &call_params.contract_address + &call_params.contract_address, )?) .expect_register(); let gep_val = @@ -3650,7 +3659,7 @@ impl<'a> FnCompiler<'a> { return_on_termination_or_extract!(self.compile_expression_to_memory( context, md_mgr, - asset_id_expr + asset_id_expr, )?) } None => { @@ -3954,7 +3963,7 @@ impl<'a> FnCompiler<'a> { let cond_value = return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - ast_condition + ast_condition, )?) .expect_register(); let cond_block = self.current_block; @@ -4496,7 +4505,7 @@ impl<'a> FnCompiler<'a> { let rhs = return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - &ast_reassignment.rhs + &ast_reassignment.rhs, )?) .expect_register(); @@ -4897,7 +4906,7 @@ impl<'a> FnCompiler<'a> { return_on_termination_or_extract!(self.compile_expression_to_register( context, md_mgr, - &contents[0] + &contents[0], )?) .expect_register(), ), @@ -5056,7 +5065,7 @@ impl<'a> FnCompiler<'a> { let struct_val = return_on_termination_or_extract!(self.compile_expression_to_memory( context, md_mgr, - ast_struct_expr + ast_struct_expr, )?) .expect_memory(); @@ -5742,7 +5751,7 @@ impl MemoryRepresentation { pub fn len_in_bytes(&self) -> u64 { match self { MemoryRepresentation::Padding { len_in_bytes } => *len_in_bytes, - MemoryRepresentation::Blob { len_in_bytes } => *len_in_bytes, + MemoryRepresentation::Blob { len_in_bytes, .. } => *len_in_bytes, MemoryRepresentation::And(items) => items.iter().map(|x| x.len_in_bytes()).sum(), MemoryRepresentation::Or(items) => items .iter() @@ -5880,6 +5889,8 @@ pub fn get_encoding_representation_by_id( get_encoding_representation(engines, &engines.te().get(type_id)) } +// Range is None here because we cannot guarantee a buffer that is going to be decoded +// has the correct bytes pub fn get_encoding_representation( engines: &Engines, type_info: &TypeInfo, diff --git a/sway-core/src/language/ty/declaration/declaration.rs b/sway-core/src/language/ty/declaration/declaration.rs index f12eeb9fd89..a4888f5c405 100644 --- a/sway-core/src/language/ty/declaration/declaration.rs +++ b/sway-core/src/language/ty/declaration/declaration.rs @@ -1,17 +1,17 @@ use crate::{ decl_engine::*, engine_threading::*, - language::{parsed::Declaration, ty::*, Visibility}, + language::{parsed::Declaration, ty::*, CallPath, Visibility}, semantic_analysis::TypeCheckContext, type_system::*, types::*, }; use serde::{Deserialize, Serialize}; use std::{ + collections::HashMap, fmt, hash::{Hash, Hasher}, }; - use sway_error::{ error::CompileError, handler::{ErrorEmitted, Handler}, @@ -522,20 +522,65 @@ impl CollectTypesMetadata for TyDecl { TyDecl::ErrorRecovery(..) | TyDecl::StorageDecl(_) | TyDecl::TraitDecl(_) - | TyDecl::StructDecl(_) | TyDecl::EnumDecl(_) | TyDecl::EnumVariantDecl(_) | TyDecl::ImplSelfOrTrait(_) - | TyDecl::AbiDecl(_) | TyDecl::TypeAliasDecl(_) | TyDecl::TraitTypeDecl(_) | TyDecl::GenericTypeForFunctionScope(_) + | TyDecl::AbiDecl(_) + | TyDecl::StructDecl(_) | TyDecl::ConstGenericDecl(_) => vec![], }; Ok(metadata) } } +pub fn generate_is_decode_trivial_table( + ctx: &mut TypeCheckContext<'_>, + types: impl IntoIterator, +) -> HashMap { + let mut map = HashMap::new(); + + for tid in types { + for tid in tid.extract_inner_types(ctx.engines, IncludeSelf::Yes) { + let fullname = ctx.engines.help_out(tid).to_string(); + let handler = Handler::default(); + let expr = TyExpression::type_check_function_application( + &handler, + ctx.by_ref(), + TypeBinding { + inner: CallPath { + prefixes: vec![ + BaseIdent::new_no_span("std".into()), + BaseIdent::new_no_span("codec".into()), + ], + suffix: BaseIdent::new_no_span("is_decode_trivial".into()), + callpath_type: crate::language::CallPathType::Ambiguous, + }, + type_arguments: TypeArgs::Regular(vec![GenericArgument::Type( + GenericTypeArgument { + type_id: tid, + initial_type_id: tid, + span: Span::dummy(), + call_path_tree: None, + }, + )]), + span: Span::dummy(), + }, + &[], + Span::dummy(), + ); + + if let Ok(expr) = expr { + map.insert(fullname, expr); + } + } + } + + map +} + impl GetDeclIdent for TyDecl { fn get_decl_ident(&self, engines: &Engines) -> Option { match self { diff --git a/sway-core/src/language/ty/program.rs b/sway-core/src/language/ty/program.rs index 3ff2ff7761f..cac57d1d997 100644 --- a/sway-core/src/language/ty/program.rs +++ b/sway-core/src/language/ty/program.rs @@ -1,5 +1,3 @@ -use std::sync::Arc; - use crate::{ decl_engine::*, fuel_prelude::fuel_tx::StorageSlot, @@ -11,7 +9,7 @@ use crate::{ types::*, Engines, }; - +use std::sync::Arc; use sway_error::{ error::{CompileError, TypeNotAllowedReason}, handler::{ErrorEmitted, Handler}, diff --git a/sway-core/src/lib.rs b/sway-core/src/lib.rs index 9a1c701bccc..59bbbb0a120 100644 --- a/sway-core/src/lib.rs +++ b/sway-core/src/lib.rs @@ -26,11 +26,18 @@ pub mod source_map; pub mod transform; pub mod type_system; +use crate::decl_engine::DeclEngineGet as _; +use crate::engine_threading::SpannedWithEngines; use crate::ir_generation::check_function_purity; +use crate::ir_generation::compile::CheckDecl; +use crate::language::ty::{ + generate_is_decode_trivial_table, TyAstNodeContent, TyDecl, TyTraitInterfaceItem, +}; use crate::language::{CallPath, CallPathType}; use crate::query_engine::ModuleCacheEntry; use crate::semantic_analysis::namespace::ResolvedDeclaration; use crate::semantic_analysis::type_resolve::{resolve_call_path, VisibilityCheck}; +use crate::semantic_analysis::TypeCheckContext; use crate::source_map::SourceMap; pub use asm_generation::from_ir::compile_ir_context_to_finalized_asm; use asm_generation::FinalizedAsm; @@ -49,6 +56,7 @@ use std::hash::{Hash, Hasher}; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; +use sway_ast::attribute::REQUIRE_ARG_NAME_TRIVIALLY_DECODABLE; use sway_ast::AttributeDecl; use sway_error::convert_parse_tree_error::ConvertParseTreeError; use sway_error::handler::{ErrorEmitted, Handler}; @@ -61,6 +69,7 @@ use sway_ir::{ INIT_AGGR_LOWERING_NAME, MEM2REG_NAME, MEMCPYOPT_NAME, MEMCPYPROP_REVERSE_NAME, MISC_DEMOTION_NAME, RET_DEMOTION_NAME, SIMPLIFY_CFG_NAME, SROA_NAME, }; +use sway_types::integer_bits::IntegerBits; use sway_types::span::Source; use sway_types::{SourceEngine, SourceLocation, Span}; use sway_utils::{time_expr, PerformanceData, PerformanceMetric}; @@ -881,24 +890,29 @@ pub fn parsed_to_ast( }, )?; - let typecheck_namespace = - Namespace::new(handler, engines, initial_namespace, true).map_err(|error| { - TypeCheckFailed { - root_module: None, - namespace: collection_ctx.namespace().current_package_ref().clone(), - error, - } + let mut typecheck_namespace = Namespace::new(handler, engines, initial_namespace, true) + .map_err(|error| TypeCheckFailed { + root_module: None, + namespace: collection_ctx.namespace().current_package_ref().clone(), + error, })?; + // Type check the program. + let mut type_check_ctx = TypeCheckContext::from_root( + &mut typecheck_namespace, + &mut collection_ctx, + engines, + experimental, + ) + .with_kind(parse_program.kind); + let typed_program_opt = ty::TyProgram::type_check( handler, engines, parse_program, - &mut collection_ctx, - typecheck_namespace, package_name, build_config, - experimental, + &mut type_check_ctx, ); let mut typed_program = typed_program_opt?; @@ -910,6 +924,7 @@ pub fn parsed_to_ast( error, } })?; + // Only clear the parsed AST nodes if we are running a regular compilation pipeline. // LSP needs these to build its token map, and they are cleared by `clear_program` as // part of the LSP garbage collection functionality instead. @@ -931,13 +946,28 @@ pub fn parsed_to_ast( } }; + let mut ctx = Context::new(engines.se(), experimental, backtrace.into()); + let module = Module::new(&mut ctx, Kind::Contract); + let mut md_mgr = MetadataManager::default(); + + // run decl checks + run_decl_checks( + handler, + &typed_program, + &mut type_check_ctx, + &mut ctx, + &mut md_mgr, + module, + ); + // Skip collecting metadata if we triggered an optimised build from LSP. let types_metadata = if !lsp_config.as_ref().is_some_and(|lsp| lsp.optimized_build) { // Collect information about the types used in this program - let types_metadata_result = typed_program.collect_types_metadata( - handler, - &mut CollectTypesMetadataContext::new(engines, experimental, package_name.to_string()), - ); + let mut collect_ctx = + CollectTypesMetadataContext::new(engines, experimental, package_name.to_string()); + + let types_metadata_result = typed_program.collect_types_metadata(handler, &mut collect_ctx); + let types_metadata = match types_metadata_result { Ok(types_metadata) => types_metadata, Err(error) => { @@ -995,8 +1025,7 @@ pub fn parsed_to_ast( }; // Evaluate const declarations, to allow storage slots initialization with consts. - let mut ctx = Context::new(engines.se(), experimental, backtrace.into()); - let module = Module::new(&mut ctx, Kind::Contract); + if let Err(errs) = ir_generation::compile::compile_constants_for_package( engines, &mut ctx, @@ -1015,7 +1044,6 @@ pub fn parsed_to_ast( handler.emit_warn(warn); } - let mut md_mgr = MetadataManager::default(); // Check that all storage initializers can be evaluated at compile time. typed_program .get_typed_program_with_initialized_storage_slots( @@ -1050,6 +1078,195 @@ pub fn parsed_to_ast( Ok(typed_program) } +fn run_decl_checks( + handler: &Handler, + typed_program: &ty::TyProgram, + type_check_ctx: &mut TypeCheckContext<'_>, + ir_ctx: &mut Context<'_>, + md_mgr: &mut MetadataManager, + module: Module, +) { + let mut decl_checks = vec![]; + + let nodes = std::iter::once(&typed_program.root_module) + .chain( + typed_program + .root_module + .submodules_recursive() + .map(|(_, submod)| &*submod.module), + ) + .flat_map(|x| x.all_nodes.iter()); + + // check if the declaration has the attribute + let has_require_att = |atts: &Attributes| -> bool { + let atts = atts.all_by_kind(|att| matches!(att.kind, AttributeKind::Require)); + for (_, atts) in atts { + for att in atts.iter() { + for arg in att.args.iter() { + if arg.name.as_str() == REQUIRE_ARG_NAME_TRIVIALLY_DECODABLE { + return true; + } + } + } + } + false + }; + + let check_type = |ctx: &mut TypeCheckContext<'_>, + is_decl: bool, + tid: TypeId, + type_name_span: Option| + -> Option { + let is_decode_trivial_table = match ctx.engines.te().get(tid).as_ref() { + TypeInfo::Struct(decl_id) => { + let struct_decl = ctx.engines.de().get(decl_id); + + let check = matches!( + (is_decl, has_require_att(&struct_decl.attributes)), + (true, true) | (false, _) + ); + + if check { + let types = struct_decl + .fields + .iter() + .map(|field| field.type_argument.type_id) + .chain([tid]); + Some(generate_is_decode_trivial_table(ctx, types)) + } else { + None + } + } + TypeInfo::Enum(decl_id) => { + let enum_decl = ctx.engines.de().get(decl_id); + + let check = matches!( + (is_decl, has_require_att(&enum_decl.attributes)), + (true, true) | (false, _) + ); + + if check { + let types = enum_decl + .variants + .iter() + .map(|variant| variant.type_argument.type_id) + .chain([tid]); + + Some(generate_is_decode_trivial_table(ctx, types)) + } else { + None + } + } + TypeInfo::UnsignedInteger(IntegerBits::Eight) + | TypeInfo::UnsignedInteger(IntegerBits::SixtyFour) + | TypeInfo::UnsignedInteger(IntegerBits::V256) + | TypeInfo::B256 => None, + TypeInfo::Boolean + | TypeInfo::UnsignedInteger(IntegerBits::Sixteen) + | TypeInfo::UnsignedInteger(IntegerBits::ThirtyTwo) + | TypeInfo::Tuple(..) + | TypeInfo::Array(..) => Some(generate_is_decode_trivial_table(ctx, [tid])), + type_info => { + let type_info = ctx.engines.help_out(type_info); + handler.emit_err(CompileError::InternalOwned( + format!("Unexpected type: {:?}", type_info), + type_name_span.clone().unwrap_or(Span::dummy()), + )); + None + } + }; + + is_decode_trivial_table.map(|is_decode_trivial_table| { + if is_decl { + CheckDecl::Decl { + tid, + is_decode_trivial_table, + } + } else { + CheckDecl::Ref { + tid, + is_decode_trivial_table, + type_name_span: type_name_span.unwrap(), + } + } + }) + }; + + for node in nodes { + match &node.content { + TyAstNodeContent::Declaration(TyDecl::StructDecl(struct_decl)) => { + decl_checks.extend(check_type( + type_check_ctx, + true, + type_check_ctx.engines.te().insert( + type_check_ctx.engines, + TypeInfo::Struct(struct_decl.decl_id), + None, + ), + None, + )); + } + TyAstNodeContent::Declaration(TyDecl::AbiDecl(abi_decl)) => { + let decl = type_check_ctx.engines.de().get(&abi_decl.decl_id); + for item in decl.interface_surface.iter() { + if let TyTraitInterfaceItem::TraitFn(decl_ref) = item { + let decl = type_check_ctx.engines.de().get(decl_ref.id()); + + if has_require_att(&decl.attributes) { + let types = decl + .parameters + .iter() + .map(|parameter| { + ( + parameter.type_argument.type_id, + parameter.type_argument.span.clone(), + ) + }) + .chain([(decl.return_type.type_id, decl.return_type.span.clone())]); + + for (tid, reason_being_checked) in types { + decl_checks.extend(check_type( + type_check_ctx, + false, + tid, + Some(reason_being_checked), + )); + } + } + } + } + } + _ => {} + } + } + + let workspace_pid = typed_program + .declarations + .first() + .and_then(|x| x.span(type_check_ctx.engines).source_id().cloned()) + .map(|x| x.program_id()); + + let errors = ir_generation::compile::run_ir_decl_checks( + type_check_ctx.engines, + ir_ctx, + md_mgr, + module, + &decl_checks, + workspace_pid, + ) + .map(|errors| { + errors + .into_iter() + .map(CompileError::TrivialCheckFailed) + .collect() + }) + .unwrap_or_else(|err| vec![err]); + + for err in errors { + handler.emit_err(err); + } +} + #[allow(clippy::too_many_arguments)] pub fn compile_to_ast( handler: &Handler, diff --git a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs index 6a7ab2ce415..ffc797b4774 100644 --- a/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs +++ b/sway-core/src/semantic_analysis/ast_node/declaration/auto_impl/abi_encoding.rs @@ -1,6 +1,7 @@ use crate::{ asm_generation::fuel::compiler_constants::MISMATCHED_SELECTOR_REVERT_CODE, decl_engine::{DeclEngineGet, DeclId}, + engine_threading::SpannedWithEngines as _, language::{ parsed::FunctionDeclarationKind, ty::{self, TyAstNode, TyDecl, TyEnumDecl, TyFunctionDecl, TyStructDecl}, @@ -336,6 +337,58 @@ where } } + pub(crate) fn generate_tables( + &mut self, + engines: &Engines, + decl: &TyDecl, + ) -> Option { + let handler = Handler::default(); + let Ok(enum_decl_id) = decl.to_enum_id(&handler, engines) else { + return None; + }; + let enum_decl = engines.de().get(&enum_decl_id); + + let mut elems = String::new(); + for i in 0..enum_decl.variants.len() { + let type_str = enum_decl.variants[i].type_argument.span.as_str(); + elems.push_str("is_decode_trivial::<"); + elems.push_str(type_str); + elems.push_str(">()"); + + if i < enum_decl.variants.len() - 1 { + elems.push(','); + } + } + + let type_parameters = &enum_decl.generic_parameters; + + let type_parameters_declaration_expanded = + self.generate_type_parameters_declaration_code(type_parameters, true); + let type_parameters_declaration = + self.generate_type_parameters_declaration_code(type_parameters, false); + let type_parameters_constraints = + self.generate_type_parameters_constraints_code(type_parameters, Some("AbiDecode")); + + let name = enum_decl.name().as_raw_ident_str(); + + let code = format!("impl{type_parameters_declaration_expanded} EnumCodecValues for {name}{type_parameters_declaration}{type_parameters_constraints} {{ + #[allow(dead_code)] + fn is_decode_trivial_table() -> &__slice[bool] {{ + __slice(&[{elems}], 0, {len}) + }} +}}", + len = enum_decl.variants.len(), + ); + + self.parse_impl_trait_to_ty_ast_node( + engines, + decl.span(engines).source_id(), + &code, + crate::build_config::DbgGeneration::None, + ) + .ok() + } + pub(crate) fn generate_contract_entry( &mut self, engines: &Engines, diff --git a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs b/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs index dc3565a0d00..b823000c817 100644 --- a/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs +++ b/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs @@ -750,7 +750,7 @@ impl ty::TyExpression { Ok(exp) } - fn type_check_function_application( + pub(crate) fn type_check_function_application( handler: &Handler, mut ctx: TypeCheckContext, mut call_path_binding: TypeBinding, diff --git a/sway-core/src/semantic_analysis/module.rs b/sway-core/src/semantic_analysis/module.rs index 0fbac32a9e9..2e1c08bd053 100644 --- a/sway-core/src/semantic_analysis/module.rs +++ b/sway-core/src/semantic_analysis/module.rs @@ -595,6 +595,9 @@ impl ty::TyModule { ctx.generate_abi_encode_and_decode_impls(engines, decl); generated.extend(abi_encode_impl); generated.extend(abi_decode_impl); + + let enum_codec_values_impl = ctx.generate_tables(engines, decl); + generated.extend(enum_codec_values_impl); } _ => {} } diff --git a/sway-core/src/semantic_analysis/program.rs b/sway-core/src/semantic_analysis/program.rs index c417500f435..9ce3ab9d444 100644 --- a/sway-core/src/semantic_analysis/program.rs +++ b/sway-core/src/semantic_analysis/program.rs @@ -1,5 +1,6 @@ use std::sync::Arc; +use super::symbol_collection_context::SymbolCollectionContext; use crate::{ language::{ parsed::ParseProgram, @@ -13,14 +14,8 @@ use crate::{ BuildConfig, Engines, }; use sway_error::handler::{ErrorEmitted, Handler}; -use sway_features::ExperimentalFeatures; use sway_ir::{Context, Module}; -use super::{ - symbol_collection_context::SymbolCollectionContext, TypeCheckAnalysis, - TypeCheckAnalysisContext, TypeCheckFinalization, TypeCheckFinalizationContext, -}; - #[derive(Clone, Debug)] pub struct TypeCheckFailed { pub root_module: Option>, @@ -56,16 +51,10 @@ impl TyProgram { handler: &Handler, engines: &Engines, parsed: &ParseProgram, - collection_ctx: &mut SymbolCollectionContext, - mut namespace: namespace::Namespace, package_name: &str, build_config: Option<&BuildConfig>, - experimental: ExperimentalFeatures, + ctx: &mut TypeCheckContext, ) -> Result { - let mut ctx = - TypeCheckContext::from_root(&mut namespace, collection_ctx, engines, experimental) - .with_kind(parsed.kind); - let ParseProgram { root, kind } = parsed; let root = ty::TyModule::type_check( @@ -156,31 +145,3 @@ impl TyProgram { } } } - -impl TypeCheckAnalysis for TyProgram { - fn type_check_analyze( - &self, - handler: &Handler, - ctx: &mut TypeCheckAnalysisContext, - ) -> Result<(), ErrorEmitted> { - for node in self.root_module.all_nodes.iter() { - node.type_check_analyze(handler, ctx)?; - } - Ok(()) - } -} - -impl TypeCheckFinalization for TyProgram { - fn type_check_finalize( - &mut self, - handler: &Handler, - ctx: &mut TypeCheckFinalizationContext, - ) -> Result<(), ErrorEmitted> { - handler.scope(|handler| { - for node in self.root_module.all_nodes.iter_mut() { - let _ = node.type_check_finalize(handler, ctx); - } - Ok(()) - }) - } -} diff --git a/sway-core/src/transform/attribute.rs b/sway-core/src/transform/attribute.rs index fd144d75441..ae3d2d830db 100644 --- a/sway-core/src/transform/attribute.rs +++ b/sway-core/src/transform/attribute.rs @@ -358,6 +358,7 @@ pub enum AttributeKind { AbiName, Event, Indexed, + Require, } /// Denotes if an [ItemTraitItem] belongs to an ABI or to a trait. @@ -392,6 +393,7 @@ impl AttributeKind { ABI_NAME_ATTRIBUTE_NAME => AttributeKind::AbiName, EVENT_ATTRIBUTE_NAME => AttributeKind::Event, INDEXED_ATTRIBUTE_NAME => AttributeKind::Indexed, + REQUIRE_ATTRIBUTE_NAME => AttributeKind::Require, _ => AttributeKind::Unknown, } } @@ -424,6 +426,7 @@ impl AttributeKind { AbiName => false, Event => false, Indexed => false, + Require => false, } } } @@ -469,6 +472,7 @@ impl Attribute { AbiName => Multiplicity::exactly(1), Event => Multiplicity::zero(), Indexed => Multiplicity::zero(), + Require => Multiplicity::at_most(2), } } @@ -528,6 +532,10 @@ impl Attribute { AbiName => MustBeIn(vec![ABI_NAME_NAME_ARG_NAME]), Event => None, Indexed => None, + Require => MustBeIn(vec![ + REQUIRE_ARG_NAME_TRIVIALLY_ENCODABLE, + REQUIRE_ARG_NAME_TRIVIALLY_DECODABLE, + ]), } } @@ -555,6 +563,7 @@ impl Attribute { AbiName => Yes, Event => No, Indexed => No, + Require => Yes, } } @@ -579,6 +588,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -602,6 +612,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -659,6 +670,7 @@ impl Attribute { AbiName => matches!(item_kind, ItemKind::Struct(_) | ItemKind::Enum(_)), Event => matches!(item_kind, ItemKind::Struct(_) | ItemKind::Enum(_)), Indexed => false, + Require => matches!(item_kind, ItemKind::Struct(_) | ItemKind::Enum(_)), } } @@ -688,6 +700,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => matches!(struct_or_enum_field, StructOrEnumField::StructField), + Require => false, } } @@ -729,6 +742,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => parent == TraitItemParent::Abi && matches!(item, ItemTraitItem::Fn(..)), } } @@ -764,6 +778,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -798,6 +813,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -834,6 +850,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -866,6 +883,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -889,6 +907,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -911,6 +930,7 @@ impl Attribute { AbiName => false, Event => false, Indexed => false, + Require => false, } } @@ -972,6 +992,9 @@ impl Attribute { Indexed => vec![ "\"indexed\" attribute can only annotate struct fields.", ], + Require => vec![ + "\"require\" attribute can only annotate structs and enums.", + ], }; if help.is_empty() && target_friendly_name.starts_with("module kind") { diff --git a/sway-core/src/type_system/id.rs b/sway-core/src/type_system/id.rs index 6a17fc1aab6..de6cbd9e75a 100644 --- a/sway-core/src/type_system/id.rs +++ b/sway-core/src/type_system/id.rs @@ -12,7 +12,10 @@ use crate::{ DeclEngineGet, DeclEngineGetParsedDecl, DeclEngineInsert, MaterializeConstGenerics, }, engine_threading::{DebugWithEngines, DisplayWithEngines, Engines, WithEngines}, - language::{ty::TyStructDecl, CallPath}, + language::{ + ty::{StructDecl, TyDecl, TyStructDecl}, + CallPath, + }, namespace::TraitMap, semantic_analysis::TypeCheckContext, type_system::priv_prelude::*, @@ -64,13 +67,13 @@ impl From for TypeId { impl CollectTypesMetadata for TypeId { fn collect_types_metadata( &self, - _handler: &Handler, + handler: &Handler, ctx: &mut CollectTypesMetadataContext, ) -> Result, ErrorEmitted> { fn filter_fn(type_info: &TypeInfo) -> bool { matches!( type_info, - TypeInfo::UnknownGeneric { .. } | TypeInfo::Placeholder(_) + TypeInfo::UnknownGeneric { .. } | TypeInfo::Placeholder(_) | TypeInfo::Struct(_) ) } let engines = ctx.engines; @@ -90,6 +93,11 @@ impl CollectTypesMetadata for TypeId { ctx.call_site_get(self), )); } + TypeInfo::Struct(decl) => { + let mut types = TyDecl::StructDecl(StructDecl { decl_id: *decl }) + .collect_types_metadata(handler, ctx)?; + res.append(&mut types); + } _ => {} } } diff --git a/sway-core/src/type_system/info.rs b/sway-core/src/type_system/info.rs index 32e2683b799..54563d92010 100644 --- a/sway-core/src/type_system/info.rs +++ b/sway-core/src/type_system/info.rs @@ -1232,6 +1232,10 @@ impl TypeInfo { matches!(self, TypeInfo::Struct(_)) } + pub fn is_enum(&self) -> bool { + matches!(self, TypeInfo::Enum(_)) + } + pub fn is_tuple(&self) -> bool { matches!(self, TypeInfo::Tuple(_)) } diff --git a/sway-core/src/type_system/monomorphization.rs b/sway-core/src/type_system/monomorphization.rs index 70871ea15ba..80327e179bb 100644 --- a/sway-core/src/type_system/monomorphization.rs +++ b/sway-core/src/type_system/monomorphization.rs @@ -276,12 +276,8 @@ where subst_ctx, )?; - value.subst(&SubstTypesContext::new( - handler, - engines, - &type_mapping, - true, - )); + let ctx = SubstTypesContext::new(handler, engines, &type_mapping, true); + let _ = value.subst(&ctx); for (name, expr) in const_generics.iter() { let _ = value.materialize_const_generics(engines, handler, name, expr); diff --git a/sway-error/src/error.rs b/sway-error/src/error.rs index 8763ee9d6f1..82a4acf07f8 100644 --- a/sway-error/src/error.rs +++ b/sway-error/src/error.rs @@ -9,6 +9,7 @@ use crate::parser_error::{ParseError, ParseErrorKind}; use crate::type_error::TypeError; use core::fmt; +use std::collections::BTreeSet; use std::fmt::Formatter; use sway_types::style::to_snake_case; use sway_types::{BaseIdent, Ident, IdentUnique, SourceEngine, Span, Spanned}; @@ -501,6 +502,8 @@ pub enum CompileError { }, #[error("This opcode takes an immediate value but none was provided.")] MissingImmediate { span: Span }, + #[error("Invalid argument.")] + InvalidArgument { span: Span }, #[error("This immediate value is invalid.")] InvalidImmediateValue { span: Span }, #[error("Variant \"{variant_name}\" does not exist on enum \"{enum_name}\"")] @@ -1141,6 +1144,18 @@ pub enum CompileError { IndexedFieldIsNotFixedSizeABIType { field_name: IdentUnique }, #[error("Too many indexed fields on event for current metadata format.")] IndexedFieldOffsetTooLarge { field_name: IdentUnique }, + #[error("Trivial Check Failed")] + TrivialCheckFailed(TrivialCheckFailedData), +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct TrivialCheckFailedData { + pub span: Span, + pub can_be_made_trivial: Option, + pub infos: Vec<(Span, String)>, + pub helps: Vec<(Span, String)>, + pub never_trivial: BTreeSet, + pub bottom_helps: BTreeSet, } impl std::convert::From for CompileError { @@ -1382,6 +1397,8 @@ impl Spanned for CompileError { IndexedFieldIsNotFixedSizeABIType { field_name } => field_name.span(), IndexedFieldOffsetTooLarge { field_name } => field_name.span(), IncoherentImplDueToOrphanRule { span, .. } => span.clone(), + TrivialCheckFailed(TrivialCheckFailedData { span, .. }) => span.clone(), + InvalidArgument { span } => span.clone(), } } } @@ -3387,6 +3404,70 @@ impl ToDiagnostic for CompileError { hints: vec![], help: vec![], }, + TrivialCheckFailed(TrivialCheckFailedData { span, can_be_made_trivial, infos, helps, never_trivial, bottom_helps }) => { + let mut hints = vec![]; + hints.extend( + infos.iter() + .map(|x| { + Hint::info(source_engine, x.0.clone(), x.1.clone()) + }) + ); + hints.extend( + helps.iter() + .map(|x| { + Hint::help(source_engine, x.0.clone(), x.1.clone()) + }) + ); + + let mut bottom_helps: Vec = bottom_helps.iter().cloned().collect::<_>(); + + let mut never_trivial_help = String::new(); + if !never_trivial.is_empty() { + let len = never_trivial.len(); + for (idx, t) in never_trivial.iter().enumerate() { + never_trivial_help.push('`'); + never_trivial_help.push_str(t.as_str()); + never_trivial_help.push('`'); + + if idx < len - 1 { + never_trivial_help.push_str(", "); + } + } + + if len == 1 { + never_trivial_help.push_str(" is never trivially decodable."); + } else { + never_trivial_help.push_str(" are never trivially decodable."); + } + + bottom_helps.push(never_trivial_help); + } + + bottom_helps.push( + "For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html".to_string() + ); + + if matches!(can_be_made_trivial, Some(true)) { + hints.push( + Hint::help( + source_engine, + span.clone(), + "Consider the suggestions below to make this type trivially decodable.".to_string() + ) + ); + } + + Diagnostic { + reason: Some(Reason::new(code(1), "Type is not trivially decodable".to_string())), + issue: Issue::error( + source_engine, + span.clone(), + format!("`{}` is not trivially decodable.", span.as_str()), + ), + hints, + help: bottom_helps, + } + } _ => Diagnostic { // TODO: Temporarily we use `self` here to achieve backward compatibility. // In general, `self` must not be used. All the values for the formatting diff --git a/sway-ir/src/irtype.rs b/sway-ir/src/irtype.rs index 08b8e6c3563..af80f8c03ee 100644 --- a/sway-ir/src/irtype.rs +++ b/sway-ir/src/irtype.rs @@ -154,6 +154,11 @@ impl Type { Self::get_or_create_unique_type(context, TypeContent::Array(elm_ty, len)) } + /// Get slice type + pub fn new_typed_slice(context: &mut Context, elm_ty: Type) -> Type { + Self::get_or_create_unique_type(context, TypeContent::TypedSlice(elm_ty)) + } + /// Get union type pub fn new_union(context: &mut Context, fields: Vec) -> Type { Self::get_or_create_unique_type(context, TypeContent::Union(fields)) diff --git a/sway-ir/src/parser.rs b/sway-ir/src/parser.rs index 4e447811bd3..cece05b15a0 100644 --- a/sway-ir/src/parser.rs +++ b/sway-ir/src/parser.rs @@ -30,7 +30,6 @@ pub fn parse<'eng>( mod ir_builder { use slotmap::KeyData; - use std::convert::TryFrom; use sway_features::ExperimentalFeatures; use sway_types::{ident::Ident, span::Span, u256::U256, SourceEngine}; diff --git a/sway-lib-std/src/codec.sw b/sway-lib-std/src/codec.sw index e4bddf32d9b..ed899843b5a 100644 --- a/sway-lib-std/src/codec.sw +++ b/sway-lib-std/src/codec.sw @@ -3,6 +3,7 @@ library; use ::ops::*; use ::raw_ptr::*; use ::raw_slice::*; +use ::slice::*; pub struct Buffer { buffer: (raw_ptr, u64, u64), // ptr, capacity, size @@ -2937,3 +2938,221 @@ fn nok_abi_encoding_invalid_bool() { let actual = encode(2u8); let _ = abi_decode::(actual); } + +pub struct TrivialBool { + value: u64, +} + +impl AbiEncode for TrivialBool { + fn is_encode_trivial() -> bool { + true + } + + fn abi_encode(self, buffer: Buffer) -> Buffer { + self.value.abi_encode(buffer) + } +} + +impl AbiDecode for TrivialBool { + fn is_decode_trivial() -> bool { + true + } + + fn abi_decode(ref mut buffer: BufferReader) -> Self { + let value = u64::abi_decode(buffer); + TrivialBool { value } + } +} + +pub const INVALID_BOOL_REVERT: u64 = 0u64; + +impl TrivialBool { + pub fn from(value: bool) -> Self { + TrivialBool { + value: if value { 1 } else { 0 }, + } + } + + fn is_valid(self) -> bool { + match self.value { + 0 => true, + 1 => true, + _ => false, + } + } + + fn unwrap(self) -> bool { + match self.value { + 0 => false, + 1 => true, + _ => __revert(INVALID_BOOL_REVERT), + } + } +} + +#[test] +fn trivial_bool_when_valid() { + let b = TrivialBool { value: 0 }; + assert_eq(b.is_valid(), true, 0); + assert_encoding(b, [0u8, 0, 0, 0, 0, 0, 0, 0]); + + let b = TrivialBool { value: 1 }; + assert_eq(b.is_valid(), true, 0); + assert_encoding(b, [0u8, 0, 0, 0, 0, 0, 0, 1]); +} + +#[test] +fn trivial_bool_when_invalid_is_valid() { + let bytes = encode(TrivialBool { value: 2 }); + assert_eq(abi_decode::(bytes).is_valid(), false, 0); +} + +#[test(should_revert)] +fn trivial_bool_when_invalid_unwrap() { + let slice = encode(TrivialBool { value: 2 }); + let _ = abi_decode::(slice).unwrap(); +} + +pub struct TrivialEnum { + value: T, +} + +impl TrivialEnum { + pub fn from(value: T) -> TrivialEnum { + TrivialEnum { value } + } +} + +pub trait EnumCodecValues { + fn is_decode_trivial_table() -> &__slice[bool]; +} + +impl TrivialEnum +where + T: EnumCodecValues, +{ + pub fn is_valid(self) -> bool { + let discriminant: raw_slice = raw_slice::from_parts::(__addr_of(self.value), 8); + let discriminant: u64 = abi_decode::(discriminant); + + let is_decode_trivial_table = T::is_decode_trivial_table(); + + if discriminant < is_decode_trivial_table.len() { + *__elem_at(is_decode_trivial_table, discriminant) + } else { + false + } + } + + pub fn unwrap(self) -> T { + if self.is_valid() { + self.value + } else { + __revert(1) + } + } +} + +impl AbiEncode for TrivialEnum +where + T: AbiEncode, +{ + fn is_encode_trivial() -> bool { + true + } + + fn abi_encode(self, buffer: Buffer) -> Buffer { + self.value.abi_encode(buffer) + } +} + +impl AbiDecode for TrivialEnum +where + T: AbiDecode, +{ + fn is_decode_trivial() -> bool { + true + } + + fn abi_decode(ref mut buffer: BufferReader) -> Self { + let value = T::abi_decode(buffer); + TrivialEnum { value } + } +} + +enum EnumTesting { + A: u64, + B: u64, +} + +impl EnumCodecValues for EnumTesting { + fn is_decode_trivial_table() -> &__slice[bool] { + __slice(&[true, true], 0, 2) + } +} + +impl AbiEncode for EnumTesting { + fn is_encode_trivial() -> bool { + true + } + + fn abi_encode(self, buffer: Buffer) -> Buffer { + buffer + } +} + +impl AbiDecode for EnumTesting { + fn is_decode_trivial() -> bool { + true + } + + fn abi_decode(ref mut buffer: BufferReader) -> Self { + let discriminant = u64::abi_decode(buffer); + match discriminant { + 0 => { + let v = u64::abi_decode(buffer); + EnumTesting::A(v) + } + 1 => { + let v = u64::abi_decode(buffer); + EnumTesting::B(v) + } + _ => __revert(0), + } + } +} + +impl PartialEq for EnumTesting { + fn eq(self, other: EnumTesting) -> bool { + match (self, other) { + (EnumTesting::A(a), EnumTesting::A(b)) => a == b, + (EnumTesting::B(a), EnumTesting::B(b)) => a == b, + _ => false, + } + } +} + +#[test] +fn trivial_enum_when_valid() { + let before = TrivialEnum { + value: EnumTesting::B(1), + }; + let bytes = encode(before); + let after = abi_decode::>(bytes); + __log(after.is_valid()); + let after = after.unwrap(); + __log(bytes); + assert_eq(after, EnumTesting::B(1), 1); +} + +#[test] +fn trivial_enum_when_invalid_is_valid_returns_false() { + let e = __transmute::<[u8; 16], TrivialEnum>([0u8, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0]); + assert_eq(e.is_valid(), false, 0); +} + +#[test(should_revert)] +fn trivial_enum_when_invalid_unwrap() { + let e = __transmute::<[u8; 16], TrivialEnum>([0u8, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0]); + let _ = e.unwrap(); +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap index 1a242815443..d43200bf289 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/array/array_repeat/stdout.snap @@ -26,10 +26,10 @@ library { script { pub entry fn __entry() -> __ptr never, !3 { entry(): - v784v1 = call main_0(), !6 - v787v1 = const u64 0, !7 - v788v1 = const u64 0, !8 - retd v787v1 v788v1, !9 + v785v1 = call main_0(), !6 + v788v1 = const u64 0, !7 + v789v1 = const u64 0, !8 + retd v788v1 v789v1, !9 } entry_orig fn main_0() -> (), !13 { @@ -53,187 +53,187 @@ script { local [u8; 1] array entry(): - v1814v1 = get_local __ptr [u8; 5], __ret_val - v1815v1 = call array_repeat_zero_small_u8_1(v1814v1) - v1821v1 = get_local __ptr [u64; 5], __ret_val0 - v1822v1 = call array_repeat_zero_small_u16_2(v1821v1) - v1824v1 = get_local __ptr [u64; 5], __ret_val1 - v1825v1 = call array_repeat_zero_small_u16_2(v1824v1) - v1827v1 = get_local __ptr [u64; 5], __ret_val2 - v1828v1 = call array_repeat_zero_small_u16_2(v1827v1) - v1834v1 = get_local __ptr [u256; 5], __ret_val3 - v1835v1 = call array_repeat_zero_small_u256_5(v1834v1) - v1841v1 = get_local __ptr [b256; 5], __ret_val4 - v1842v1 = call array_repeat_zero_small_b256_6(v1841v1) - v1848v1 = get_local __ptr [bool; 5], __ret_val5 - v1849v1 = call array_repeat_zero_small_bool_7(v1848v1) - v1855v1 = get_local __ptr [u8; 25], __ret_val6 - v1856v1 = call array_repeat_zero_big_u8_8(v1855v1) - v1862v1 = get_local __ptr [u64; 25], __ret_val7 - v1863v1 = call array_repeat_zero_big_u32_10(v1862v1) - v1865v1 = get_local __ptr [u64; 25], __ret_val8 - v1866v1 = call array_repeat_zero_big_u32_10(v1865v1) - v1868v1 = get_local __ptr [u64; 25], __ret_val9 - v1869v1 = call array_repeat_zero_big_u32_10(v1868v1) - v1875v1 = get_local __ptr [u256; 25], __ret_val10 - v1876v1 = call array_repeat_zero_big_u256_12(v1875v1) - v1882v1 = get_local __ptr [b256; 25], __ret_val11 - v1883v1 = call array_repeat_zero_big_b256_13(v1882v1) - v1889v1 = get_local __ptr [bool; 25], __ret_val12 - v1890v1 = call array_repeat_zero_big_bool_14(v1889v1) - v1896v1 = get_local __ptr [bool; 5], __ret_val13 - v1897v1 = call small_array_repeat_15(v1896v1) - v1903v1 = get_local __ptr [bool; 25], __ret_val14 - v1904v1 = call big_array_repeat_16(v1903v1) - v1910v1 = get_local __ptr [u8; 262145], __ret_val15 - v1911v1 = call u8_array_bigger_than_18_bits_17(v1910v1) - v190v1 = call arrays_with_const_length_18(), !16 - v1917v1 = get_local __ptr [u8; 1], array - v1918v1 = call decode_array_19(v1917v1) - v775v1 = get_local __ptr [u8; 1], array, !17 - v776v1 = const u64 0, !18 - v777v1 = get_elem_ptr v775v1, __ptr u8, v776v1, !19 - v778v1 = load v777v1 - v779v1 = const u8 255, !20 - v1759v1 = cmp eq v778v1 v779v1, !29 - v573v1 = const bool false, !30 - v1763v1 = cmp eq v1759v1 v573v1, !33 - cbr v1763v1, assert_eq_42_block0(), assert_eq_42_block1(), !34 + v1815v1 = get_local __ptr [u8; 5], __ret_val + v1816v1 = call array_repeat_zero_small_u8_1(v1815v1) + v1822v1 = get_local __ptr [u64; 5], __ret_val0 + v1823v1 = call array_repeat_zero_small_u16_2(v1822v1) + v1825v1 = get_local __ptr [u64; 5], __ret_val1 + v1826v1 = call array_repeat_zero_small_u16_2(v1825v1) + v1828v1 = get_local __ptr [u64; 5], __ret_val2 + v1829v1 = call array_repeat_zero_small_u16_2(v1828v1) + v1835v1 = get_local __ptr [u256; 5], __ret_val3 + v1836v1 = call array_repeat_zero_small_u256_5(v1835v1) + v1842v1 = get_local __ptr [b256; 5], __ret_val4 + v1843v1 = call array_repeat_zero_small_b256_6(v1842v1) + v1849v1 = get_local __ptr [bool; 5], __ret_val5 + v1850v1 = call array_repeat_zero_small_bool_7(v1849v1) + v1856v1 = get_local __ptr [u8; 25], __ret_val6 + v1857v1 = call array_repeat_zero_big_u8_8(v1856v1) + v1863v1 = get_local __ptr [u64; 25], __ret_val7 + v1864v1 = call array_repeat_zero_big_u32_10(v1863v1) + v1866v1 = get_local __ptr [u64; 25], __ret_val8 + v1867v1 = call array_repeat_zero_big_u32_10(v1866v1) + v1869v1 = get_local __ptr [u64; 25], __ret_val9 + v1870v1 = call array_repeat_zero_big_u32_10(v1869v1) + v1876v1 = get_local __ptr [u256; 25], __ret_val10 + v1877v1 = call array_repeat_zero_big_u256_12(v1876v1) + v1883v1 = get_local __ptr [b256; 25], __ret_val11 + v1884v1 = call array_repeat_zero_big_b256_13(v1883v1) + v1890v1 = get_local __ptr [bool; 25], __ret_val12 + v1891v1 = call array_repeat_zero_big_bool_14(v1890v1) + v1897v1 = get_local __ptr [bool; 5], __ret_val13 + v1898v1 = call small_array_repeat_15(v1897v1) + v1904v1 = get_local __ptr [bool; 25], __ret_val14 + v1905v1 = call big_array_repeat_16(v1904v1) + v1911v1 = get_local __ptr [u8; 262145], __ret_val15 + v1912v1 = call u8_array_bigger_than_18_bits_17(v1911v1) + v191v1 = call arrays_with_const_length_18(), !16 + v1918v1 = get_local __ptr [u8; 1], array + v1919v1 = call decode_array_19(v1918v1) + v776v1 = get_local __ptr [u8; 1], array, !17 + v777v1 = const u64 0, !18 + v778v1 = get_elem_ptr v776v1, __ptr u8, v777v1, !19 + v779v1 = load v778v1 + v780v1 = const u8 255, !20 + v1760v1 = cmp eq v779v1 v780v1, !29 + v574v1 = const bool false, !30 + v1764v1 = cmp eq v1760v1 v574v1, !33 + cbr v1764v1, assert_eq_42_block0(), assert_eq_42_block1(), !34 assert_eq_42_block0(): - v1770v1 = call log_46(v778v1), !37 - v1772v1 = call log_46(v779v1), !40 - v871v1 = const u64 18446744073709486083 - revert v871v1, !45 + v1771v1 = call log_46(v779v1), !37 + v1773v1 = call log_46(v780v1), !40 + v872v1 = const u64 18446744073709486083 + revert v872v1, !45 assert_eq_42_block1(): - v782v1 = const unit () - ret () v782v1 + v783v1 = const unit () + ret () v783v1 } fn array_repeat_zero_small_u8_1(__ret_value: __ptr [u8; 5]) -> (), !49 { entry(__ret_value: __ptr [u8; 5]): mem_clear_val __ret_value, !50 - v1812v1 = const unit () - ret () v1812v1 + v1813v1 = const unit () + ret () v1813v1 } fn array_repeat_zero_small_u16_2(__ret_value: __ptr [u64; 5]) -> (), !53 { entry(__ret_value: __ptr [u64; 5]): mem_clear_val __ret_value, !54 - v1819v1 = const unit () - ret () v1819v1 + v1820v1 = const unit () + ret () v1820v1 } fn array_repeat_zero_small_u256_5(__ret_value: __ptr [u256; 5]) -> (), !57 { entry(__ret_value: __ptr [u256; 5]): mem_clear_val __ret_value, !58 - v1832v1 = const unit () - ret () v1832v1 + v1833v1 = const unit () + ret () v1833v1 } fn array_repeat_zero_small_b256_6(__ret_value: __ptr [b256; 5]) -> (), !61 { entry(__ret_value: __ptr [b256; 5]): mem_clear_val __ret_value, !62 - v1839v1 = const unit () - ret () v1839v1 + v1840v1 = const unit () + ret () v1840v1 } fn array_repeat_zero_small_bool_7(__ret_value: __ptr [bool; 5]) -> (), !65 { entry(__ret_value: __ptr [bool; 5]): mem_clear_val __ret_value, !66 - v1846v1 = const unit () - ret () v1846v1 + v1847v1 = const unit () + ret () v1847v1 } fn array_repeat_zero_big_u8_8(__ret_value: __ptr [u8; 25]) -> (), !69 { entry(__ret_value: __ptr [u8; 25]): mem_clear_val __ret_value, !70 - v1853v1 = const unit () - ret () v1853v1 + v1854v1 = const unit () + ret () v1854v1 } fn array_repeat_zero_big_u32_10(__ret_value: __ptr [u64; 25]) -> (), !73 { entry(__ret_value: __ptr [u64; 25]): mem_clear_val __ret_value, !74 - v1860v1 = const unit () - ret () v1860v1 + v1861v1 = const unit () + ret () v1861v1 } fn array_repeat_zero_big_u256_12(__ret_value: __ptr [u256; 25]) -> (), !77 { entry(__ret_value: __ptr [u256; 25]): mem_clear_val __ret_value, !78 - v1873v1 = const unit () - ret () v1873v1 + v1874v1 = const unit () + ret () v1874v1 } fn array_repeat_zero_big_b256_13(__ret_value: __ptr [b256; 25]) -> (), !81 { entry(__ret_value: __ptr [b256; 25]): mem_clear_val __ret_value, !82 - v1880v1 = const unit () - ret () v1880v1 + v1881v1 = const unit () + ret () v1881v1 } fn array_repeat_zero_big_bool_14(__ret_value: __ptr [bool; 25]) -> (), !85 { entry(__ret_value: __ptr [bool; 25]): mem_clear_val __ret_value, !86 - v1887v1 = const unit () - ret () v1887v1 + v1888v1 = const unit () + ret () v1888v1 } fn small_array_repeat_15(__ret_value: __ptr [bool; 5]) -> (), !89 { entry(__ret_value: __ptr [bool; 5]): - v800v1 = const u64 0 - v801v1 = get_elem_ptr __ret_value, __ptr bool, v800v1, !90 - v114v1 = const bool true - store v114v1 to v801v1, !90 - v803v1 = const u64 1 - v804v1 = get_elem_ptr __ret_value, __ptr bool, v803v1, !90 - store v114v1 to v804v1, !90 - v806v1 = const u64 2 - v807v1 = get_elem_ptr __ret_value, __ptr bool, v806v1, !90 - store v114v1 to v807v1, !90 - v809v1 = const u64 3 - v810v1 = get_elem_ptr __ret_value, __ptr bool, v809v1, !90 - store v114v1 to v810v1, !90 - v812v1 = const u64 4 - v813v1 = get_elem_ptr __ret_value, __ptr bool, v812v1, !90 - store v114v1 to v813v1, !90 - v1894v1 = const unit () - ret () v1894v1 + v801v1 = const u64 0 + v802v1 = get_elem_ptr __ret_value, __ptr bool, v801v1, !90 + v115v1 = const bool true + store v115v1 to v802v1, !90 + v804v1 = const u64 1 + v805v1 = get_elem_ptr __ret_value, __ptr bool, v804v1, !90 + store v115v1 to v805v1, !90 + v807v1 = const u64 2 + v808v1 = get_elem_ptr __ret_value, __ptr bool, v807v1, !90 + store v115v1 to v808v1, !90 + v810v1 = const u64 3 + v811v1 = get_elem_ptr __ret_value, __ptr bool, v810v1, !90 + store v115v1 to v811v1, !90 + v813v1 = const u64 4 + v814v1 = get_elem_ptr __ret_value, __ptr bool, v813v1, !90 + store v115v1 to v814v1, !90 + v1895v1 = const unit () + ret () v1895v1 } fn big_array_repeat_16(__ret_value: __ptr [bool; 25]) -> (), !93 { entry(__ret_value: __ptr [bool; 25]): - v816v1 = const u64 0 - br array_init_loop(v816v1) + v817v1 = const u64 0 + br array_init_loop(v817v1) - array_init_loop(v815v1: u64): - v818v1 = get_elem_ptr __ret_value, __ptr bool, v815v1 - v122v1 = const bool true - store v122v1 to v818v1, !94 - v820v1 = const u64 1 - v821v1 = add v815v1, v820v1 - v822v1 = const u64 25 - v823v1 = cmp lt v821v1 v822v1 - cbr v823v1, array_init_loop(v821v1), array_init_loop_exit() + array_init_loop(v816v1: u64): + v819v1 = get_elem_ptr __ret_value, __ptr bool, v816v1 + v123v1 = const bool true + store v123v1 to v819v1, !94 + v821v1 = const u64 1 + v822v1 = add v816v1, v821v1 + v823v1 = const u64 25 + v824v1 = cmp lt v822v1 v823v1 + cbr v824v1, array_init_loop(v822v1), array_init_loop_exit() array_init_loop_exit(): - v1901v1 = const unit () - ret () v1901v1 + v1902v1 = const unit () + ret () v1902v1 } fn u8_array_bigger_than_18_bits_17(__ret_value: __ptr [u8; 262145]) -> (), !97 { entry(__ret_value: __ptr [u8; 262145]): mem_clear_val __ret_value, !98 - v1908v1 = const unit () - ret () v1908v1 + v1909v1 = const unit () + ret () v1909v1 } fn arrays_with_const_length_18() -> (), !101 { entry(): - v188v1 = const unit () - ret () v188v1 + v189v1 = const unit () + ret () v189v1 } fn decode_array_19(__ret_value: __ptr [u8; 1]) -> (), !104 { @@ -244,51 +244,51 @@ script { local slice slice_0 entry(__ret_value: __ptr [u8; 1]): - v241v1 = get_local __ptr [u8; 1], __array_init_0, !105 - v843v1 = const u64 0 - v844v1 = get_elem_ptr v241v1, __ptr u8, v843v1, !105 - v242v1 = const u8 255, !106 - store v242v1 to v844v1, !105 - v1806v1 = get_local __ptr [u8; 1], __array_init_0 - v1924v1 = get_local __ptr slice, __ret_val - v1925v1 = call to_slice_20(v1806v1, v1924v1) - v246v1 = get_local __ptr slice, s, !107 - mem_copy_val v246v1, v1924v1 - v1780v1 = get_local __ptr slice, s, !115 - v1782v1 = get_local __ptr slice, slice_0, !118 - mem_copy_val v1782v1, v1780v1 - v1784v1 = get_local __ptr slice, slice_0, !120 - v1927v1 = asm(ptr: v1784v1) -> __ptr { ptr, u64 } ptr { + v242v1 = get_local __ptr [u8; 1], __array_init_0, !105 + v844v1 = const u64 0 + v845v1 = get_elem_ptr v242v1, __ptr u8, v844v1, !105 + v243v1 = const u8 255, !106 + store v243v1 to v845v1, !105 + v1807v1 = get_local __ptr [u8; 1], __array_init_0 + v1925v1 = get_local __ptr slice, __ret_val + v1926v1 = call to_slice_20(v1807v1, v1925v1) + v247v1 = get_local __ptr slice, s, !107 + mem_copy_val v247v1, v1925v1 + v1781v1 = get_local __ptr slice, s, !115 + v1783v1 = get_local __ptr slice, slice_0, !118 + mem_copy_val v1783v1, v1781v1 + v1785v1 = get_local __ptr slice, slice_0, !120 + v1928v1 = asm(ptr: v1785v1) -> __ptr { ptr, u64 } ptr { } - v1963v1 = const u64 0 - v1964v1 = get_elem_ptr v1927v1, __ptr ptr, v1963v1 - v1965v1 = load v1964v1 - v1966v1 = const u64 1 - v1967v1 = get_elem_ptr v1927v1, __ptr u64, v1966v1 - v1968v1 = load v1967v1 - v1786v1 = get_local __ptr { ptr, u64 }, __anon_00, !121 - v1977v1 = const u64 0 - v1978v1 = get_elem_ptr v1786v1, __ptr ptr, v1977v1 - store v1965v1 to v1978v1 - v1980v1 = const u64 1 - v1981v1 = get_elem_ptr v1786v1, __ptr u64, v1980v1 - store v1968v1 to v1981v1 - v280v1 = const u64 0 - v1788v1 = get_elem_ptr v1786v1, __ptr ptr, v280v1, !123 - v1789v1 = load v1788v1, !121 - v260v1 = const u64 1 - v1515v1 = asm(size: v260v1, src: v1789v1) -> __ptr [u8; 1] hp, !125 { + v1964v1 = const u64 0 + v1965v1 = get_elem_ptr v1928v1, __ptr ptr, v1964v1 + v1966v1 = load v1965v1 + v1967v1 = const u64 1 + v1968v1 = get_elem_ptr v1928v1, __ptr u64, v1967v1 + v1969v1 = load v1968v1 + v1787v1 = get_local __ptr { ptr, u64 }, __anon_00, !121 + v1978v1 = const u64 0 + v1979v1 = get_elem_ptr v1787v1, __ptr ptr, v1978v1 + store v1966v1 to v1979v1 + v1981v1 = const u64 1 + v1982v1 = get_elem_ptr v1787v1, __ptr u64, v1981v1 + store v1969v1 to v1982v1 + v281v1 = const u64 0 + v1789v1 = get_elem_ptr v1787v1, __ptr ptr, v281v1, !123 + v1790v1 = load v1789v1, !121 + v261v1 = const u64 1 + v1516v1 = asm(size: v261v1, src: v1790v1) -> __ptr [u8; 1] hp, !125 { aloc size, !126 mcp hp src size, !127 } - v1983v1 = const u64 0 - v1984v1 = get_elem_ptr v1515v1, __ptr u8, v1983v1 - v1985v1 = load v1984v1 - v1990v1 = const u64 0 - v1991v1 = get_elem_ptr __ret_value, __ptr u8, v1990v1 - store v1985v1 to v1991v1 - v1915v1 = const unit () - ret () v1915v1 + v1984v1 = const u64 0 + v1985v1 = get_elem_ptr v1516v1, __ptr u8, v1984v1 + v1986v1 = load v1985v1 + v1991v1 = const u64 0 + v1992v1 = get_elem_ptr __ret_value, __ptr u8, v1991v1 + store v1986v1 to v1992v1 + v1916v1 = const unit () + ret () v1916v1 } fn to_slice_20(array: __ptr [u8; 1], __ret_value: __ptr slice) -> (), !130 { @@ -297,26 +297,26 @@ script { local { ptr, u64 } parts_ entry(array: __ptr [u8; 1], __ret_value: __ptr slice): - v194v1 = get_local __ptr [u8; 1], array_ - mem_copy_val v194v1, array - v235v1 = get_local __ptr [u8; 1], array_, !131 - v236v1 = cast_ptr v235v1 to ptr, !132 - v902v1 = get_local __ptr { ptr, u64 }, parts_, !137 - v1999v1 = const u64 0 - v2000v1 = get_elem_ptr v902v1, __ptr ptr, v1999v1 - store v236v1 to v2000v1 - v2002v1 = const u64 1 - v2003v1 = get_elem_ptr v902v1, __ptr u64, v2002v1 - v895v1 = const u64 1, !140 - store v895v1 to v2003v1 - v904v1 = get_local __ptr { ptr, u64 }, parts_, !142 - v1929v1 = asm(ptr: v904v1) -> __ptr slice ptr { + v195v1 = get_local __ptr [u8; 1], array_ + mem_copy_val v195v1, array + v236v1 = get_local __ptr [u8; 1], array_, !131 + v237v1 = cast_ptr v236v1 to ptr, !132 + v903v1 = get_local __ptr { ptr, u64 }, parts_, !137 + v2000v1 = const u64 0 + v2001v1 = get_elem_ptr v903v1, __ptr ptr, v2000v1 + store v237v1 to v2001v1 + v2003v1 = const u64 1 + v2004v1 = get_elem_ptr v903v1, __ptr u64, v2003v1 + v896v1 = const u64 1, !140 + store v896v1 to v2004v1 + v905v1 = get_local __ptr { ptr, u64 }, parts_, !142 + v1930v1 = asm(ptr: v905v1) -> __ptr slice ptr { } - v1958v1 = get_local __ptr slice, __aggr_memcpy_0 - mem_copy_val v1958v1, v1929v1 - mem_copy_val __ret_value, v1958v1 - v1922v1 = const unit () - ret () v1922v1 + v1959v1 = get_local __ptr slice, __aggr_memcpy_0 + mem_copy_val v1959v1, v1930v1 + mem_copy_val __ret_value, v1959v1 + v1923v1 = const unit () + ret () v1923v1 } pub fn log_46(value !144: u8) -> (), !147 { @@ -325,25 +325,25 @@ script { local u8 value_ entry(value: u8): - v601v1 = get_local __ptr u8, value_ - store value to v601v1 - v742v1 = get_local __ptr u8, value_, !148 - v1708v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !150 - v858v1 = const u64 0 - v1711v1 = get_elem_ptr v1708v1, __ptr __ptr u8, v858v1, !151 - store v742v1 to v1711v1, !152 - v861v1 = const u64 1 - v1713v1 = get_elem_ptr v1708v1, __ptr u64, v861v1, !153 - v611v1 = const u64 1 - store v611v1 to v1713v1, !154 - v1716v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !148 - v1718v1 = cast_ptr v1716v1 to __ptr slice, !148 - v1931v1 = get_local __ptr slice, __log_arg - mem_copy_val v1931v1, v1718v1 - v744v1 = const u64 14454674236531057292 - log __ptr slice v1931v1, v744v1 - v748v1 = const unit () - ret () v748v1 + v602v1 = get_local __ptr u8, value_ + store value to v602v1 + v743v1 = get_local __ptr u8, value_, !148 + v1709v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !150 + v859v1 = const u64 0 + v1712v1 = get_elem_ptr v1709v1, __ptr __ptr u8, v859v1, !151 + store v743v1 to v1712v1, !152 + v862v1 = const u64 1 + v1714v1 = get_elem_ptr v1709v1, __ptr u64, v862v1, !153 + v612v1 = const u64 1 + store v612v1 to v1714v1, !154 + v1717v1 = get_local __ptr { __ptr u8, u64 }, __anon_0, !148 + v1719v1 = cast_ptr v1717v1 to __ptr slice, !148 + v1932v1 = get_local __ptr slice, __log_arg + mem_copy_val v1932v1, v1719v1 + v745v1 = const u64 14454674236531057292 + log __ptr slice v1932v1, v745v1 + v749v1 = const unit () + ret () v749v1 } } @@ -458,8 +458,8 @@ script { !108 = span !10 3147 3171 !109 = fn_call_path_span !10 3147 3157 !110 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/codec.sw" -!111 = span !110 49688 49698 -!112 = fn_call_path_span !110 49693 49696 +!111 = span !110 49704 49714 +!112 = fn_call_path_span !110 49709 49712 !113 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert/src/raw_slice.sw" !114 = span !113 2922 2926 !115 = (!108 !109 !111 !112 !114) @@ -471,10 +471,10 @@ script { !121 = (!108 !109 !111 !112) !122 = span !113 2928 2929 !123 = (!108 !109 !111 !112 !122) -!124 = span !110 49667 49782 +!124 = span !110 49683 49798 !125 = (!108 !109 !124) -!126 = span !110 49714 49723 -!127 = span !110 49737 49752 +!126 = span !110 49730 49739 +!127 = span !110 49753 49768 !128 = span !10 3192 3320 !129 = fn_name_span !10 3195 3203 !130 = (!128 !129 !48) @@ -496,7 +496,7 @@ script { !146 = fn_name_span !143 584 587 !147 = (!145 !146) !148 = span !143 642 647 -!149 = span !110 48850 48862 +!149 = span !110 48866 48878 !150 = (!148 !149) !151 = (!148 !149) !152 = (!148 !149) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/Forc.lock new file mode 100644 index 00000000000..c70a25c94e7 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/Forc.lock @@ -0,0 +1,8 @@ +[[package]] +name = "attribute_require" +source = "member" +dependencies = ["std"] + +[[package]] +name = "std" +source = "path+from-root-C5664B88CD40B57F" diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/Forc.toml new file mode 100644 index 00000000000..0dcfa6f541d --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/Forc.toml @@ -0,0 +1,9 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "attribute_require" + +[dependencies] +std = { path = "../../../../../reduced_std_libs/sway-lib-std-vec" } + diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/snapshot.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/snapshot.toml new file mode 100644 index 00000000000..c5cfffd3a2d --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/snapshot.toml @@ -0,0 +1,3 @@ +cmds = [ + "forc build --path {root}", +] \ No newline at end of file diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw new file mode 100644 index 00000000000..a08981a2fbb --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw @@ -0,0 +1,74 @@ +script; + +#[require(trivially_decodable = "true")] +struct MyStruct { + f0: bool, + f1: u8, + f2: u16, + f3: u32, + f4: u64, + f5: u256, + f6: b256, + f7: TrivialStruct, + f8: NonTrivialStruct, + f9: SomeEnum, + + f11: Vec, + f12: Result, u64>, + f13: Result, + + f14: (u64, NonTrivialStruct), + f15: [NonTrivialStruct; 1], + f16: [(u64, NonTrivialStruct); 2], +} + +struct TrivialStruct { +} + +struct NonTrivialStruct { + pub a: bool, +} + +enum SomeEnum { + A: () +} + +abi SomeAbi { + #[require(trivially_decodable = "true")] + fn some_fn_1(a: NonTrivialStruct, b: SomeEnum) -> SomeEnum; + + #[require(trivially_decodable = "true")] + fn some_fn_2(a: u32, b: u16, c: u8, d: bool); + + #[require(trivially_decodable = "true")] + fn some_fn_3(a: u8, b: u64, c: u256, d: b256); + + #[require(trivially_decodable = "true")] + fn some_fn_4(a: (u64, bool)); + + #[require(trivially_decodable = "true")] + fn some_fn_5(a: [bool; 1]); +} + +fn main(s: MyStruct) { + // To disable unused warnings + __log(s.f0); + __log(s.f1); + __log(s.f2); + __log(s.f3); + __log(s.f4); + __log(s.f5); + __log(s.f6); + __log(s.f7); + __log(s.f8.a); + __log(s.f9); + __log(s.f11); + __log(s.f12); + __log(s.f13); + __log(s.f14); + __log(s.f15); + __log(s.f16); + + let _ = TrivialStruct { }; + __log(SomeEnum::A); +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/stdout.snap new file mode 100644 index 00000000000..ef227f7d44a --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/stdout.snap @@ -0,0 +1,170 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require +exit status: 1 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec) + Compiling script attribute_require (test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require) +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:4:8 + | +... + 4 | struct MyStruct { + | ^^^^^^^^ `MyStruct` is not trivially decodable. + | -------- help: Consider changing `MyStruct` to make it trivially decodable. + 5 | f0: bool, + | -- info: This field is not trivially decodable. + | ---- help: Consider changing this type to `TrivialBool`. + 6 | f1: u8, + 7 | f2: u16, + | -- info: This field is not trivially decodable. + | --- help: Consider changing this type to `u64`. + 8 | f3: u32, + | -- info: This field is not trivially decodable. + | --- help: Consider changing this type to `u64`. +... +13 | f8: NonTrivialStruct, + | -- info: This field is not trivially decodable. +14 | f9: SomeEnum, + | -- info: This field is not trivially decodable. + | -------- help: Consider wrapping this type like `TrivialEnum`. +15 | +16 | f11: Vec, + | --- info: This field is not trivially decodable. + | -------- help: `Vec` is never trivially decodable. Consider using array instead, e.g.: `[u64; 64]`. +17 | f12: Result, u64>, + | --- info: This field is not trivially decodable. + | --------------------- help: Consider wrapping this type like `TrivialEnum, u64>>`. +18 | f13: Result, + | --- info: This field is not trivially decodable. + | ---------------- help: Consider wrapping this type like `TrivialEnum>`. +19 | +20 | f14: (u64, NonTrivialStruct), + | --- info: This field is not trivially decodable. +21 | f15: [NonTrivialStruct; 1], + | --- info: This field is not trivially decodable. +22 | f16: [(u64, NonTrivialStruct); 2], + | --- info: This field is not trivially decodable. + | + = help: Enums are represented as tagged unions and because of that they cannot be trivially decoded. But where needed, they can be wrapped by `TrivialEnum`, and their original value can be retrieved later with `unwrap`. + = help: `bool`, `u16`, `u32` are never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:28:8 + | +... +28 | struct NonTrivialStruct { + | ^^^^^^^^^^^^^^^^ `NonTrivialStruct` is not trivially decodable. + | ---------------- help: Consider changing `NonTrivialStruct` to make it trivially decodable. +29 | pub a: bool, + | - info: This field is not trivially decodable. + | ---- help: Consider changing this type to `TrivialBool`. +30 | } +31 | +32 | enum SomeEnum { +33 | A: () +... +37 | #[require(trivially_decodable = "true")] +38 | fn some_fn_1(a: NonTrivialStruct, b: SomeEnum) -> SomeEnum; + | ---------------- info: This is the reason `NonTrivialStruct` is being checked + | + = help: `bool` is never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:32:6 + | +... +32 | enum SomeEnum { + | ^^^^^^^^ `SomeEnum` is not trivially decodable. +... +38 | fn some_fn_1(a: NonTrivialStruct, b: SomeEnum) -> SomeEnum; + | -------- info: This is the reason `SomeEnum` is being checked + | -------- help: Consider wrapping this type like `TrivialEnum`. + | + = help: Enums are represented as tagged unions and because of that they cannot be trivially decoded. But where needed, they can be wrapped by `TrivialEnum`, and their original value can be retrieved later with `unwrap`. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:32:6 + | +... +32 | enum SomeEnum { + | ^^^^^^^^ `SomeEnum` is not trivially decodable. +... +38 | fn some_fn_1(a: NonTrivialStruct, b: SomeEnum) -> SomeEnum; + | -------- info: This is the reason `SomeEnum` is being checked + | -------- help: Consider wrapping this type like `TrivialEnum`. + | + = help: Enums are represented as tagged unions and because of that they cannot be trivially decoded. But where needed, they can be wrapped by `TrivialEnum`, and their original value can be retrieved later with `unwrap`. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:41:21 + | +... +41 | fn some_fn_2(a: u32, b: u16, c: u8, d: bool); + | ^^^ `u32` is not trivially decodable. + | --- help: Consider changing this type to `u64`. + | + = help: `u32` is never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:41:29 + | +... +41 | fn some_fn_2(a: u32, b: u16, c: u8, d: bool); + | ^^^ `u16` is not trivially decodable. + | --- help: Consider changing this type to `u64`. + | + = help: `u16` is never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:41:44 + | +... +41 | fn some_fn_2(a: u32, b: u16, c: u8, d: bool); + | ^^^^ `bool` is not trivially decodable. + | ---- help: Consider changing this type to `TrivialBool`. + | + = help: `bool` is never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:47:21 + | +... +47 | fn some_fn_4(a: (u64, bool)); + | ^^^^^^^^^^^ `(u64, bool)` is not trivially decodable. + | ---- help: Consider changing this type to `TrivialBool`. + | + = help: `bool` is never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/attributes/attribute_require/src/main.sw:50:21 + | +... +50 | fn some_fn_5(a: [bool; 1]); + | ^^^^^^^^^ `[bool; 1]` is not trivially decodable. + | ---- help: Consider changing this type to `TrivialBool`. + | + = help: `bool` is never trivially decodable. + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + + Aborting due to 9 errors. +error: Failed to compile attribute_require diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap index 257161a0f93..290e419ed7f 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/stdout.snap @@ -18,37 +18,37 @@ script { pub fn abi_decode_in_place_0(ptr !4: ptr, len !5: u64, target !6: ptr) -> (), !9 { entry(ptr: ptr, len: u64, target: ptr): - v138v1 = asm(src: ptr, target: target, len: len) -> (), !10 { + v139v1 = asm(src: ptr, target: target, len: len) -> (), !10 { mcp target src len, !11 } - v216v1 = const unit () - ret () v216v1 + v217v1 = const unit () + ret () v217v1 } pub entry fn __entry() -> __ptr never, !15 { local u64 _result entry(): - v308v1 = call main_15(), !18 - v309v1 = get_local __ptr u64, _result, !19 - store v308v1 to v309v1, !19 - v328v1 = get_local __ptr u64, _result, !20 - v319v1 = const u64 8 - retd v328v1 v319v1, !24 + v309v1 = call main_15(), !18 + v310v1 = get_local __ptr u64, _result, !19 + store v309v1 to v310v1, !19 + v329v1 = get_local __ptr u64, _result, !20 + v320v1 = const u64 8 + retd v329v1 v320v1, !24 } entry_orig fn main_15() -> u64, !27 { entry(): - v298v1 = get_config __ptr { u64 }, WRAPPED, !28 - v299v1 = const u64 0 - v300v1 = get_elem_ptr v298v1, __ptr u64, v299v1, !29 - v301v1 = load v300v1 - v302v1 = get_config __ptr { u64 }, TUPLE, !30 - v303v1 = const u64 0 - v304v1 = get_elem_ptr v302v1, __ptr u64, v303v1, !31 - v305v1 = load v304v1 - v462v1 = add v301v1, v305v1, !34 - ret u64 v462v1 + v299v1 = get_config __ptr { u64 }, WRAPPED, !28 + v300v1 = const u64 0 + v301v1 = get_elem_ptr v299v1, __ptr u64, v300v1, !29 + v302v1 = load v301v1 + v303v1 = get_config __ptr { u64 }, TUPLE, !30 + v304v1 = const u64 0 + v305v1 = get_elem_ptr v303v1, __ptr u64, v304v1, !31 + v306v1 = load v305v1 + v463v1 = add v302v1, v306v1, !34 + ret u64 v463v1 } } @@ -56,14 +56,14 @@ script { !1 = span !0 177 182 !2 = span !0 136 143 !3 = "sway-lib-std/src/codec.sw" -!4 = span !3 49961 49964 -!5 = span !3 49975 49978 -!6 = span !3 49985 49991 -!7 = span !3 49931 50445 -!8 = fn_name_span !3 49938 49957 +!4 = span !3 49977 49980 +!5 = span !3 49991 49994 +!6 = span !3 50001 50007 +!7 = span !3 49947 50461 +!8 = fn_name_span !3 49954 49973 !9 = (!7 !8) -!10 = span !3 50070 50153 -!11 = span !3 50124 50142 +!10 = span !3 50086 50169 +!11 = span !3 50140 50158 !12 = "test/src/e2e_vm_tests/test_programs/should_pass/language/configurable_dedup_decode/src/main..sw" !13 = span !12 0 131 !14 = fn_name_span !12 7 14 @@ -75,7 +75,7 @@ script { !20 = span !12 109 116 !21 = span !12 83 117 !22 = fn_call_path_span !12 83 100 -!23 = span !3 49161 49187 +!23 = span !3 49177 49203 !24 = (!21 !22 !23) !25 = span !0 202 246 !26 = fn_name_span !0 205 209 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap index fc433d5cefb..a7d78bad67e 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/logging/stdout.snap @@ -19,12 +19,12 @@ script { local u64 _result entry(): - v1381v1 = call main_0(), !6 - v1382v1 = get_local __ptr u64, _result, !7 - store v1381v1 to v1382v1, !7 - v1401v1 = get_local __ptr u64, _result, !8 - v1392v1 = const u64 8 - retd v1401v1 v1392v1, !13 + v1382v1 = call main_0(), !6 + v1383v1 = get_local __ptr u64, _result, !7 + store v1382v1 to v1383v1, !7 + v1402v1 = get_local __ptr u64, _result, !8 + v1393v1 = const u64 8 + retd v1402v1 v1393v1, !13 } entry_orig fn main_0() -> u64, !17 { @@ -41,111 +41,111 @@ script { local mut { { ptr, u64 }, u64 } e entry(): - v3725v1 = get_local __ptr u256, __const - v164v1 = const u64 0, !18 - v165v1 = call local_log_1(v164v1), !21 - v3700v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !26 - v3701v1 = get_local __ptr { ptr, u64 }, __struct_init_000, !30 - v175v1 = const u64 0, !31 - v3704v1 = alloc u64 x v175v1, !36 - v1462v1 = const u64 0 - v3706v1 = get_elem_ptr v3701v1, __ptr ptr, v1462v1, !37 - store v3704v1 to v3706v1, !38 - v1465v1 = const u64 1 - v3708v1 = get_elem_ptr v3701v1, __ptr u64, v1465v1, !39 - v177v1 = const u64 0, !40 - store v177v1 to v3708v1, !41 - v1456v1 = const u64 0 - v3712v1 = get_elem_ptr v3700v1, __ptr { ptr, u64 }, v1456v1, !42 - mem_copy_val v3712v1, v3701v1 - v1459v1 = const u64 1 - v3714v1 = get_elem_ptr v3700v1, __ptr u64, v1459v1, !43 - v182v1 = const u64 0, !44 - store v182v1 to v3714v1, !45 - v470v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !46 - v472v1 = const u64 1, !47 - v473v1 = call push_11(v470v1, v472v1), !50 - v474v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !51 - v476v1 = const u64 2, !52 - v477v1 = call push_11(v474v1, v476v1), !55 - v478v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !56 - v480v1 = const u64 3, !57 - v481v1 = call push_11(v478v1, v480v1), !60 - v1067v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, __tmp_arg, !61 - v1072v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !62 - v1075v1 = get_global __ptr string<4>, __const_global - v1076v1 = cast_ptr v1075v1 to ptr, !63 - v1078v1 = get_local __ptr { ptr, u64 }, __anon_0, !63 - v1079v1 = const u64 0 - v1080v1 = get_elem_ptr v1078v1, __ptr ptr, v1079v1 - store v1076v1 to v1080v1, !63 - v1082v1 = const u64 1 - v1083v1 = get_elem_ptr v1078v1, __ptr u64, v1082v1 - v1077v1 = const u64 4 - store v1077v1 to v1083v1, !63 - v1085v1 = get_local __ptr slice, __anon_1, !63 - mem_copy_bytes v1085v1, v1078v1, 16 - v1423v1 = const u64 0 - v1424v1 = get_elem_ptr v1067v1, __ptr u64, v1423v1, !61 - v1068v1 = const u64 1, !64 - store v1068v1 to v1424v1, !61 - v1426v1 = const u64 1 - v1427v1 = get_elem_ptr v1067v1, __ptr u64, v1426v1, !61 - v1069v1 = const u64 2, !65 - store v1069v1 to v1427v1, !61 - v1429v1 = const u64 2 - v1430v1 = get_elem_ptr v1067v1, __ptr u64, v1429v1, !61 - v1070v1 = const u64 3, !66 - store v1070v1 to v1430v1, !61 - v1432v1 = const u64 3 - v1433v1 = get_elem_ptr v1067v1, __ptr u8, v1432v1, !61 - v1071v1 = const u8 4, !67 - store v1071v1 to v1433v1, !61 - v1435v1 = const u64 4 - v1436v1 = get_elem_ptr v1067v1, __ptr { { ptr, u64 }, u64 }, v1435v1, !61 - mem_copy_val v1436v1, v1072v1 - v1438v1 = const u64 5 - v1439v1 = get_elem_ptr v1067v1, __ptr slice, v1438v1, !61 - mem_copy_val v1439v1, v1085v1 - v1441v1 = const u64 6 - v1442v1 = get_elem_ptr v1067v1, __ptr u256, v1441v1, !61 - mem_copy_val v1442v1, v3725v1 - v3763v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, __tmp_arg - v3765v1 = call local_log_21(v3763v1) - v1166v1 = get_local __ptr { u64 }, __tmp_arg0, !68 - v1420v1 = const u64 0 - v1421v1 = get_elem_ptr v1166v1, __ptr u64, v1420v1, !68 - v1167v1 = const u64 1, !69 - store v1167v1 to v1421v1, !68 - v3774v1 = get_local __ptr { u64 }, __tmp_arg0 - v3776v1 = call local_log_48(v3774v1) - v1296v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg1, !70 - v1297v1 = const u64 0 - v1298v1 = get_elem_ptr v1296v1, __ptr u64, v1297v1, !70 - v1295v1 = const u64 0, !70 - store v1295v1 to v1298v1, !70 - v1300v1 = get_local __ptr { u64 }, __struct_init_2, !71 - v1417v1 = const u64 0 - v1418v1 = get_elem_ptr v1300v1, __ptr u64, v1417v1, !71 - v1301v1 = const u64 1, !72 - store v1301v1 to v1418v1, !71 - v1304v1 = const u64 1 - v1305v1 = const u64 0 - v1306v1 = get_elem_ptr v1296v1, __ptr { u64 }, v1304v1, v1305v1, !70 - mem_copy_val v1306v1, v1300v1 - v3788v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg1 - v3790v1 = call local_log_53(v3788v1) - v1311v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg2, !70 - v1312v1 = const u64 0 - v1313v1 = get_elem_ptr v1311v1, __ptr u64, v1312v1, !70 - v1310v1 = const u64 1, !70 - store v1310v1 to v1313v1, !70 - v3791v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg2 - v3793v1 = call local_log_53(v3791v1) - v3808v1 = get_local __ptr { }, __tmp_arg3 - v3810v1 = call local_log_60(v3808v1) - v1379v1 = const u64 1, !73 - ret u64 v1379v1 + v3726v1 = get_local __ptr u256, __const + v165v1 = const u64 0, !18 + v166v1 = call local_log_1(v165v1), !21 + v3701v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !26 + v3702v1 = get_local __ptr { ptr, u64 }, __struct_init_000, !30 + v176v1 = const u64 0, !31 + v3705v1 = alloc u64 x v176v1, !36 + v1463v1 = const u64 0 + v3707v1 = get_elem_ptr v3702v1, __ptr ptr, v1463v1, !37 + store v3705v1 to v3707v1, !38 + v1466v1 = const u64 1 + v3709v1 = get_elem_ptr v3702v1, __ptr u64, v1466v1, !39 + v178v1 = const u64 0, !40 + store v178v1 to v3709v1, !41 + v1457v1 = const u64 0 + v3713v1 = get_elem_ptr v3701v1, __ptr { ptr, u64 }, v1457v1, !42 + mem_copy_val v3713v1, v3702v1 + v1460v1 = const u64 1 + v3715v1 = get_elem_ptr v3701v1, __ptr u64, v1460v1, !43 + v183v1 = const u64 0, !44 + store v183v1 to v3715v1, !45 + v471v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !46 + v473v1 = const u64 1, !47 + v474v1 = call push_11(v471v1, v473v1), !50 + v475v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !51 + v477v1 = const u64 2, !52 + v478v1 = call push_11(v475v1, v477v1), !55 + v479v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !56 + v481v1 = const u64 3, !57 + v482v1 = call push_11(v479v1, v481v1), !60 + v1068v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, __tmp_arg, !61 + v1073v1 = get_local __ptr { { ptr, u64 }, u64 }, e, !62 + v1076v1 = get_global __ptr string<4>, __const_global + v1077v1 = cast_ptr v1076v1 to ptr, !63 + v1079v1 = get_local __ptr { ptr, u64 }, __anon_0, !63 + v1080v1 = const u64 0 + v1081v1 = get_elem_ptr v1079v1, __ptr ptr, v1080v1 + store v1077v1 to v1081v1, !63 + v1083v1 = const u64 1 + v1084v1 = get_elem_ptr v1079v1, __ptr u64, v1083v1 + v1078v1 = const u64 4 + store v1078v1 to v1084v1, !63 + v1086v1 = get_local __ptr slice, __anon_1, !63 + mem_copy_bytes v1086v1, v1079v1, 16 + v1424v1 = const u64 0 + v1425v1 = get_elem_ptr v1068v1, __ptr u64, v1424v1, !61 + v1069v1 = const u64 1, !64 + store v1069v1 to v1425v1, !61 + v1427v1 = const u64 1 + v1428v1 = get_elem_ptr v1068v1, __ptr u64, v1427v1, !61 + v1070v1 = const u64 2, !65 + store v1070v1 to v1428v1, !61 + v1430v1 = const u64 2 + v1431v1 = get_elem_ptr v1068v1, __ptr u64, v1430v1, !61 + v1071v1 = const u64 3, !66 + store v1071v1 to v1431v1, !61 + v1433v1 = const u64 3 + v1434v1 = get_elem_ptr v1068v1, __ptr u8, v1433v1, !61 + v1072v1 = const u8 4, !67 + store v1072v1 to v1434v1, !61 + v1436v1 = const u64 4 + v1437v1 = get_elem_ptr v1068v1, __ptr { { ptr, u64 }, u64 }, v1436v1, !61 + mem_copy_val v1437v1, v1073v1 + v1439v1 = const u64 5 + v1440v1 = get_elem_ptr v1068v1, __ptr slice, v1439v1, !61 + mem_copy_val v1440v1, v1086v1 + v1442v1 = const u64 6 + v1443v1 = get_elem_ptr v1068v1, __ptr u256, v1442v1, !61 + mem_copy_val v1443v1, v3726v1 + v3764v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, __tmp_arg + v3766v1 = call local_log_21(v3764v1) + v1167v1 = get_local __ptr { u64 }, __tmp_arg0, !68 + v1421v1 = const u64 0 + v1422v1 = get_elem_ptr v1167v1, __ptr u64, v1421v1, !68 + v1168v1 = const u64 1, !69 + store v1168v1 to v1422v1, !68 + v3775v1 = get_local __ptr { u64 }, __tmp_arg0 + v3777v1 = call local_log_48(v3775v1) + v1297v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg1, !70 + v1298v1 = const u64 0 + v1299v1 = get_elem_ptr v1297v1, __ptr u64, v1298v1, !70 + v1296v1 = const u64 0, !70 + store v1296v1 to v1299v1, !70 + v1301v1 = get_local __ptr { u64 }, __struct_init_2, !71 + v1418v1 = const u64 0 + v1419v1 = get_elem_ptr v1301v1, __ptr u64, v1418v1, !71 + v1302v1 = const u64 1, !72 + store v1302v1 to v1419v1, !71 + v1305v1 = const u64 1 + v1306v1 = const u64 0 + v1307v1 = get_elem_ptr v1297v1, __ptr { u64 }, v1305v1, v1306v1, !70 + mem_copy_val v1307v1, v1301v1 + v3789v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg1 + v3791v1 = call local_log_53(v3789v1) + v1312v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg2, !70 + v1313v1 = const u64 0 + v1314v1 = get_elem_ptr v1312v1, __ptr u64, v1313v1, !70 + v1311v1 = const u64 1, !70 + store v1311v1 to v1314v1, !70 + v3792v1 = get_local __ptr { u64, ( { u64 } | () ) }, __tmp_arg2 + v3794v1 = call local_log_53(v3792v1) + v3809v1 = get_local __ptr { }, __tmp_arg3 + v3811v1 = call local_log_60(v3809v1) + v1380v1 = const u64 1, !73 + ret u64 v1380v1 } fn local_log_1(item !74: u64) -> (), !78 { @@ -154,25 +154,25 @@ script { local u64 item_ entry(item: u64): - v15v1 = get_local __ptr u64, item_ - store item to v15v1 - v156v1 = get_local __ptr u64, item_, !79 - v1530v1 = get_local __ptr { __ptr u64, u64 }, __anon_0, !81 - v1444v1 = const u64 0 - v1533v1 = get_elem_ptr v1530v1, __ptr __ptr u64, v1444v1, !82 - store v156v1 to v1533v1, !83 - v1447v1 = const u64 1 - v1535v1 = get_elem_ptr v1530v1, __ptr u64, v1447v1, !84 - v25v1 = const u64 8 - store v25v1 to v1535v1, !85 - v1538v1 = get_local __ptr { __ptr u64, u64 }, __anon_0, !79 - v1540v1 = cast_ptr v1538v1 to __ptr slice, !79 - v3870v1 = get_local __ptr slice, __log_arg - mem_copy_val v3870v1, v1540v1 - v158v1 = const u64 1515152261580153489 - log __ptr slice v3870v1, v158v1 - v162v1 = const unit () - ret () v162v1 + v16v1 = get_local __ptr u64, item_ + store item to v16v1 + v157v1 = get_local __ptr u64, item_, !79 + v1531v1 = get_local __ptr { __ptr u64, u64 }, __anon_0, !81 + v1445v1 = const u64 0 + v1534v1 = get_elem_ptr v1531v1, __ptr __ptr u64, v1445v1, !82 + store v157v1 to v1534v1, !83 + v1448v1 = const u64 1 + v1536v1 = get_elem_ptr v1531v1, __ptr u64, v1448v1, !84 + v26v1 = const u64 8 + store v26v1 to v1536v1, !85 + v1539v1 = get_local __ptr { __ptr u64, u64 }, __anon_0, !79 + v1541v1 = cast_ptr v1539v1 to __ptr slice, !79 + v3871v1 = get_local __ptr slice, __log_arg + mem_copy_val v3871v1, v1541v1 + v159v1 = const u64 1515152261580153489 + log __ptr slice v3871v1, v159v1 + v163v1 = const unit () + ret () v163v1 } pub fn abi_encode_5(self !86: u64, buffer: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr { { ptr, u64, u64 } }) -> (), !89 { @@ -184,66 +184,66 @@ script { local { { ptr, u64, u64 } } buffer_ entry(self: u64, buffer: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr { { ptr, u64, u64 } }): - v43v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ - mem_copy_val v43v1, buffer - v45v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !90 - v46v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !91 - v47v1 = const u64 0 - v48v1 = get_elem_ptr v46v1, __ptr { ptr, u64, u64 }, v47v1, !92 - v3873v1 = asm(buffer: v48v1) -> __ptr { ptr, u64, u64 } buffer { + v44v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ + mem_copy_val v44v1, buffer + v46v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !90 + v47v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !91 + v48v1 = const u64 0 + v49v1 = get_elem_ptr v47v1, __ptr { ptr, u64, u64 }, v48v1, !92 + v3874v1 = asm(buffer: v49v1) -> __ptr { ptr, u64, u64 } buffer { } - v3931v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v3931v1, v3873v1 - v51v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 - mem_copy_val v51v1, v3931v1 - v53v1 = const u64 0 - v54v1 = get_elem_ptr v51v1, __ptr ptr, v53v1 - v55v1 = load v54v1 - v56v1 = const u64 1 - v57v1 = get_elem_ptr v51v1, __ptr u64, v56v1 - v58v1 = load v57v1 - v59v1 = const u64 2 - v60v1 = get_elem_ptr v51v1, __ptr u64, v59v1 - v61v1 = load v60v1 - v64v1 = const u64 8 - v67v1 = add v61v1, v64v1 - v68v1 = cmp gt v67v1 v58v1 - cbr v68v1, block1(), block0(v55v1, v58v1) - - block0(v65v1: ptr, v66v1: u64): - v76v1 = add v65v1, v61v1 - v77v1 = cast_ptr v76v1 to __ptr u64 - store self to v77v1 - v81v1 = get_local __ptr { ptr, u64, u64 }, __anon_1 - v82v1 = const u64 0 - v83v1 = get_elem_ptr v81v1, __ptr ptr, v82v1 - store v65v1 to v83v1 - v85v1 = const u64 1 - v86v1 = get_elem_ptr v81v1, __ptr u64, v85v1 - store v66v1 to v86v1 - v88v1 = const u64 2 - v89v1 = get_elem_ptr v81v1, __ptr u64, v88v1 - store v67v1 to v89v1 - v3875v1 = asm(buffer: v81v1) -> __ptr { ptr, u64, u64 } buffer { + v3932v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v3932v1, v3874v1 + v52v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 + mem_copy_val v52v1, v3932v1 + v54v1 = const u64 0 + v55v1 = get_elem_ptr v52v1, __ptr ptr, v54v1 + v56v1 = load v55v1 + v57v1 = const u64 1 + v58v1 = get_elem_ptr v52v1, __ptr u64, v57v1 + v59v1 = load v58v1 + v60v1 = const u64 2 + v61v1 = get_elem_ptr v52v1, __ptr u64, v60v1 + v62v1 = load v61v1 + v65v1 = const u64 8 + v68v1 = add v62v1, v65v1 + v69v1 = cmp gt v68v1 v59v1 + cbr v69v1, block1(), block0(v56v1, v59v1) + + block0(v66v1: ptr, v67v1: u64): + v77v1 = add v66v1, v62v1 + v78v1 = cast_ptr v77v1 to __ptr u64 + store self to v78v1 + v82v1 = get_local __ptr { ptr, u64, u64 }, __anon_1 + v83v1 = const u64 0 + v84v1 = get_elem_ptr v82v1, __ptr ptr, v83v1 + store v66v1 to v84v1 + v86v1 = const u64 1 + v87v1 = get_elem_ptr v82v1, __ptr u64, v86v1 + store v67v1 to v87v1 + v89v1 = const u64 2 + v90v1 = get_elem_ptr v82v1, __ptr u64, v89v1 + store v68v1 to v90v1 + v3876v1 = asm(buffer: v82v1) -> __ptr { ptr, u64, u64 } buffer { } - v3934v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 - mem_copy_val v3934v1, v3875v1 - v1450v1 = const u64 0 - v1451v1 = get_elem_ptr v45v1, __ptr { ptr, u64, u64 }, v1450v1, !90 - mem_copy_val v1451v1, v3934v1 - mem_copy_val __ret_value, v45v1 - v3814v1 = const unit () - ret () v3814v1 + v3935v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v3935v1, v3876v1 + v1451v1 = const u64 0 + v1452v1 = get_elem_ptr v46v1, __ptr { ptr, u64, u64 }, v1451v1, !90 + mem_copy_val v1452v1, v3935v1 + mem_copy_val __ret_value, v46v1 + v3815v1 = const unit () + ret () v3815v1 block1(): - v70v1 = const u64 2 - v71v1 = mul v58v1, v70v1 - v72v1 = add v71v1, v64v1 - v73v1 = asm(new_cap: v72v1, old_ptr: v55v1, len: v61v1) -> __ptr u8 hp { + v71v1 = const u64 2 + v72v1 = mul v59v1, v71v1 + v73v1 = add v72v1, v65v1 + v74v1 = asm(new_cap: v73v1, old_ptr: v56v1, len: v62v1) -> __ptr u8 hp { aloc new_cap mcp hp old_ptr len } - br block0(v73v1, v72v1) + br block0(v74v1, v73v1) } pub fn new_6(__ret_value: __ptr { { ptr, u64, u64 } }) -> (), !95 { @@ -252,32 +252,32 @@ script { local { { ptr, u64, u64 } } __struct_init_0 entry(__ret_value: __ptr { { ptr, u64, u64 } }): - v98v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !96 - v99v1 = const u64 1024 - v100v1 = asm(cap: v99v1) -> ptr hp { + v99v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !96 + v100v1 = const u64 1024 + v101v1 = asm(cap: v100v1) -> ptr hp { aloc cap } - v102v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 - v103v1 = const u64 0 - v104v1 = get_elem_ptr v102v1, __ptr ptr, v103v1 - store v100v1 to v104v1 - v106v1 = const u64 1 - v107v1 = get_elem_ptr v102v1, __ptr u64, v106v1 - store v99v1 to v107v1 - v109v1 = const u64 2 - v110v1 = get_elem_ptr v102v1, __ptr u64, v109v1 - v101v1 = const u64 0 - store v101v1 to v110v1 - v3877v1 = asm(buffer: v102v1) -> __ptr { ptr, u64, u64 } buffer { + v103v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 + v104v1 = const u64 0 + v105v1 = get_elem_ptr v103v1, __ptr ptr, v104v1 + store v101v1 to v105v1 + v107v1 = const u64 1 + v108v1 = get_elem_ptr v103v1, __ptr u64, v107v1 + store v100v1 to v108v1 + v110v1 = const u64 2 + v111v1 = get_elem_ptr v103v1, __ptr u64, v110v1 + v102v1 = const u64 0 + store v102v1 to v111v1 + v3878v1 = asm(buffer: v103v1) -> __ptr { ptr, u64, u64 } buffer { } - v3938v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v3938v1, v3877v1 - v1453v1 = const u64 0 - v1454v1 = get_elem_ptr v98v1, __ptr { ptr, u64, u64 }, v1453v1, !96 - mem_copy_val v1454v1, v3938v1 - mem_copy_val __ret_value, v98v1 - v3839v1 = const unit () - ret () v3839v1 + v3939v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v3939v1, v3878v1 + v1454v1 = const u64 0 + v1455v1 = get_elem_ptr v99v1, __ptr { ptr, u64, u64 }, v1454v1, !96 + mem_copy_val v1455v1, v3939v1 + mem_copy_val __ret_value, v99v1 + v3840v1 = const unit () + ret () v3840v1 } pub fn as_raw_slice_7(self: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr slice) -> (), !99 { @@ -286,105 +286,105 @@ script { local { { ptr, u64, u64 } } self_ entry(self: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr slice): - v121v1 = get_local __ptr { { ptr, u64, u64 } }, self_ - mem_copy_val v121v1, self - v123v1 = get_local __ptr { { ptr, u64, u64 } }, self_, !100 - v124v1 = const u64 0 - v125v1 = get_elem_ptr v123v1, __ptr { ptr, u64, u64 }, v124v1, !92 - v3879v1 = asm(buffer: v125v1) -> __ptr { ptr, u64, u64 } buffer { + v122v1 = get_local __ptr { { ptr, u64, u64 } }, self_ + mem_copy_val v122v1, self + v124v1 = get_local __ptr { { ptr, u64, u64 } }, self_, !100 + v125v1 = const u64 0 + v126v1 = get_elem_ptr v124v1, __ptr { ptr, u64, u64 }, v125v1, !92 + v3880v1 = asm(buffer: v126v1) -> __ptr { ptr, u64, u64 } buffer { } - v4047v1 = const u64 0 - v4048v1 = get_elem_ptr v3879v1, __ptr ptr, v4047v1 - v4049v1 = load v4048v1 - v4053v1 = const u64 2 - v4054v1 = get_elem_ptr v3879v1, __ptr u64, v4053v1 - v4055v1 = load v4054v1 - v139v1 = get_local __ptr { ptr, u64 }, __anon_1 - v140v1 = const u64 0 - v141v1 = get_elem_ptr v139v1, __ptr ptr, v140v1 - store v4049v1 to v141v1 - v143v1 = const u64 1 - v144v1 = get_elem_ptr v139v1, __ptr u64, v143v1 - store v4055v1 to v144v1 - v3881v1 = asm(s: v139v1) -> __ptr slice s { + v4048v1 = const u64 0 + v4049v1 = get_elem_ptr v3880v1, __ptr ptr, v4048v1 + v4050v1 = load v4049v1 + v4054v1 = const u64 2 + v4055v1 = get_elem_ptr v3880v1, __ptr u64, v4054v1 + v4056v1 = load v4055v1 + v140v1 = get_local __ptr { ptr, u64 }, __anon_1 + v141v1 = const u64 0 + v142v1 = get_elem_ptr v140v1, __ptr ptr, v141v1 + store v4050v1 to v142v1 + v144v1 = const u64 1 + v145v1 = get_elem_ptr v140v1, __ptr u64, v144v1 + store v4056v1 to v145v1 + v3882v1 = asm(s: v140v1) -> __ptr slice s { } - v3948v1 = get_local __ptr slice, __aggr_memcpy_00 - mem_copy_val v3948v1, v3881v1 - mem_copy_val __ret_value, v3948v1 - v3852v1 = const unit () - ret () v3852v1 + v3949v1 = get_local __ptr slice, __aggr_memcpy_00 + mem_copy_val v3949v1, v3882v1 + mem_copy_val __ret_value, v3949v1 + v3853v1 = const unit () + ret () v3853v1 } pub fn push_11(self !101: __ptr { { ptr, u64 }, u64 }, value !102: u64) -> (), !105 { entry(self: __ptr { { ptr, u64 }, u64 }, value: u64): - v208v1 = const u64 1 - v209v1 = get_elem_ptr self, __ptr u64, v208v1, !106 - v210v1 = load v209v1 - v212v1 = const u64 0 - v213v1 = get_elem_ptr self, __ptr { ptr, u64 }, v212v1, !107 - v214v1 = const u64 1 - v215v1 = get_elem_ptr v213v1, __ptr u64, v214v1, !108 - v216v1 = load v215v1 - v1680v1 = cmp eq v210v1 v216v1, !111 - cbr v1680v1, block0(), block2(), !109 + v209v1 = const u64 1 + v210v1 = get_elem_ptr self, __ptr u64, v209v1, !106 + v211v1 = load v210v1 + v213v1 = const u64 0 + v214v1 = get_elem_ptr self, __ptr { ptr, u64 }, v213v1, !107 + v215v1 = const u64 1 + v216v1 = get_elem_ptr v214v1, __ptr u64, v215v1, !108 + v217v1 = load v216v1 + v1681v1 = cmp eq v211v1 v217v1, !111 + cbr v1681v1, block0(), block2(), !109 block0(): - v1696v1 = load v215v1, !114 - v225v1 = const u64 0, !115 - v1701v1 = cmp eq v1696v1 v225v1, !118 - v227v1 = const u64 1, !119 - cbr v1701v1, grow_13_block2(v227v1), grow_13_block1(), !120 + v1697v1 = load v216v1, !114 + v226v1 = const u64 0, !115 + v1702v1 = cmp eq v1697v1 v226v1, !118 + v228v1 = const u64 1, !119 + cbr v1702v1, grow_13_block2(v228v1), grow_13_block1(), !120 grow_13_block1(): - v1706v1 = load v215v1, !114 - v240v1 = const u64 2, !121 - v1711v1 = mul v240v1, v1706v1, !124 - br grow_13_block2(v1711v1), !114 - - grow_13_block2(v1684v1: u64): - v335v1 = const u64 0 - v1717v1 = get_elem_ptr v213v1, __ptr ptr, v335v1, !126 - v1718v1 = load v1717v1, !114 - v1721v1 = load v215v1, !114 - v1732v1 = cmp gt v1684v1 v1721v1, !131 - cbr v1732v1, grow_13_realloc_15_block0(), grow_13_realloc_15_block5(v1718v1), !132 + v1707v1 = load v216v1, !114 + v241v1 = const u64 2, !121 + v1712v1 = mul v241v1, v1707v1, !124 + br grow_13_block2(v1712v1), !114 + + grow_13_block2(v1685v1: u64): + v336v1 = const u64 0 + v1718v1 = get_elem_ptr v214v1, __ptr ptr, v336v1, !126 + v1719v1 = load v1718v1, !114 + v1722v1 = load v216v1, !114 + v1733v1 = cmp gt v1685v1 v1722v1, !131 + cbr v1733v1, grow_13_realloc_15_block0(), grow_13_realloc_15_block5(v1719v1), !132 grow_13_realloc_15_block0(): - v1740v1 = alloc u64 x v1684v1, !135 - v285v1 = const u64 0, !136 - v1748v1 = cmp gt v1721v1 v285v1, !139 - cbr v1748v1, grow_13_realloc_15_block1(), grow_13_realloc_15_block5(v1740v1), !140 + v1741v1 = alloc u64 x v1685v1, !135 + v286v1 = const u64 0, !136 + v1749v1 = cmp gt v1722v1 v286v1, !139 + cbr v1749v1, grow_13_realloc_15_block1(), grow_13_realloc_15_block5(v1741v1), !140 grow_13_realloc_15_block1(): - v298v1 = const u64 8 - v1763v1 = mul v1721v1, v298v1, !146 - v1769v1 = asm(dst: v1740v1, src: v1718v1, len: v1763v1) -> (), !148 { + v299v1 = const u64 8 + v1764v1 = mul v1722v1, v299v1, !146 + v1770v1 = asm(dst: v1741v1, src: v1719v1, len: v1764v1) -> (), !148 { mcp dst src len, !149 } - br grow_13_realloc_15_block5(v1740v1), !150 + br grow_13_realloc_15_block5(v1741v1), !150 - grow_13_realloc_15_block5(v1691v1: ptr): - store v1691v1 to v1717v1, !152 - store v1684v1 to v215v1, !154 + grow_13_realloc_15_block5(v1692v1: ptr): + store v1692v1 to v1718v1, !152 + store v1685v1 to v216v1, !154 br block2() block2(): - v388v1 = const u64 0 - v389v1 = get_elem_ptr v213v1, __ptr ptr, v388v1, !125 - v390v1 = load v389v1 - v394v1 = load v209v1 - v377v1 = const u64 8 - v1787v1 = mul v377v1, v394v1, !157 - v1788v1 = add v390v1, v1787v1, !157 - v1805v1 = asm(ptr: v1788v1, val: value) -> (), !161 { + v389v1 = const u64 0 + v390v1 = get_elem_ptr v214v1, __ptr ptr, v389v1, !125 + v391v1 = load v390v1 + v395v1 = load v210v1 + v378v1 = const u64 8 + v1788v1 = mul v378v1, v395v1, !157 + v1789v1 = add v391v1, v1788v1, !157 + v1806v1 = asm(ptr: v1789v1, val: value) -> (), !161 { sw ptr val i0, !162 } - v459v1 = load v209v1 - v460v1 = const u64 1, !163 - v1822v1 = add v459v1, v460v1, !166 - store v1822v1 to v209v1, !164 - v468v1 = const unit () - ret () v468v1 + v460v1 = load v210v1 + v461v1 = const u64 1, !163 + v1823v1 = add v460v1, v461v1, !166 + store v1823v1 to v210v1, !164 + v469v1 = const unit () + ret () v469v1 } fn local_log_21(item: __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }) -> (), !167 { @@ -457,386 +457,386 @@ script { local u256 self_5 entry(item: __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }): - v483v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, item_ - mem_copy_val v483v1, item - v1059v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, item_, !79 - v2832v1 = const bool false, !174 - cbr v2832v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block4(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block5(v2832v1), !176 + v484v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, item_ + mem_copy_val v484v1, item + v1060v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, item_, !79 + v2833v1 = const bool false, !174 + cbr v2833v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block4(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block5(v2833v1), !176 encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block4(): - v521v1 = const bool false, !177 - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block5(v521v1), !178 + v522v1 = const bool false, !177 + br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block5(v522v1), !178 - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block5(v2785v1: bool): - cbr v2785v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block6(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block7(v2785v1), !180 + encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block5(v2786v1: bool): + cbr v2786v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block6(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block7(v2786v1), !180 encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block6(): - v513v1 = const bool true, !181 - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block7(v513v1), !182 + v514v1 = const bool true, !181 + br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block7(v514v1), !182 - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block7(v2788v1: bool): - cbr v2788v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block8(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v2788v1), !184 + encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block7(v2789v1: bool): + cbr v2789v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block8(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v2789v1), !184 encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block8(): - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v521v1), !185 + br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v522v1), !185 - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v2791v1: bool): - cbr v2791v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block10(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v2791v1), !187 + encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block9(v2792v1: bool): + cbr v2792v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block10(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v2792v1), !187 encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block10(): - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v521v1), !188 + br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v522v1), !188 - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v2794v1: bool): - cbr v2794v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block12(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v2794v1), !190 + encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block11(v2795v1: bool): + cbr v2795v1, encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block12(), encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v2795v1), !190 encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block12(): - br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v513v1), !191 + br encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v514v1), !191 - encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v2797v1: bool): - cbr v2797v1, encode_allow_alias_22_block0(), encode_allow_alias_22_block1(), !192 + encode_allow_alias_22_is_encode_trivial_23_is_encode_trivial_24_block13(v2798v1: bool): + cbr v2798v1, encode_allow_alias_22_block0(), encode_allow_alias_22_block1(), !192 encode_allow_alias_22_block0(): - v3241v1 = get_local __ptr { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 }, __tuple_init_0, !193 - v1468v1 = const u64 0 - v3244v1 = get_elem_ptr v3241v1, __ptr __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, v1468v1, !194 - store v1059v1 to v3244v1, !195 - v1471v1 = const u64 1 - v3246v1 = get_elem_ptr v3241v1, __ptr u64, v1471v1, !196 - v547v1 = const u64 104 - store v547v1 to v3246v1, !197 - v3249v1 = get_local __ptr { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 }, __anon_0, !79 - mem_copy_val v3249v1, v3241v1 - v3251v1 = cast_ptr v3249v1 to __ptr slice, !79 - v3770v1 = get_local __ptr slice, __tmp_block_arg - mem_copy_val v3770v1, v3251v1 - br encode_allow_alias_22_block2(v3770v1), !79 + v3242v1 = get_local __ptr { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 }, __tuple_init_0, !193 + v1469v1 = const u64 0 + v3245v1 = get_elem_ptr v3242v1, __ptr __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, v1469v1, !194 + store v1060v1 to v3245v1, !195 + v1472v1 = const u64 1 + v3247v1 = get_elem_ptr v3242v1, __ptr u64, v1472v1, !196 + v548v1 = const u64 104 + store v548v1 to v3247v1, !197 + v3250v1 = get_local __ptr { __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, u64 }, __anon_0, !79 + mem_copy_val v3250v1, v3242v1 + v3252v1 = cast_ptr v3250v1 to __ptr slice, !79 + v3771v1 = get_local __ptr slice, __tmp_block_arg + mem_copy_val v3771v1, v3252v1 + br encode_allow_alias_22_block2(v3771v1), !79 encode_allow_alias_22_block1(): - v3841v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val2 - v3842v1 = call new_6(v3841v1) - v2868v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !200 - mem_copy_val v2868v1, v1059v1 - v2870v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !201 - mem_copy_val v2870v1, v3841v1 - v2872v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !203 - v568v1 = const u64 0 - v2873v1 = get_elem_ptr v2872v1, __ptr u64, v568v1, !205 - v2874v1 = load v2873v1, !206 - v2875v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !208 - v3729v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg - mem_copy_val v3729v1, v2875v1 - v3816v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val - v3817v1 = call abi_encode_5(v2874v1, v3729v1, v3816v1) - v2878v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !210 - mem_copy_val v2878v1, v3816v1 - v2880v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !212 - v638v1 = const u64 1 - v2881v1 = get_elem_ptr v2880v1, __ptr u64, v638v1, !214 - v2883v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !216 - v2886v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !219 - mem_copy_val v2886v1, v2883v1 - v2888v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !221 - v2889v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !223 - v584v1 = const u64 0 - v2890v1 = get_elem_ptr v2889v1, __ptr { ptr, u64, u64 }, v584v1, !224 - v3886v1 = asm(buffer: v2890v1) -> __ptr { ptr, u64, u64 } buffer { + v3842v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val2 + v3843v1 = call new_6(v3842v1) + v2869v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !200 + mem_copy_val v2869v1, v1060v1 + v2871v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !201 + mem_copy_val v2871v1, v3842v1 + v2873v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !203 + v569v1 = const u64 0 + v2874v1 = get_elem_ptr v2873v1, __ptr u64, v569v1, !205 + v2875v1 = load v2874v1, !206 + v2876v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !208 + v3730v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg + mem_copy_val v3730v1, v2876v1 + v3817v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val + v3818v1 = call abi_encode_5(v2875v1, v3730v1, v3817v1) + v2879v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !210 + mem_copy_val v2879v1, v3817v1 + v2881v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !212 + v639v1 = const u64 1 + v2882v1 = get_elem_ptr v2881v1, __ptr u64, v639v1, !214 + v2884v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !216 + v2887v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !219 + mem_copy_val v2887v1, v2884v1 + v2889v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !221 + v2890v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !223 + v585v1 = const u64 0 + v2891v1 = get_elem_ptr v2890v1, __ptr { ptr, u64, u64 }, v585v1, !224 + v3887v1 = asm(buffer: v2891v1) -> __ptr { ptr, u64, u64 } buffer { } - v3959v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v3959v1, v3886v1 - v2893v1 = get_local __ptr { ptr, u64, u64 }, __anon_00, !225 - mem_copy_val v2893v1, v3959v1 - v590v1 = const u64 0 - v2895v1 = get_elem_ptr v2893v1, __ptr ptr, v590v1, !226 - v2896v1 = load v2895v1, !227 - v593v1 = const u64 1 - v2897v1 = get_elem_ptr v2893v1, __ptr u64, v593v1, !228 - v2898v1 = load v2897v1, !229 - v596v1 = const u64 2 - v2899v1 = get_elem_ptr v2893v1, __ptr u64, v596v1, !230 - v2900v1 = load v2899v1, !231 - v601v1 = const u64 4 - v2902v1 = add v2900v1, v601v1, !232 - v2903v1 = cmp gt v2902v1 v2898v1, !233 - cbr v2903v1, encode_allow_alias_22_abi_encode_37_abi_encode_38_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2896v1, v2898v1), !234 - - encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2800v1: ptr, v2801v1: u64): - v2910v1 = get_local __ptr u64, __anon_1, !235 - mem_copy_val v2910v1, v2881v1 - v615v1 = const u64 4 - v2912v1 = add v2910v1, v615v1, !236 - v2913v1 = cast_ptr v2912v1 to __ptr u8, !237 - v2914v1 = add v2800v1, v2900v1, !238 - v2915v1 = cast_ptr v2914v1 to __ptr u8, !239 - mem_copy_bytes v2915v1, v2913v1, 4, !240 - v2918v1 = get_local __ptr { ptr, u64, u64 }, __anon_2, !241 - v624v1 = const u64 0 - v2919v1 = get_elem_ptr v2918v1, __ptr ptr, v624v1, !242 - store v2800v1 to v2919v1, !243 - v627v1 = const u64 1 - v2921v1 = get_elem_ptr v2918v1, __ptr u64, v627v1, !244 - store v2801v1 to v2921v1, !245 - v630v1 = const u64 2 - v2923v1 = get_elem_ptr v2918v1, __ptr u64, v630v1, !246 - store v2902v1 to v2923v1, !247 - v3888v1 = asm(buffer: v2918v1) -> __ptr { ptr, u64, u64 } buffer { + v3960v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v3960v1, v3887v1 + v2894v1 = get_local __ptr { ptr, u64, u64 }, __anon_00, !225 + mem_copy_val v2894v1, v3960v1 + v591v1 = const u64 0 + v2896v1 = get_elem_ptr v2894v1, __ptr ptr, v591v1, !226 + v2897v1 = load v2896v1, !227 + v594v1 = const u64 1 + v2898v1 = get_elem_ptr v2894v1, __ptr u64, v594v1, !228 + v2899v1 = load v2898v1, !229 + v597v1 = const u64 2 + v2900v1 = get_elem_ptr v2894v1, __ptr u64, v597v1, !230 + v2901v1 = load v2900v1, !231 + v602v1 = const u64 4 + v2903v1 = add v2901v1, v602v1, !232 + v2904v1 = cmp gt v2903v1 v2899v1, !233 + cbr v2904v1, encode_allow_alias_22_abi_encode_37_abi_encode_38_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2897v1, v2899v1), !234 + + encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2801v1: ptr, v2802v1: u64): + v2911v1 = get_local __ptr u64, __anon_1, !235 + mem_copy_val v2911v1, v2882v1 + v616v1 = const u64 4 + v2913v1 = add v2911v1, v616v1, !236 + v2914v1 = cast_ptr v2913v1 to __ptr u8, !237 + v2915v1 = add v2801v1, v2901v1, !238 + v2916v1 = cast_ptr v2915v1 to __ptr u8, !239 + mem_copy_bytes v2916v1, v2914v1, 4, !240 + v2919v1 = get_local __ptr { ptr, u64, u64 }, __anon_2, !241 + v625v1 = const u64 0 + v2920v1 = get_elem_ptr v2919v1, __ptr ptr, v625v1, !242 + store v2801v1 to v2920v1, !243 + v628v1 = const u64 1 + v2922v1 = get_elem_ptr v2919v1, __ptr u64, v628v1, !244 + store v2802v1 to v2922v1, !245 + v631v1 = const u64 2 + v2924v1 = get_elem_ptr v2919v1, __ptr u64, v631v1, !246 + store v2903v1 to v2924v1, !247 + v3889v1 = asm(buffer: v2919v1) -> __ptr { ptr, u64, u64 } buffer { } - v3963v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 - mem_copy_val v3963v1, v3888v1 - v1474v1 = const u64 0 - v2926v1 = get_elem_ptr v2888v1, __ptr { ptr, u64, u64 }, v1474v1, !248 - mem_copy_val v2926v1, v3963v1 - v2930v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !250 - mem_copy_val v2930v1, v2888v1 - v2932v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !252 - v708v1 = const u64 2 - v2933v1 = get_elem_ptr v2932v1, __ptr u64, v708v1, !254 - v2935v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !256 - v2938v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !259 - mem_copy_val v2938v1, v2935v1 - v2940v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_00, !261 - v2941v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !263 - v654v1 = const u64 0 - v2942v1 = get_elem_ptr v2941v1, __ptr { ptr, u64, u64 }, v654v1, !264 - v3890v1 = asm(buffer: v2942v1) -> __ptr { ptr, u64, u64 } buffer { + v3964v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v3964v1, v3889v1 + v1475v1 = const u64 0 + v2927v1 = get_elem_ptr v2889v1, __ptr { ptr, u64, u64 }, v1475v1, !248 + mem_copy_val v2927v1, v3964v1 + v2931v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !250 + mem_copy_val v2931v1, v2889v1 + v2933v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !252 + v709v1 = const u64 2 + v2934v1 = get_elem_ptr v2933v1, __ptr u64, v709v1, !254 + v2936v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !256 + v2939v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !259 + mem_copy_val v2939v1, v2936v1 + v2941v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_00, !261 + v2942v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !263 + v655v1 = const u64 0 + v2943v1 = get_elem_ptr v2942v1, __ptr { ptr, u64, u64 }, v655v1, !264 + v3891v1 = asm(buffer: v2943v1) -> __ptr { ptr, u64, u64 } buffer { } - v3968v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 - mem_copy_val v3968v1, v3890v1 - v2945v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !265 - mem_copy_val v2945v1, v3968v1 - v660v1 = const u64 0 - v2947v1 = get_elem_ptr v2945v1, __ptr ptr, v660v1, !266 - v2948v1 = load v2947v1, !267 - v663v1 = const u64 1 - v2949v1 = get_elem_ptr v2945v1, __ptr u64, v663v1, !268 - v2950v1 = load v2949v1, !269 - v666v1 = const u64 2 - v2951v1 = get_elem_ptr v2945v1, __ptr u64, v666v1, !270 - v2952v1 = load v2951v1, !271 - v671v1 = const u64 2 - v2954v1 = add v2952v1, v671v1, !272 - v2955v1 = cmp gt v2954v1 v2950v1, !273 - cbr v2955v1, encode_allow_alias_22_abi_encode_37_abi_encode_39_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2948v1, v2950v1), !274 + v3969v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 + mem_copy_val v3969v1, v3891v1 + v2946v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !265 + mem_copy_val v2946v1, v3969v1 + v661v1 = const u64 0 + v2948v1 = get_elem_ptr v2946v1, __ptr ptr, v661v1, !266 + v2949v1 = load v2948v1, !267 + v664v1 = const u64 1 + v2950v1 = get_elem_ptr v2946v1, __ptr u64, v664v1, !268 + v2951v1 = load v2950v1, !269 + v667v1 = const u64 2 + v2952v1 = get_elem_ptr v2946v1, __ptr u64, v667v1, !270 + v2953v1 = load v2952v1, !271 + v672v1 = const u64 2 + v2955v1 = add v2953v1, v672v1, !272 + v2956v1 = cmp gt v2955v1 v2951v1, !273 + cbr v2956v1, encode_allow_alias_22_abi_encode_37_abi_encode_39_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2949v1, v2951v1), !274 encode_allow_alias_22_abi_encode_37_abi_encode_38_block1(): - v607v1 = const u64 2 - v2906v1 = mul v2898v1, v607v1, !275 - v2907v1 = add v2906v1, v601v1, !276 - v2908v1 = asm(new_cap: v2907v1, old_ptr: v2896v1, len: v2900v1) -> __ptr u8 hp, !277 { + v608v1 = const u64 2 + v2907v1 = mul v2899v1, v608v1, !275 + v2908v1 = add v2907v1, v602v1, !276 + v2909v1 = asm(new_cap: v2908v1, old_ptr: v2897v1, len: v2901v1) -> __ptr u8 hp, !277 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2908v1, v2907v1), !278 - - encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2803v1: ptr, v2804v1: u64): - v2962v1 = get_local __ptr u64, __anon_10, !279 - mem_copy_val v2962v1, v2933v1 - v685v1 = const u64 6 - v2964v1 = add v2962v1, v685v1, !280 - v2965v1 = cast_ptr v2964v1 to __ptr u8, !281 - v2966v1 = add v2803v1, v2952v1, !282 - v2967v1 = cast_ptr v2966v1 to __ptr u8, !283 - mem_copy_bytes v2967v1, v2965v1, 2, !284 - v2970v1 = get_local __ptr { ptr, u64, u64 }, __anon_20, !285 - v694v1 = const u64 0 - v2971v1 = get_elem_ptr v2970v1, __ptr ptr, v694v1, !286 - store v2803v1 to v2971v1, !287 - v697v1 = const u64 1 - v2973v1 = get_elem_ptr v2970v1, __ptr u64, v697v1, !288 - store v2804v1 to v2973v1, !289 - v700v1 = const u64 2 - v2975v1 = get_elem_ptr v2970v1, __ptr u64, v700v1, !290 - store v2954v1 to v2975v1, !291 - v3892v1 = asm(buffer: v2970v1) -> __ptr { ptr, u64, u64 } buffer { + br encode_allow_alias_22_abi_encode_37_abi_encode_38_block0(v2909v1, v2908v1), !278 + + encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2804v1: ptr, v2805v1: u64): + v2963v1 = get_local __ptr u64, __anon_10, !279 + mem_copy_val v2963v1, v2934v1 + v686v1 = const u64 6 + v2965v1 = add v2963v1, v686v1, !280 + v2966v1 = cast_ptr v2965v1 to __ptr u8, !281 + v2967v1 = add v2804v1, v2953v1, !282 + v2968v1 = cast_ptr v2967v1 to __ptr u8, !283 + mem_copy_bytes v2968v1, v2966v1, 2, !284 + v2971v1 = get_local __ptr { ptr, u64, u64 }, __anon_20, !285 + v695v1 = const u64 0 + v2972v1 = get_elem_ptr v2971v1, __ptr ptr, v695v1, !286 + store v2804v1 to v2972v1, !287 + v698v1 = const u64 1 + v2974v1 = get_elem_ptr v2971v1, __ptr u64, v698v1, !288 + store v2805v1 to v2974v1, !289 + v701v1 = const u64 2 + v2976v1 = get_elem_ptr v2971v1, __ptr u64, v701v1, !290 + store v2955v1 to v2976v1, !291 + v3893v1 = asm(buffer: v2971v1) -> __ptr { ptr, u64, u64 } buffer { } - v3972v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 - mem_copy_val v3972v1, v3892v1 - v1477v1 = const u64 0 - v2978v1 = get_elem_ptr v2940v1, __ptr { ptr, u64, u64 }, v1477v1, !292 - mem_copy_val v2978v1, v3972v1 - v2982v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !294 - mem_copy_val v2982v1, v2940v1 - v2984v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !296 - v773v1 = const u64 3 - v2985v1 = get_elem_ptr v2984v1, __ptr u8, v773v1, !298 - v2986v1 = load v2985v1, !299 - v2987v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !301 - v2990v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_2, !304 - mem_copy_val v2990v1, v2987v1 - v2992v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_01, !306 - v2993v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_2, !308 - v724v1 = const u64 0 - v2994v1 = get_elem_ptr v2993v1, __ptr { ptr, u64, u64 }, v724v1, !309 - v3894v1 = asm(buffer: v2994v1) -> __ptr { ptr, u64, u64 } buffer { + v3973v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 + mem_copy_val v3973v1, v3893v1 + v1478v1 = const u64 0 + v2979v1 = get_elem_ptr v2941v1, __ptr { ptr, u64, u64 }, v1478v1, !292 + mem_copy_val v2979v1, v3973v1 + v2983v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !294 + mem_copy_val v2983v1, v2941v1 + v2985v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !296 + v774v1 = const u64 3 + v2986v1 = get_elem_ptr v2985v1, __ptr u8, v774v1, !298 + v2987v1 = load v2986v1, !299 + v2988v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !301 + v2991v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_2, !304 + mem_copy_val v2991v1, v2988v1 + v2993v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_01, !306 + v2994v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_2, !308 + v725v1 = const u64 0 + v2995v1 = get_elem_ptr v2994v1, __ptr { ptr, u64, u64 }, v725v1, !309 + v3895v1 = asm(buffer: v2995v1) -> __ptr { ptr, u64, u64 } buffer { } - v3977v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_03 - mem_copy_val v3977v1, v3894v1 - v2997v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !310 - mem_copy_val v2997v1, v3977v1 - v730v1 = const u64 0 - v2999v1 = get_elem_ptr v2997v1, __ptr ptr, v730v1, !311 - v3000v1 = load v2999v1, !312 - v733v1 = const u64 1 - v3001v1 = get_elem_ptr v2997v1, __ptr u64, v733v1, !313 - v3002v1 = load v3001v1, !314 - v736v1 = const u64 2 - v3003v1 = get_elem_ptr v2997v1, __ptr u64, v736v1, !315 - v3004v1 = load v3003v1, !316 - v741v1 = const u64 1 - v3006v1 = add v3004v1, v741v1, !317 - v3007v1 = cmp gt v3006v1 v3002v1, !318 - cbr v3007v1, encode_allow_alias_22_abi_encode_37_abi_encode_40_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v3000v1, v3002v1), !319 + v3978v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_03 + mem_copy_val v3978v1, v3895v1 + v2998v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !310 + mem_copy_val v2998v1, v3978v1 + v731v1 = const u64 0 + v3000v1 = get_elem_ptr v2998v1, __ptr ptr, v731v1, !311 + v3001v1 = load v3000v1, !312 + v734v1 = const u64 1 + v3002v1 = get_elem_ptr v2998v1, __ptr u64, v734v1, !313 + v3003v1 = load v3002v1, !314 + v737v1 = const u64 2 + v3004v1 = get_elem_ptr v2998v1, __ptr u64, v737v1, !315 + v3005v1 = load v3004v1, !316 + v742v1 = const u64 1 + v3007v1 = add v3005v1, v742v1, !317 + v3008v1 = cmp gt v3007v1 v3003v1, !318 + cbr v3008v1, encode_allow_alias_22_abi_encode_37_abi_encode_40_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v3001v1, v3003v1), !319 encode_allow_alias_22_abi_encode_37_abi_encode_39_block1(): - v677v1 = const u64 2 - v2958v1 = mul v2950v1, v677v1, !320 - v2959v1 = add v2958v1, v671v1, !321 - v2960v1 = asm(new_cap: v2959v1, old_ptr: v2948v1, len: v2952v1) -> __ptr u8 hp, !322 { + v678v1 = const u64 2 + v2959v1 = mul v2951v1, v678v1, !320 + v2960v1 = add v2959v1, v672v1, !321 + v2961v1 = asm(new_cap: v2960v1, old_ptr: v2949v1, len: v2953v1) -> __ptr u8 hp, !322 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2960v1, v2959v1), !323 - - encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v2806v1: ptr, v2807v1: u64): - v3014v1 = add v2806v1, v3004v1, !324 - v3015v1 = cast_ptr v3014v1 to __ptr u8, !325 - store v2986v1 to v3015v1, !326 - v3018v1 = get_local __ptr { ptr, u64, u64 }, __anon_11, !327 - v759v1 = const u64 0 - v3019v1 = get_elem_ptr v3018v1, __ptr ptr, v759v1, !328 - store v2806v1 to v3019v1, !329 - v762v1 = const u64 1 - v3021v1 = get_elem_ptr v3018v1, __ptr u64, v762v1, !330 - store v2807v1 to v3021v1, !331 - v765v1 = const u64 2 - v3023v1 = get_elem_ptr v3018v1, __ptr u64, v765v1, !332 - store v3006v1 to v3023v1, !333 - v3896v1 = asm(buffer: v3018v1) -> __ptr { ptr, u64, u64 } buffer { + br encode_allow_alias_22_abi_encode_37_abi_encode_39_block0(v2961v1, v2960v1), !323 + + encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v2807v1: ptr, v2808v1: u64): + v3015v1 = add v2807v1, v3005v1, !324 + v3016v1 = cast_ptr v3015v1 to __ptr u8, !325 + store v2987v1 to v3016v1, !326 + v3019v1 = get_local __ptr { ptr, u64, u64 }, __anon_11, !327 + v760v1 = const u64 0 + v3020v1 = get_elem_ptr v3019v1, __ptr ptr, v760v1, !328 + store v2807v1 to v3020v1, !329 + v763v1 = const u64 1 + v3022v1 = get_elem_ptr v3019v1, __ptr u64, v763v1, !330 + store v2808v1 to v3022v1, !331 + v766v1 = const u64 2 + v3024v1 = get_elem_ptr v3019v1, __ptr u64, v766v1, !332 + store v3007v1 to v3024v1, !333 + v3897v1 = asm(buffer: v3019v1) -> __ptr { ptr, u64, u64 } buffer { } - v3980v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_04 - mem_copy_val v3980v1, v3896v1 - v1480v1 = const u64 0 - v3026v1 = get_elem_ptr v2992v1, __ptr { ptr, u64, u64 }, v1480v1, !334 - mem_copy_val v3026v1, v3980v1 - v3030v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !336 - mem_copy_val v3030v1, v2992v1 - v3032v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !338 - v894v1 = const u64 4 - v3033v1 = get_elem_ptr v3032v1, __ptr { { ptr, u64 }, u64 }, v894v1, !340 - v3035v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !342 - v3037v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !345 - mem_copy_val v3037v1, v3033v1 - v3039v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_3, !346 - mem_copy_val v3039v1, v3035v1 - v3041v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !348 - v788v1 = const u64 1 - v3042v1 = get_elem_ptr v3041v1, __ptr u64, v788v1, !349 - v3043v1 = load v3042v1, !350 - v3046v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_3, !352 - v3732v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg0 - mem_copy_val v3732v1, v3046v1 - v3819v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val0 - v3820v1 = call abi_encode_5(v3043v1, v3732v1, v3819v1) - v3049v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !354 - mem_copy_val v3049v1, v3819v1 - v800v1 = const u64 0, !355 - br encode_allow_alias_22_abi_encode_37_abi_encode_41_while(v800v1), !356 + v3981v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_04 + mem_copy_val v3981v1, v3897v1 + v1481v1 = const u64 0 + v3027v1 = get_elem_ptr v2993v1, __ptr { ptr, u64, u64 }, v1481v1, !334 + mem_copy_val v3027v1, v3981v1 + v3031v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !336 + mem_copy_val v3031v1, v2993v1 + v3033v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !338 + v895v1 = const u64 4 + v3034v1 = get_elem_ptr v3033v1, __ptr { { ptr, u64 }, u64 }, v895v1, !340 + v3036v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !342 + v3038v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !345 + mem_copy_val v3038v1, v3034v1 + v3040v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_3, !346 + mem_copy_val v3040v1, v3036v1 + v3042v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !348 + v789v1 = const u64 1 + v3043v1 = get_elem_ptr v3042v1, __ptr u64, v789v1, !349 + v3044v1 = load v3043v1, !350 + v3047v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_3, !352 + v3733v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg0 + mem_copy_val v3733v1, v3047v1 + v3820v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val0 + v3821v1 = call abi_encode_5(v3044v1, v3733v1, v3820v1) + v3050v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !354 + mem_copy_val v3050v1, v3820v1 + v801v1 = const u64 0, !355 + br encode_allow_alias_22_abi_encode_37_abi_encode_41_while(v801v1), !356 encode_allow_alias_22_abi_encode_37_abi_encode_40_block1(): - v747v1 = const u64 2 - v3010v1 = mul v3002v1, v747v1, !357 - v3011v1 = add v3010v1, v741v1, !358 - v3012v1 = asm(new_cap: v3011v1, old_ptr: v3000v1, len: v3004v1) -> __ptr u8 hp, !359 { + v748v1 = const u64 2 + v3011v1 = mul v3003v1, v748v1, !357 + v3012v1 = add v3011v1, v742v1, !358 + v3013v1 = asm(new_cap: v3012v1, old_ptr: v3001v1, len: v3005v1) -> __ptr u8 hp, !359 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v3012v1, v3011v1), !360 + br encode_allow_alias_22_abi_encode_37_abi_encode_40_block0(v3013v1, v3012v1), !360 - encode_allow_alias_22_abi_encode_37_abi_encode_41_while(v2809v1: u64): - v3059v1 = cmp lt v2809v1 v3043v1, !363 - cbr v3059v1, encode_allow_alias_22_abi_encode_37_abi_encode_41_while_body(), encode_allow_alias_22_abi_encode_37_abi_encode_41_end_while(), !364 + encode_allow_alias_22_abi_encode_37_abi_encode_41_while(v2810v1: u64): + v3060v1 = cmp lt v2810v1 v3044v1, !363 + cbr v3060v1, encode_allow_alias_22_abi_encode_37_abi_encode_41_while_body(), encode_allow_alias_22_abi_encode_37_abi_encode_41_end_while(), !364 encode_allow_alias_22_abi_encode_37_abi_encode_41_while_body(): - v3185v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !366 - v3188v1 = get_local __ptr { { ptr, u64 }, u64 }, self_10, !369 - mem_copy_val v3188v1, v3185v1 - v3191v1 = get_local __ptr { { ptr, u64 }, u64 }, self_10, !371 - v853v1 = const u64 0 - v3192v1 = get_elem_ptr v3191v1, __ptr { ptr, u64 }, v853v1, !372 - v855v1 = const u64 0 - v3193v1 = get_elem_ptr v3192v1, __ptr ptr, v855v1, !373 - v3194v1 = load v3193v1, !374 - v377v1 = const u64 8 - v3200v1 = mul v377v1, v2809v1, !377 - v3201v1 = add v3194v1, v3200v1, !378 - v3213v1 = asm(ptr: v3201v1, val) -> u64 val, !382 { + v3186v1 = get_local __ptr { { ptr, u64 }, u64 }, self_3, !366 + v3189v1 = get_local __ptr { { ptr, u64 }, u64 }, self_10, !369 + mem_copy_val v3189v1, v3186v1 + v3192v1 = get_local __ptr { { ptr, u64 }, u64 }, self_10, !371 + v854v1 = const u64 0 + v3193v1 = get_elem_ptr v3192v1, __ptr { ptr, u64 }, v854v1, !372 + v856v1 = const u64 0 + v3194v1 = get_elem_ptr v3193v1, __ptr ptr, v856v1, !373 + v3195v1 = load v3194v1, !374 + v378v1 = const u64 8 + v3201v1 = mul v378v1, v2810v1, !377 + v3202v1 = add v3195v1, v3201v1, !378 + v3214v1 = asm(ptr: v3202v1, val) -> u64 val, !382 { lw val ptr i0, !383 } - v3226v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !385 - v3735v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg1 - mem_copy_val v3735v1, v3226v1 - v3822v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val1 - v3823v1 = call abi_encode_5(v3213v1, v3735v1, v3822v1) - v3229v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !387 - mem_copy_val v3229v1, v3822v1 - v880v1 = const u64 1, !388 - v3236v1 = add v2809v1, v880v1, !391 - br encode_allow_alias_22_abi_encode_37_abi_encode_41_while(v3236v1), !392 + v3227v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !385 + v3736v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg1 + mem_copy_val v3736v1, v3227v1 + v3823v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val1 + v3824v1 = call abi_encode_5(v3214v1, v3736v1, v3823v1) + v3230v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !387 + mem_copy_val v3230v1, v3823v1 + v881v1 = const u64 1, !388 + v3237v1 = add v2810v1, v881v1, !391 + br encode_allow_alias_22_abi_encode_37_abi_encode_41_while(v3237v1), !392 encode_allow_alias_22_abi_encode_37_abi_encode_41_end_while(): - v3062v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !394 - v3065v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !396 - mem_copy_val v3065v1, v3062v1 - v3067v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !398 - v966v1 = const u64 5 - v3068v1 = get_elem_ptr v3067v1, __ptr slice, v966v1, !400 - v3070v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !402 - v3072v1 = get_local __ptr slice, self_4, !405 - mem_copy_val v3072v1, v3068v1 - v3074v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_4, !406 - mem_copy_val v3074v1, v3070v1 - v3076v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_02, !408 - v3077v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_4, !410 - v910v1 = const u64 0 - v3078v1 = get_elem_ptr v3077v1, __ptr { ptr, u64, u64 }, v910v1, !411 - v3898v1 = asm(buffer: v3078v1) -> __ptr { ptr, u64, u64 } buffer { + v3063v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !394 + v3066v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !396 + mem_copy_val v3066v1, v3063v1 + v3068v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !398 + v967v1 = const u64 5 + v3069v1 = get_elem_ptr v3068v1, __ptr slice, v967v1, !400 + v3071v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !402 + v3073v1 = get_local __ptr slice, self_4, !405 + mem_copy_val v3073v1, v3069v1 + v3075v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_4, !406 + mem_copy_val v3075v1, v3071v1 + v3077v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_02, !408 + v3078v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_4, !410 + v911v1 = const u64 0 + v3079v1 = get_elem_ptr v3078v1, __ptr { ptr, u64, u64 }, v911v1, !411 + v3899v1 = asm(buffer: v3079v1) -> __ptr { ptr, u64, u64 } buffer { } - v3994v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_05 - mem_copy_val v3994v1, v3898v1 - v3081v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !412 - mem_copy_val v3081v1, v3994v1 - v916v1 = const u64 0 - v3083v1 = get_elem_ptr v3081v1, __ptr ptr, v916v1, !413 - v3084v1 = load v3083v1, !414 - v919v1 = const u64 1 - v3085v1 = get_elem_ptr v3081v1, __ptr u64, v919v1, !415 - v3086v1 = load v3085v1, !416 - v922v1 = const u64 2 - v3087v1 = get_elem_ptr v3081v1, __ptr u64, v922v1, !417 - v3088v1 = load v3087v1, !418 - v3089v1 = get_local __ptr slice, self_4, !420 - v4000v1 = get_local __ptr slice, __aggr_memcpy_07 - mem_copy_val v4000v1, v3089v1 - v3900v1 = asm(item: v3089v1) -> __ptr { u64, u64 } item { + v3995v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_05 + mem_copy_val v3995v1, v3899v1 + v3082v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !412 + mem_copy_val v3082v1, v3995v1 + v917v1 = const u64 0 + v3084v1 = get_elem_ptr v3082v1, __ptr ptr, v917v1, !413 + v3085v1 = load v3084v1, !414 + v920v1 = const u64 1 + v3086v1 = get_elem_ptr v3082v1, __ptr u64, v920v1, !415 + v3087v1 = load v3086v1, !416 + v923v1 = const u64 2 + v3088v1 = get_elem_ptr v3082v1, __ptr u64, v923v1, !417 + v3089v1 = load v3088v1, !418 + v3090v1 = get_local __ptr slice, self_4, !420 + v4001v1 = get_local __ptr slice, __aggr_memcpy_07 + mem_copy_val v4001v1, v3090v1 + v3901v1 = asm(item: v3090v1) -> __ptr { u64, u64 } item { } - v3997v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_06 - mem_copy_val v3997v1, v3900v1 - v3092v1 = get_local __ptr { u64, u64 }, __anon_12, !421 - mem_copy_val v3092v1, v3997v1 - v930v1 = const u64 1 - v3094v1 = get_elem_ptr v3092v1, __ptr u64, v930v1, !422 - v3095v1 = load v3094v1, !423 - v933v1 = const u64 8 - v3096v1 = add v3095v1, v933v1, !424 - v3097v1 = add v3088v1, v3096v1, !425 - v3098v1 = cmp gt v3097v1 v3086v1, !426 - cbr v3098v1, encode_allow_alias_22_abi_encode_37_abi_encode_45_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_45_block0(v3084v1, v3086v1), !427 - - encode_allow_alias_22_abi_encode_37_abi_encode_45_block0(v2819v1: ptr, v2820v1: u64): - v3105v1 = get_local __ptr slice, __anon_21, !428 - mem_copy_val v3105v1, v4000v1 - v3107v1 = add v2819v1, v3088v1, !429 - v3108v1 = cast_ptr v3107v1 to __ptr u8, !430 - v3109v1 = asm(item_ptr: v3105v1, len: v3088v1, addr: v3108v1, data_ptr, item_len, new_len) -> u64 new_len, !431 { + v3998v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_06 + mem_copy_val v3998v1, v3901v1 + v3093v1 = get_local __ptr { u64, u64 }, __anon_12, !421 + mem_copy_val v3093v1, v3998v1 + v931v1 = const u64 1 + v3095v1 = get_elem_ptr v3093v1, __ptr u64, v931v1, !422 + v3096v1 = load v3095v1, !423 + v934v1 = const u64 8 + v3097v1 = add v3096v1, v934v1, !424 + v3098v1 = add v3089v1, v3097v1, !425 + v3099v1 = cmp gt v3098v1 v3087v1, !426 + cbr v3099v1, encode_allow_alias_22_abi_encode_37_abi_encode_45_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_45_block0(v3085v1, v3087v1), !427 + + encode_allow_alias_22_abi_encode_37_abi_encode_45_block0(v2820v1: ptr, v2821v1: u64): + v3106v1 = get_local __ptr slice, __anon_21, !428 + mem_copy_val v3106v1, v4001v1 + v3108v1 = add v2820v1, v3089v1, !429 + v3109v1 = cast_ptr v3108v1 to __ptr u8, !430 + v3110v1 = asm(item_ptr: v3106v1, len: v3089v1, addr: v3109v1, data_ptr, item_len, new_len) -> u64 new_len, !431 { lw item_len item_ptr i1 sw addr item_len i0 addi addr addr i8 @@ -845,122 +845,122 @@ script { addi new_len len i8 add new_len new_len item_len } - v3110v1 = get_local __ptr { ptr, u64, u64 }, __anon_3, !432 - v952v1 = const u64 0 - v3111v1 = get_elem_ptr v3110v1, __ptr ptr, v952v1, !433 - store v2819v1 to v3111v1, !434 - v955v1 = const u64 1 - v3113v1 = get_elem_ptr v3110v1, __ptr u64, v955v1, !435 - store v2820v1 to v3113v1, !436 - v958v1 = const u64 2 - v3115v1 = get_elem_ptr v3110v1, __ptr u64, v958v1, !437 - store v3109v1 to v3115v1, !438 - v3902v1 = asm(buffer: v3110v1) -> __ptr { ptr, u64, u64 } buffer { + v3111v1 = get_local __ptr { ptr, u64, u64 }, __anon_3, !432 + v953v1 = const u64 0 + v3112v1 = get_elem_ptr v3111v1, __ptr ptr, v953v1, !433 + store v2820v1 to v3112v1, !434 + v956v1 = const u64 1 + v3114v1 = get_elem_ptr v3111v1, __ptr u64, v956v1, !435 + store v2821v1 to v3114v1, !436 + v959v1 = const u64 2 + v3116v1 = get_elem_ptr v3111v1, __ptr u64, v959v1, !437 + store v3110v1 to v3116v1, !438 + v3903v1 = asm(buffer: v3111v1) -> __ptr { ptr, u64, u64 } buffer { } - v4003v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_08 - mem_copy_val v4003v1, v3902v1 - v1483v1 = const u64 0 - v3118v1 = get_elem_ptr v3076v1, __ptr { ptr, u64, u64 }, v1483v1, !439 - mem_copy_val v3118v1, v4003v1 - v3122v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !441 - mem_copy_val v3122v1, v3076v1 - v3124v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !443 - v1033v1 = const u64 6 - v3125v1 = get_elem_ptr v3124v1, __ptr u256, v1033v1, !445 - v3127v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !447 - v3129v1 = get_local __ptr u256, self_5, !450 - mem_copy_val v3129v1, v3125v1 - v3131v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_5, !451 - mem_copy_val v3131v1, v3127v1 - v3133v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_03, !453 - v3134v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_5, !455 - v982v1 = const u64 0 - v3135v1 = get_elem_ptr v3134v1, __ptr { ptr, u64, u64 }, v982v1, !456 - v3904v1 = asm(buffer: v3135v1) -> __ptr { ptr, u64, u64 } buffer { + v4004v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_08 + mem_copy_val v4004v1, v3903v1 + v1484v1 = const u64 0 + v3119v1 = get_elem_ptr v3077v1, __ptr { ptr, u64, u64 }, v1484v1, !439 + mem_copy_val v3119v1, v4004v1 + v3123v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !441 + mem_copy_val v3123v1, v3077v1 + v3125v1 = get_local __ptr { u64, u64, u64, u8, { { ptr, u64 }, u64 }, slice, u256 }, self_0, !443 + v1034v1 = const u64 6 + v3126v1 = get_elem_ptr v3125v1, __ptr u256, v1034v1, !445 + v3128v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_______, !447 + v3130v1 = get_local __ptr u256, self_5, !450 + mem_copy_val v3130v1, v3126v1 + v3132v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_5, !451 + mem_copy_val v3132v1, v3128v1 + v3134v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_03, !453 + v3135v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_5, !455 + v983v1 = const u64 0 + v3136v1 = get_elem_ptr v3135v1, __ptr { ptr, u64, u64 }, v983v1, !456 + v3905v1 = asm(buffer: v3136v1) -> __ptr { ptr, u64, u64 } buffer { } - v4009v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_09 - mem_copy_val v4009v1, v3904v1 - v3138v1 = get_local __ptr { ptr, u64, u64 }, __anon_03, !457 - mem_copy_val v3138v1, v4009v1 - v988v1 = const u64 0 - v3140v1 = get_elem_ptr v3138v1, __ptr ptr, v988v1, !458 - v3141v1 = load v3140v1, !459 - v991v1 = const u64 1 - v3142v1 = get_elem_ptr v3138v1, __ptr u64, v991v1, !460 - v3143v1 = load v3142v1, !461 - v994v1 = const u64 2 - v3144v1 = get_elem_ptr v3138v1, __ptr u64, v994v1, !462 - v3145v1 = load v3144v1, !463 - v3146v1 = get_local __ptr u256, self_5, !465 - v999v1 = const u64 32 - v3148v1 = add v3145v1, v999v1, !466 - v3149v1 = cmp gt v3148v1 v3143v1, !467 - cbr v3149v1, encode_allow_alias_22_abi_encode_37_abi_encode_46_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_46_block0(v3141v1, v3143v1), !468 + v4010v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_09 + mem_copy_val v4010v1, v3905v1 + v3139v1 = get_local __ptr { ptr, u64, u64 }, __anon_03, !457 + mem_copy_val v3139v1, v4010v1 + v989v1 = const u64 0 + v3141v1 = get_elem_ptr v3139v1, __ptr ptr, v989v1, !458 + v3142v1 = load v3141v1, !459 + v992v1 = const u64 1 + v3143v1 = get_elem_ptr v3139v1, __ptr u64, v992v1, !460 + v3144v1 = load v3143v1, !461 + v995v1 = const u64 2 + v3145v1 = get_elem_ptr v3139v1, __ptr u64, v995v1, !462 + v3146v1 = load v3145v1, !463 + v3147v1 = get_local __ptr u256, self_5, !465 + v1000v1 = const u64 32 + v3149v1 = add v3146v1, v1000v1, !466 + v3150v1 = cmp gt v3149v1 v3144v1, !467 + cbr v3150v1, encode_allow_alias_22_abi_encode_37_abi_encode_46_block1(), encode_allow_alias_22_abi_encode_37_abi_encode_46_block0(v3142v1, v3144v1), !468 encode_allow_alias_22_abi_encode_37_abi_encode_45_block1(): - v940v1 = const u64 2 - v3101v1 = mul v3086v1, v940v1, !469 - v3102v1 = add v3101v1, v3096v1, !470 - v3103v1 = asm(new_cap: v3102v1, old_ptr: v3084v1, len: v3088v1) -> __ptr u8 hp, !471 { + v941v1 = const u64 2 + v3102v1 = mul v3087v1, v941v1, !469 + v3103v1 = add v3102v1, v3097v1, !470 + v3104v1 = asm(new_cap: v3103v1, old_ptr: v3085v1, len: v3089v1) -> __ptr u8 hp, !471 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_45_block0(v3103v1, v3102v1), !472 - - encode_allow_alias_22_abi_encode_37_abi_encode_46_block0(v2822v1: ptr, v2823v1: u64): - v3156v1 = get_local __ptr u256, __anon_13, !473 - mem_copy_val v3156v1, v3146v1 - v3158v1 = add v2822v1, v3145v1, !474 - v3159v1 = cast_ptr v3158v1 to __ptr u8, !475 - mem_copy_bytes v3159v1, v3156v1, 32, !476 - v3162v1 = get_local __ptr { ptr, u64, u64 }, __anon_22, !477 - v1019v1 = const u64 0 - v3163v1 = get_elem_ptr v3162v1, __ptr ptr, v1019v1, !478 - store v2822v1 to v3163v1, !479 - v1022v1 = const u64 1 - v3165v1 = get_elem_ptr v3162v1, __ptr u64, v1022v1, !480 - store v2823v1 to v3165v1, !481 - v1025v1 = const u64 2 - v3167v1 = get_elem_ptr v3162v1, __ptr u64, v1025v1, !482 - store v3148v1 to v3167v1, !483 - v3906v1 = asm(buffer: v3162v1) -> __ptr { ptr, u64, u64 } buffer { + br encode_allow_alias_22_abi_encode_37_abi_encode_45_block0(v3104v1, v3103v1), !472 + + encode_allow_alias_22_abi_encode_37_abi_encode_46_block0(v2823v1: ptr, v2824v1: u64): + v3157v1 = get_local __ptr u256, __anon_13, !473 + mem_copy_val v3157v1, v3147v1 + v3159v1 = add v2823v1, v3146v1, !474 + v3160v1 = cast_ptr v3159v1 to __ptr u8, !475 + mem_copy_bytes v3160v1, v3157v1, 32, !476 + v3163v1 = get_local __ptr { ptr, u64, u64 }, __anon_22, !477 + v1020v1 = const u64 0 + v3164v1 = get_elem_ptr v3163v1, __ptr ptr, v1020v1, !478 + store v2823v1 to v3164v1, !479 + v1023v1 = const u64 1 + v3166v1 = get_elem_ptr v3163v1, __ptr u64, v1023v1, !480 + store v2824v1 to v3166v1, !481 + v1026v1 = const u64 2 + v3168v1 = get_elem_ptr v3163v1, __ptr u64, v1026v1, !482 + store v3149v1 to v3168v1, !483 + v3907v1 = asm(buffer: v3163v1) -> __ptr { ptr, u64, u64 } buffer { } - v4013v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_010 - mem_copy_val v4013v1, v3906v1 - v1486v1 = const u64 0 - v3170v1 = get_elem_ptr v3133v1, __ptr { ptr, u64, u64 }, v1486v1, !484 - mem_copy_val v3170v1, v4013v1 - v3174v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !486 - mem_copy_val v3174v1, v3133v1 - v3176v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !488 - v3179v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !490 - mem_copy_val v3179v1, v3176v1 - v3181v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !492 - v3752v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg2 - mem_copy_val v3752v1, v3181v1 - v3854v1 = get_local __ptr slice, __ret_val3 - v3855v1 = call as_raw_slice_7(v3752v1, v3854v1) - v3768v1 = get_local __ptr slice, __tmp_block_arg - mem_copy_val v3768v1, v3854v1 - br encode_allow_alias_22_block2(v3768v1), !79 + v4014v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_010 + mem_copy_val v4014v1, v3907v1 + v1487v1 = const u64 0 + v3171v1 = get_elem_ptr v3134v1, __ptr { ptr, u64, u64 }, v1487v1, !484 + mem_copy_val v3171v1, v4014v1 + v3175v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !486 + mem_copy_val v3175v1, v3134v1 + v3177v1 = get_local __ptr { { ptr, u64, u64 } }, buffer________, !488 + v3180v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !490 + mem_copy_val v3180v1, v3177v1 + v3182v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !492 + v3753v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg2 + mem_copy_val v3753v1, v3182v1 + v3855v1 = get_local __ptr slice, __ret_val3 + v3856v1 = call as_raw_slice_7(v3753v1, v3855v1) + v3769v1 = get_local __ptr slice, __tmp_block_arg + mem_copy_val v3769v1, v3855v1 + br encode_allow_alias_22_block2(v3769v1), !79 encode_allow_alias_22_abi_encode_37_abi_encode_46_block1(): - v1005v1 = const u64 2 - v3152v1 = mul v3143v1, v1005v1, !493 - v3153v1 = add v3152v1, v999v1, !494 - v3154v1 = asm(new_cap: v3153v1, old_ptr: v3141v1, len: v3145v1) -> __ptr u8 hp, !495 { + v1006v1 = const u64 2 + v3153v1 = mul v3144v1, v1006v1, !493 + v3154v1 = add v3153v1, v1000v1, !494 + v3155v1 = asm(new_cap: v3154v1, old_ptr: v3142v1, len: v3146v1) -> __ptr u8 hp, !495 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_22_abi_encode_37_abi_encode_46_block0(v3154v1, v3153v1), !496 - - encode_allow_alias_22_block2(v3766v1: __ptr slice): - v3883v1 = get_local __ptr slice, __log_arg - mem_copy_val v3883v1, v3766v1 - v1061v1 = const u64 4579537983717831593 - log __ptr slice v3883v1, v1061v1 - v1065v1 = const unit () - ret () v1065v1 + br encode_allow_alias_22_abi_encode_37_abi_encode_46_block0(v3155v1, v3154v1), !496 + + encode_allow_alias_22_block2(v3767v1: __ptr slice): + v3884v1 = get_local __ptr slice, __log_arg + mem_copy_val v3884v1, v3767v1 + v1062v1 = const u64 4579537983717831593 + log __ptr slice v3884v1, v1062v1 + v1066v1 = const unit () + ret () v1066v1 } fn local_log_48(item: __ptr { u64 }) -> (), !497 { @@ -969,35 +969,35 @@ script { local { u64 } item_ entry(item: __ptr { u64 }): - v1095v1 = get_local __ptr { u64 }, item_ - mem_copy_val v1095v1, item - v1158v1 = get_local __ptr { u64 }, item_, !79 - v3328v1 = get_local __ptr { __ptr { u64 }, u64 }, __anon_0, !498 - v1489v1 = const u64 0 - v3331v1 = get_elem_ptr v3328v1, __ptr __ptr { u64 }, v1489v1, !499 - store v1158v1 to v3331v1, !500 - v1492v1 = const u64 1 - v3333v1 = get_elem_ptr v3328v1, __ptr u64, v1492v1, !501 - v1111v1 = const u64 8 - store v1111v1 to v3333v1, !502 - v3336v1 = get_local __ptr { __ptr { u64 }, u64 }, __anon_0, !79 - v3338v1 = cast_ptr v3336v1 to __ptr slice, !79 - v3908v1 = get_local __ptr slice, __log_arg - mem_copy_val v3908v1, v3338v1 - v1160v1 = const u64 16566583104751091389 - log __ptr slice v3908v1, v1160v1 - v1164v1 = const unit () - ret () v1164v1 + v1096v1 = get_local __ptr { u64 }, item_ + mem_copy_val v1096v1, item + v1159v1 = get_local __ptr { u64 }, item_, !79 + v3329v1 = get_local __ptr { __ptr { u64 }, u64 }, __anon_0, !498 + v1490v1 = const u64 0 + v3332v1 = get_elem_ptr v3329v1, __ptr __ptr { u64 }, v1490v1, !499 + store v1159v1 to v3332v1, !500 + v1493v1 = const u64 1 + v3334v1 = get_elem_ptr v3329v1, __ptr u64, v1493v1, !501 + v1112v1 = const u64 8 + store v1112v1 to v3334v1, !502 + v3337v1 = get_local __ptr { __ptr { u64 }, u64 }, __anon_0, !79 + v3339v1 = cast_ptr v3337v1 to __ptr slice, !79 + v3909v1 = get_local __ptr slice, __log_arg + mem_copy_val v3909v1, v3339v1 + v1161v1 = const u64 16566583104751091389 + log __ptr slice v3909v1, v1161v1 + v1165v1 = const unit () + ret () v1165v1 } pub fn abi_encode_52(self: __ptr { u64 }, buffer: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr { { ptr, u64, u64 } }) -> (), !505 { entry(self: __ptr { u64 }, buffer: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr { { ptr, u64, u64 } }): - v1132v1 = const u64 0 - v1133v1 = get_elem_ptr self, __ptr u64, v1132v1, !506 - v1134v1 = load v1133v1 - v3826v1 = call abi_encode_5(v1134v1, buffer, __ret_value) - v3865v1 = const unit () - ret () v3865v1 + v1133v1 = const u64 0 + v1134v1 = get_elem_ptr self, __ptr u64, v1133v1, !506 + v1135v1 = load v1134v1 + v3827v1 = call abi_encode_5(v1135v1, buffer, __ret_value) + v3866v1 = const unit () + ret () v3866v1 } fn local_log_53(item: __ptr { u64, ( { u64 } | () ) }) -> (), !507 { @@ -1009,85 +1009,85 @@ script { local { { ptr, u64, u64 } } buffer__ entry(item: __ptr { u64, ( { u64 } | () ) }): - v1172v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1 - mem_copy_val v1172v1, item - v1287v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1, !79 - v3541v1 = const bool false, !508 - cbr v3541v1, encode_allow_alias_54_block0(), encode_allow_alias_54_block1(), !509 + v1173v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1 + mem_copy_val v1173v1, item + v1288v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1, !79 + v3542v1 = const bool false, !508 + cbr v3542v1, encode_allow_alias_54_block0(), encode_allow_alias_54_block1(), !509 encode_allow_alias_54_block0(): - v3633v1 = get_local __ptr { __ptr { u64, ( { u64 } | () ) }, u64 }, __anon_0, !510 - v1495v1 = const u64 0 - v3636v1 = get_elem_ptr v3633v1, __ptr __ptr { u64, ( { u64 } | () ) }, v1495v1, !511 - store v1287v1 to v3636v1, !512 - v1498v1 = const u64 1 - v3638v1 = get_elem_ptr v3633v1, __ptr u64, v1498v1, !513 - v1196v1 = const u64 16 - store v1196v1 to v3638v1, !514 - v3641v1 = get_local __ptr { __ptr { u64, ( { u64 } | () ) }, u64 }, __anon_0, !79 - v3643v1 = cast_ptr v3641v1 to __ptr slice, !79 - v3802v1 = get_local __ptr slice, __log_arg - mem_copy_val v3802v1, v3643v1 + v3634v1 = get_local __ptr { __ptr { u64, ( { u64 } | () ) }, u64 }, __anon_0, !510 + v1496v1 = const u64 0 + v3637v1 = get_elem_ptr v3634v1, __ptr __ptr { u64, ( { u64 } | () ) }, v1496v1, !511 + store v1288v1 to v3637v1, !512 + v1499v1 = const u64 1 + v3639v1 = get_elem_ptr v3634v1, __ptr u64, v1499v1, !513 + v1197v1 = const u64 16 + store v1197v1 to v3639v1, !514 + v3642v1 = get_local __ptr { __ptr { u64, ( { u64 } | () ) }, u64 }, __anon_0, !79 + v3644v1 = cast_ptr v3642v1 to __ptr slice, !79 + v3803v1 = get_local __ptr slice, __log_arg + mem_copy_val v3803v1, v3644v1 br encode_allow_alias_54_block2(), !79 encode_allow_alias_54_block1(): - v3844v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ - v3845v1 = call new_6(v3844v1) - v4042v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1 - v1221v1 = const u64 0 - v4043v1 = get_elem_ptr v4042v1, __ptr u64, v1221v1 - v3577v1 = load v4043v1, !515 - v1224v1 = const u64 0, !516 - v3582v1 = cmp eq v3577v1 v1224v1, !519 - cbr v3582v1, encode_allow_alias_54_abi_encode_59_block0(), encode_allow_alias_54_abi_encode_59_block1(), !520 + v3845v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ + v3846v1 = call new_6(v3845v1) + v4043v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1 + v1222v1 = const u64 0 + v4044v1 = get_elem_ptr v4043v1, __ptr u64, v1222v1 + v3578v1 = load v4044v1, !515 + v1225v1 = const u64 0, !516 + v3583v1 = cmp eq v3578v1 v1225v1, !519 + cbr v3583v1, encode_allow_alias_54_abi_encode_59_block0(), encode_allow_alias_54_abi_encode_59_block1(), !520 encode_allow_alias_54_abi_encode_59_block0(): - v3601v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1, !521 - v1227v1 = const u64 1 - v1228v1 = const u64 0 - v3602v1 = get_elem_ptr v3601v1, __ptr { u64 }, v1227v1, v1228v1, !522 - v3606v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !524 - v3828v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__ - v1233v1 = const u64 0, !525 - v3829v1 = call abi_encode_5(v1233v1, v3606v1, v3828v1) - v3783v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__ - v3867v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - v3868v1 = call abi_encode_52(v3602v1, v3783v1, v3867v1) - v3798v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - br encode_allow_alias_54_abi_encode_59_block5(v3798v1), !526 + v3602v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1, !521 + v1228v1 = const u64 1 + v1229v1 = const u64 0 + v3603v1 = get_elem_ptr v3602v1, __ptr { u64 }, v1228v1, v1229v1, !522 + v3607v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !524 + v3829v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__ + v1234v1 = const u64 0, !525 + v3830v1 = call abi_encode_5(v1234v1, v3607v1, v3829v1) + v3784v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__ + v3868v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg + v3869v1 = call abi_encode_52(v3603v1, v3784v1, v3868v1) + v3799v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg + br encode_allow_alias_54_abi_encode_59_block5(v3799v1), !526 encode_allow_alias_54_abi_encode_59_block1(): - v3585v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1, !527 - v1249v1 = const u64 0 - v3586v1 = get_elem_ptr v3585v1, __ptr u64, v1249v1, !528 - v3587v1 = load v3586v1, !529 - v1252v1 = const u64 1, !516 - v3592v1 = cmp eq v3587v1 v1252v1, !532 - cbr v3592v1, encode_allow_alias_54_abi_encode_59_block2(), encode_allow_alias_54_abi_encode_59_block3(), !533 + v3586v1 = get_local __ptr { u64, ( { u64 } | () ) }, __matched_value_1, !527 + v1250v1 = const u64 0 + v3587v1 = get_elem_ptr v3586v1, __ptr u64, v1250v1, !528 + v3588v1 = load v3587v1, !529 + v1253v1 = const u64 1, !516 + v3593v1 = cmp eq v3588v1 v1253v1, !532 + cbr v3593v1, encode_allow_alias_54_abi_encode_59_block2(), encode_allow_alias_54_abi_encode_59_block3(), !533 encode_allow_alias_54_abi_encode_59_block2(): - v3596v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !535 - v3831v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - v1254v1 = const u64 1, !536 - v3832v1 = call abi_encode_5(v1254v1, v3596v1, v3831v1) - v3796v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - br encode_allow_alias_54_abi_encode_59_block5(v3796v1), !537 + v3597v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !535 + v3832v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg + v1255v1 = const u64 1, !536 + v3833v1 = call abi_encode_5(v1255v1, v3597v1, v3832v1) + v3797v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg + br encode_allow_alias_54_abi_encode_59_block5(v3797v1), !537 encode_allow_alias_54_abi_encode_59_block3(): - v1258v1 = const u64 14757395258967588866, !538 - revert v1258v1, !539 + v1259v1 = const u64 14757395258967588866, !538 + revert v1259v1, !539 - encode_allow_alias_54_abi_encode_59_block5(v3794v1: __ptr { { ptr, u64, u64 } }): - v3857v1 = get_local __ptr slice, __log_arg - v3858v1 = call as_raw_slice_7(v3794v1, v3857v1) + encode_allow_alias_54_abi_encode_59_block5(v3795v1: __ptr { { ptr, u64, u64 } }): + v3858v1 = get_local __ptr slice, __log_arg + v3859v1 = call as_raw_slice_7(v3795v1, v3858v1) br encode_allow_alias_54_block2(), !79 encode_allow_alias_54_block2(): - v3911v1 = get_local __ptr slice, __log_arg - v1289v1 = const u64 5087777005172090899 - log __ptr slice v3911v1, v1289v1 - v1293v1 = const unit () - ret () v1293v1 + v3912v1 = get_local __ptr slice, __log_arg + v1290v1 = const u64 5087777005172090899 + log __ptr slice v3912v1, v1290v1 + v1294v1 = const unit () + ret () v1294v1 } fn local_log_60(item: __ptr { }) -> (), !540 { @@ -1096,20 +1096,20 @@ script { local { { ptr, u64, u64 } } buffer_ entry(item: __ptr { }): - v3847v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ - v3848v1 = call new_6(v3847v1) - v3747v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ - v3834v1 = get_local __ptr { { ptr, u64, u64 } }, buffer - v1348v1 = const u64 77, !541 - v3835v1 = call abi_encode_5(v1348v1, v3747v1, v3834v1) - v3758v1 = get_local __ptr { { ptr, u64, u64 } }, buffer - v3860v1 = get_local __ptr slice, __log_arg - v3861v1 = call as_raw_slice_7(v3758v1, v3860v1) - v3914v1 = get_local __ptr slice, __log_arg - v1370v1 = const u64 5555909392781521367 - log __ptr slice v3914v1, v1370v1 - v1374v1 = const unit () - ret () v1374v1 + v3848v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ + v3849v1 = call new_6(v3848v1) + v3748v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ + v3835v1 = get_local __ptr { { ptr, u64, u64 } }, buffer + v1349v1 = const u64 77, !541 + v3836v1 = call abi_encode_5(v1349v1, v3748v1, v3835v1) + v3759v1 = get_local __ptr { { ptr, u64, u64 } }, buffer + v3861v1 = get_local __ptr slice, __log_arg + v3862v1 = call as_raw_slice_7(v3759v1, v3861v1) + v3915v1 = get_local __ptr slice, __log_arg + v1371v1 = const u64 5555909392781521367 + log __ptr slice v3915v1, v1371v1 + v1375v1 = const unit () + ret () v1375v1 } } @@ -1125,7 +1125,7 @@ script { !9 = span !0 83 117 !10 = fn_call_path_span !0 83 100 !11 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-vec/src/codec.sw" -!12 = span !11 49161 49187 +!12 = span !11 49177 49203 !13 = (!9 !10 !12) !14 = "test/src/e2e_vm_tests/test_programs/should_pass/language/logging/src/main.sw" !15 = span !14 594 999 @@ -1193,27 +1193,27 @@ script { !77 = inline "never" !78 = (!75 !76 !77) !79 = span !14 584 588 -!80 = span !11 48850 48862 +!80 = span !11 48866 48878 !81 = (!79 !80) !82 = (!79 !80) !83 = (!79 !80) !84 = (!79 !80) !85 = (!79 !80) -!86 = span !11 4703 4707 -!87 = span !11 4689 4834 -!88 = fn_name_span !11 4692 4702 +!86 = span !11 4719 4723 +!87 = span !11 4705 4850 +!88 = fn_name_span !11 4708 4718 !89 = (!87 !88) -!90 = span !11 4745 4828 -!91 = span !11 4797 4803 -!92 = span !11 87 114 -!93 = span !11 160 260 -!94 = fn_name_span !11 167 170 +!90 = span !11 4761 4844 +!91 = span !11 4813 4819 +!92 = span !11 103 130 +!93 = span !11 176 276 +!94 = fn_name_span !11 183 186 !95 = (!93 !94) -!96 = span !11 191 254 -!97 = span !11 499 591 -!98 = fn_name_span !11 502 514 +!96 = span !11 207 270 +!97 = span !11 515 607 +!98 = fn_name_span !11 518 530 !99 = (!97 !98) -!100 = span !11 573 577 +!100 = span !11 589 593 !101 = span !24 5760 5764 !102 = span !24 5766 5771 !103 = span !24 5740 6205 @@ -1281,10 +1281,10 @@ script { !165 = fn_call_path_span !24 6194 6196 !166 = (!164 !165) !167 = (!75 !76 !77) -!168 = span !11 48742 48766 -!169 = fn_call_path_span !11 48742 48759 -!170 = span !11 3637 3659 -!171 = fn_call_path_span !11 3637 3657 +!168 = span !11 48758 48782 +!169 = fn_call_path_span !11 48758 48775 +!170 = span !11 3653 3675 +!171 = fn_call_path_span !11 3653 3673 !172 = span !0 148 205 !173 = fn_call_path_span !0 175 177 !174 = (!79 !168 !169 !170 !171 !172 !173) @@ -1294,7 +1294,7 @@ script { !178 = (!79 !168 !169 !170 !171 !175) !179 = span !0 148 324 !180 = (!79 !168 !169 !170 !171 !179) -!181 = span !11 5377 5381 +!181 = span !11 5393 5397 !182 = (!79 !168 !169 !170 !171 !179) !183 = span !0 148 359 !184 = (!79 !168 !169 !170 !171 !183) @@ -1311,8 +1311,8 @@ script { !195 = (!79 !80) !196 = (!79 !80) !197 = (!79 !80) -!198 = span !11 48898 48931 -!199 = fn_call_path_span !11 48906 48916 +!198 = span !11 48914 48947 +!199 = fn_call_path_span !11 48922 48932 !200 = (!79 !198 !199) !201 = (!79 !198 !199) !202 = span !0 556 560 @@ -1333,9 +1333,9 @@ script { !217 = span !0 596 621 !218 = fn_call_path_span !0 603 613 !219 = (!79 !198 !199 !217 !218) -!220 = span !11 4980 5063 +!220 = span !11 4996 5079 !221 = (!79 !198 !199 !217 !218 !220) -!222 = span !11 5032 5038 +!222 = span !11 5048 5054 !223 = (!79 !198 !199 !217 !218 !222) !224 = (!79 !198 !199 !217 !218 !92) !225 = (!79 !198 !199 !217 !218) @@ -1373,9 +1373,9 @@ script { !257 = span !0 636 661 !258 = fn_call_path_span !0 643 653 !259 = (!79 !198 !199 !257 !258) -!260 = span !11 5215 5298 +!260 = span !11 5231 5314 !261 = (!79 !198 !199 !257 !258 !260) -!262 = span !11 5267 5273 +!262 = span !11 5283 5289 !263 = (!79 !198 !199 !257 !258 !262) !264 = (!79 !198 !199 !257 !258 !92) !265 = (!79 !198 !199 !257 !258) @@ -1418,9 +1418,9 @@ script { !302 = span !0 676 701 !303 = fn_call_path_span !0 683 693 !304 = (!79 !198 !199 !302 !303) -!305 = span !11 5448 5531 +!305 = span !11 5464 5547 !306 = (!79 !198 !199 !302 !303 !305) -!307 = span !11 5500 5506 +!307 = span !11 5516 5522 !308 = (!79 !198 !199 !302 !303 !307) !309 = (!79 !198 !199 !302 !303 !92) !310 = (!79 !198 !199 !302 !303) @@ -1520,9 +1520,9 @@ script { !404 = fn_call_path_span !0 763 773 !405 = (!79 !198 !199 !403 !404) !406 = (!79 !198 !199 !403 !404) -!407 = span !11 5719 5802 +!407 = span !11 5735 5818 !408 = (!79 !198 !199 !403 !404 !407) -!409 = span !11 5771 5777 +!409 = span !11 5787 5793 !410 = (!79 !198 !199 !403 !404 !409) !411 = (!79 !198 !199 !403 !404 !92) !412 = (!79 !198 !199 !403 !404) @@ -1532,7 +1532,7 @@ script { !416 = (!79 !198 !199 !403 !404) !417 = (!79 !198 !199 !403 !404) !418 = (!79 !198 !199 !403 !404) -!419 = span !11 5786 5790 +!419 = span !11 5802 5806 !420 = (!79 !198 !199 !403 !404 !419) !421 = (!79 !198 !199 !403 !404) !422 = (!79 !198 !199 !403 !404) @@ -1565,9 +1565,9 @@ script { !449 = fn_call_path_span !0 803 813 !450 = (!79 !198 !199 !448 !449) !451 = (!79 !198 !199 !448 !449) -!452 = span !11 4511 4594 +!452 = span !11 4527 4610 !453 = (!79 !198 !199 !448 !449 !452) -!454 = span !11 4563 4569 +!454 = span !11 4579 4585 !455 = (!79 !198 !199 !448 !449 !454) !456 = (!79 !198 !199 !448 !449 !92) !457 = (!79 !198 !199 !448 !449) @@ -1577,7 +1577,7 @@ script { !461 = (!79 !198 !199 !448 !449) !462 = (!79 !198 !199 !448 !449) !463 = (!79 !198 !199 !448 !449) -!464 = span !11 4578 4582 +!464 = span !11 4594 4598 !465 = (!79 !198 !199 !448 !449 !464) !466 = (!79 !198 !199 !448 !449) !467 = (!79 !198 !199 !448 !449) @@ -1602,9 +1602,9 @@ script { !486 = (!79 !198 !199 !485) !487 = span !0 840 846 !488 = (!79 !198 !199 !487) -!489 = span !11 48885 48932 +!489 = span !11 48901 48948 !490 = (!79 !489) -!491 = span !11 48941 48947 +!491 = span !11 48957 48963 !492 = (!79 !491) !493 = (!79 !198 !199 !448 !449) !494 = (!79 !198 !199 !448 !449) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_empty/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_empty/stdout.snap index a70dcdade92..9ab0c930575 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_empty/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_empty/stdout.snap @@ -26,16 +26,16 @@ library { script { pub entry fn __entry() -> __ptr never, !3 { entry(): - v11v1 = call main_0(), !6 - v14v1 = const u64 0, !7 - v15v1 = const u64 0, !8 - retd v14v1 v15v1, !9 + v12v1 = call main_0(), !6 + v15v1 = const u64 0, !7 + v16v1 = const u64 0, !8 + retd v15v1 v16v1, !9 } entry_orig fn main_0() -> (), !13 { entry(): - v9v1 = const unit () - ret () v9v1 + v10v1 = const unit () + ret () v10v1 } } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_one_u64/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_one_u64/stdout.snap index 954632f8d40..24ab4882e85 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_one_u64/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_one_u64/stdout.snap @@ -30,31 +30,31 @@ script { local { u64 } args entry(): - v104v1 = const u64 0, !5 - v364v1 = gtf v104v1, 10, !11 - v365v1 = bitcast v364v1 to ptr, !12 - v418v1 = cast_ptr v365v1 to __ptr { u64 }, !15 - v432v1 = get_local __ptr { u64 }, __aggr_memcpy_0 - mem_copy_val v432v1, v418v1 - v112v1 = get_local __ptr { u64 }, args, !16 - mem_copy_val v112v1, v432v1 - v134v1 = get_local __ptr { u64 }, args, !17 - v135v1 = const u64 0 - v136v1 = get_elem_ptr v134v1, __ptr u64, v135v1, !18 - v137v1 = load v136v1 - v138v1 = call main_11(v137v1), !21 - v139v1 = get_local __ptr u64, _result, !22 - store v138v1 to v139v1, !22 - v158v1 = get_local __ptr u64, _result, !23 - v149v1 = const u64 8 - retd v158v1 v149v1, !27 + v105v1 = const u64 0, !5 + v365v1 = gtf v105v1, 10, !11 + v366v1 = bitcast v365v1 to ptr, !12 + v419v1 = cast_ptr v366v1 to __ptr { u64 }, !15 + v433v1 = get_local __ptr { u64 }, __aggr_memcpy_0 + mem_copy_val v433v1, v419v1 + v113v1 = get_local __ptr { u64 }, args, !16 + mem_copy_val v113v1, v433v1 + v135v1 = get_local __ptr { u64 }, args, !17 + v136v1 = const u64 0 + v137v1 = get_elem_ptr v135v1, __ptr u64, v136v1, !18 + v138v1 = load v137v1 + v139v1 = call main_11(v138v1), !21 + v140v1 = get_local __ptr u64, _result, !22 + store v139v1 to v140v1, !22 + v159v1 = get_local __ptr u64, _result, !23 + v150v1 = const u64 8 + retd v159v1 v150v1, !27 } entry_orig fn main_11(baba !29: u64) -> u64, !32 { entry(baba: u64): - v131v1 = const u64 1, !33 - v350v1 = add baba, v131v1, !36 - ret u64 v350v1 + v132v1 = const u64 1, !33 + v351v1 = add baba, v132v1, !36 + ret u64 v351v1 } } @@ -63,16 +63,16 @@ script { !2 = fn_name_span !0 7 14 !3 = (!1 !2) !4 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core/src/codec.sw" -!5 = span !4 1542 1543 +!5 = span !4 1558 1559 !6 = span !0 59 89 !7 = fn_call_path_span !0 59 77 -!8 = span !4 91615 91647 -!9 = fn_call_path_span !4 91615 91645 -!10 = span !4 1525 1549 +!8 = span !4 91631 91663 +!9 = fn_call_path_span !4 91631 91661 +!10 = span !4 1541 1565 !11 = (!6 !7 !8 !9 !10) !12 = (!6 !7 !8 !9 !10) -!13 = span !4 91590 91648 -!14 = fn_call_path_span !4 91590 91609 +!13 = span !4 91606 91664 +!14 = fn_call_path_span !4 91606 91625 !15 = (!6 !7 !13 !14) !16 = span !0 40 90 !17 = span !0 131 135 @@ -84,7 +84,7 @@ script { !23 = span !0 182 189 !24 = span !0 156 190 !25 = fn_call_path_span !0 156 173 -!26 = span !4 49161 49187 +!26 = span !4 49177 49203 !27 = (!24 !25 !26) !28 = "test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_one_u64/src/main.sw" !29 = span !28 17 21 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_ref/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_ref/stdout.snap index e1fe9cdf40a..fd7851dd436 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_ref/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_ref/stdout.snap @@ -44,171 +44,171 @@ script { local u64 v entry(): - v823v1 = get_local __ptr never, __ret_value - v131v1 = const u64 0, !5 - v675v1 = gtf v131v1, 10, !11 - v676v1 = bitcast v675v1 to ptr, !12 - v678v1 = get_local __ptr ptr, ptr_, !15 - store v676v1 to v678v1, !16 - v680v1 = get_local __ptr u64, self_, !23 - v23v1 = const u64 14333742065139216717 - store v23v1 to v680v1, !24 - v682v1 = get_local __ptr u64, other_, !25 + v824v1 = get_local __ptr never, __ret_value + v132v1 = const u64 0, !5 + v676v1 = gtf v132v1, 10, !11 + v677v1 = bitcast v676v1 to ptr, !12 + v679v1 = get_local __ptr ptr, ptr_, !15 + store v677v1 to v679v1, !16 + v681v1 = get_local __ptr u64, self_, !23 v24v1 = const u64 14333742065139216717 - store v24v1 to v682v1, !26 - v684v1 = get_local __ptr u64, self_, !29 - v685v1 = load v684v1, !30 - v686v1 = get_local __ptr u64, other_, !32 - v687v1 = load v686v1, !33 - v688v1 = cmp eq v685v1 v687v1, !34 - cbr v688v1, decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block0(), decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block1(v688v1), !36 + store v24v1 to v681v1, !24 + v683v1 = get_local __ptr u64, other_, !25 + v25v1 = const u64 14333742065139216717 + store v25v1 to v683v1, !26 + v685v1 = get_local __ptr u64, self_, !29 + v686v1 = load v685v1, !30 + v687v1 = get_local __ptr u64, other_, !32 + v688v1 = load v687v1, !33 + v689v1 = cmp eq v686v1 v688v1, !34 + cbr v689v1, decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block0(), decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block1(v689v1), !36 decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block0(): - v691v1 = get_local __ptr u64, self_0, !41 - v28v1 = const u64 17045370188297990602 - store v28v1 to v691v1, !42 - v693v1 = get_local __ptr u64, other_0, !43 + v692v1 = get_local __ptr u64, self_0, !41 v29v1 = const u64 17045370188297990602 - store v29v1 to v693v1, !44 - v695v1 = get_local __ptr u64, self_0, !45 - v696v1 = load v695v1, !46 - v697v1 = get_local __ptr u64, other_0, !47 - v698v1 = load v697v1, !48 - v699v1 = cmp eq v696v1 v698v1, !49 - cbr v699v1, decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block0(), decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block1(v699v1), !51 + store v29v1 to v692v1, !42 + v694v1 = get_local __ptr u64, other_0, !43 + v30v1 = const u64 17045370188297990602 + store v30v1 to v694v1, !44 + v696v1 = get_local __ptr u64, self_0, !45 + v697v1 = load v696v1, !46 + v698v1 = get_local __ptr u64, other_0, !47 + v699v1 = load v698v1, !48 + v700v1 = cmp eq v697v1 v699v1, !49 + cbr v700v1, decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block0(), decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block1(v700v1), !51 decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block0(): - v33v1 = const bool true, !52 - br decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block1(v33v1), !53 + v34v1 = const bool true, !52 + br decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block1(v34v1), !53 - decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block1(v662v1: bool): - br decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block1(v662v1), !54 + decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_is_decode_trivial_5_is_decode_trivial_6_block1(v663v1: bool): + br decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block1(v663v1), !54 - decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block1(v665v1: bool): - cbr v665v1, decode_script_data_0_decode_from_raw_ptr_1_block0(), decode_script_data_0_decode_from_raw_ptr_1_block1(), !55 + decode_script_data_0_decode_from_raw_ptr_1_is_decode_trivial_2_is_decode_trivial_3_block1(v666v1: bool): + cbr v666v1, decode_script_data_0_decode_from_raw_ptr_1_block0(), decode_script_data_0_decode_from_raw_ptr_1_block1(), !55 decode_script_data_0_decode_from_raw_ptr_1_block0(): - v772v1 = get_local __ptr ptr, ptr_, !57 - v773v1 = load v772v1, !58 - v774v1 = cast_ptr v773v1 to __ptr { { u64 } }, !59 - v775v1 = get_local __ptr __ptr { { u64 } }, ptr__, !61 - store v774v1 to v775v1, !62 - v777v1 = get_local __ptr __ptr { { u64 } }, ptr__, !64 - v778v1 = load v777v1, !65 - v804v1 = get_local __ptr { { u64 } }, __tmp_block_arg1 - mem_copy_val v804v1, v778v1 - br decode_script_data_0_decode_from_raw_ptr_1_block2(v804v1), !66 + v773v1 = get_local __ptr ptr, ptr_, !57 + v774v1 = load v773v1, !58 + v775v1 = cast_ptr v774v1 to __ptr { { u64 } }, !59 + v776v1 = get_local __ptr __ptr { { u64 } }, ptr__, !61 + store v775v1 to v776v1, !62 + v778v1 = get_local __ptr __ptr { { u64 } }, ptr__, !64 + v779v1 = load v778v1, !65 + v805v1 = get_local __ptr { { u64 } }, __tmp_block_arg1 + mem_copy_val v805v1, v779v1 + br decode_script_data_0_decode_from_raw_ptr_1_block2(v805v1), !66 decode_script_data_0_decode_from_raw_ptr_1_block1(): - v711v1 = get_local __ptr { ptr }, __struct_init_0, !68 - v712v1 = get_local __ptr ptr, ptr_, !70 - v193v1 = const u64 0 - v714v1 = get_elem_ptr v711v1, __ptr ptr, v193v1, !71 - mem_copy_val v714v1, v712v1 - v717v1 = get_local __ptr { ptr }, buffer, !73 - mem_copy_val v717v1, v711v1 - v719v1 = get_local __ptr { ptr }, buffer, !75 - v721v1 = get_local __ptr __ptr { ptr }, buffer_, !78 - store v719v1 to v721v1, !79 - v723v1 = get_local __ptr { { u64 } }, __tuple_init_0, !81 - v724v1 = get_local __ptr __ptr { ptr }, buffer_, !83 - v726v1 = get_local __ptr __ptr { ptr }, buffer_0, !86 - mem_copy_val v726v1, v724v1 - v728v1 = get_local __ptr { u64 }, __struct_init_00, !88 - v729v1 = get_local __ptr __ptr { ptr }, buffer_0, !90 - v731v1 = get_local __ptr __ptr { ptr }, self_1, !93 - mem_copy_val v731v1, v729v1 - v733v1 = get_local __ptr __ptr { ptr }, self_1, !95 - v735v1 = get_local __ptr __ptr { ptr }, buffer_00, !98 - mem_copy_val v735v1, v733v1 - v737v1 = get_local __ptr __ptr { ptr }, buffer_00, !100 - v739v1 = get_local __ptr __ptr { ptr }, self_00, !103 - mem_copy_val v739v1, v737v1 - v741v1 = get_local __ptr __ptr { ptr }, self_00, !105 - v742v1 = load v741v1, !106 - v81v1 = const u64 0 - v743v1 = get_elem_ptr v742v1, __ptr ptr, v81v1, !108 - v744v1 = load v743v1, !109 - v745v1 = asm(ptr: v744v1, val) -> u64 val, !111 { + v712v1 = get_local __ptr { ptr }, __struct_init_0, !68 + v713v1 = get_local __ptr ptr, ptr_, !70 + v194v1 = const u64 0 + v715v1 = get_elem_ptr v712v1, __ptr ptr, v194v1, !71 + mem_copy_val v715v1, v713v1 + v718v1 = get_local __ptr { ptr }, buffer, !73 + mem_copy_val v718v1, v712v1 + v720v1 = get_local __ptr { ptr }, buffer, !75 + v722v1 = get_local __ptr __ptr { ptr }, buffer_, !78 + store v720v1 to v722v1, !79 + v724v1 = get_local __ptr { { u64 } }, __tuple_init_0, !81 + v725v1 = get_local __ptr __ptr { ptr }, buffer_, !83 + v727v1 = get_local __ptr __ptr { ptr }, buffer_0, !86 + mem_copy_val v727v1, v725v1 + v729v1 = get_local __ptr { u64 }, __struct_init_00, !88 + v730v1 = get_local __ptr __ptr { ptr }, buffer_0, !90 + v732v1 = get_local __ptr __ptr { ptr }, self_1, !93 + mem_copy_val v732v1, v730v1 + v734v1 = get_local __ptr __ptr { ptr }, self_1, !95 + v736v1 = get_local __ptr __ptr { ptr }, buffer_00, !98 + mem_copy_val v736v1, v734v1 + v738v1 = get_local __ptr __ptr { ptr }, buffer_00, !100 + v740v1 = get_local __ptr __ptr { ptr }, self_00, !103 + mem_copy_val v740v1, v738v1 + v742v1 = get_local __ptr __ptr { ptr }, self_00, !105 + v743v1 = load v742v1, !106 + v82v1 = const u64 0 + v744v1 = get_elem_ptr v743v1, __ptr ptr, v82v1, !108 + v745v1 = load v744v1, !109 + v746v1 = asm(ptr: v745v1, val) -> u64 val, !111 { lw val ptr i0, !112 } - v746v1 = get_local __ptr u64, v, !114 - store v745v1 to v746v1, !115 - v748v1 = get_local __ptr __ptr { ptr }, self_00, !117 - v749v1 = load v748v1, !118 - v89v1 = const u64 0 - v750v1 = get_elem_ptr v749v1, __ptr ptr, v89v1, !119 - v751v1 = load v750v1, !120 - v87v1 = const u64 1 - v92v1 = const u64 8, !121 - v752v1 = mul v87v1, v92v1, !122 - v753v1 = add v751v1, v752v1, !123 - v754v1 = get_local __ptr __ptr { ptr }, self_00, !125 - v755v1 = load v754v1, !126 - v96v1 = const u64 0 - v756v1 = get_elem_ptr v755v1, __ptr ptr, v96v1, !127 - store v753v1 to v756v1, !128 - v758v1 = get_local __ptr u64, v, !130 - v759v1 = load v758v1, !131 - v199v1 = const u64 0 - v763v1 = get_elem_ptr v728v1, __ptr u64, v199v1, !132 - store v759v1 to v763v1, !133 - v796v1 = get_local __ptr { u64 }, __tmp_block_arg - mem_copy_val v796v1, v728v1 - v196v1 = const u64 0 - v767v1 = get_elem_ptr v723v1, __ptr { u64 }, v196v1, !134 - mem_copy_val v767v1, v796v1 - v800v1 = get_local __ptr { { u64 } }, __tmp_block_arg0 - mem_copy_val v800v1, v723v1 - v806v1 = get_local __ptr { { u64 } }, __tmp_block_arg1 - mem_copy_val v806v1, v800v1 - br decode_script_data_0_decode_from_raw_ptr_1_block2(v806v1), !135 + v747v1 = get_local __ptr u64, v, !114 + store v746v1 to v747v1, !115 + v749v1 = get_local __ptr __ptr { ptr }, self_00, !117 + v750v1 = load v749v1, !118 + v90v1 = const u64 0 + v751v1 = get_elem_ptr v750v1, __ptr ptr, v90v1, !119 + v752v1 = load v751v1, !120 + v88v1 = const u64 1 + v93v1 = const u64 8, !121 + v753v1 = mul v88v1, v93v1, !122 + v754v1 = add v752v1, v753v1, !123 + v755v1 = get_local __ptr __ptr { ptr }, self_00, !125 + v756v1 = load v755v1, !126 + v97v1 = const u64 0 + v757v1 = get_elem_ptr v756v1, __ptr ptr, v97v1, !127 + store v754v1 to v757v1, !128 + v759v1 = get_local __ptr u64, v, !130 + v760v1 = load v759v1, !131 + v200v1 = const u64 0 + v764v1 = get_elem_ptr v729v1, __ptr u64, v200v1, !132 + store v760v1 to v764v1, !133 + v797v1 = get_local __ptr { u64 }, __tmp_block_arg + mem_copy_val v797v1, v729v1 + v197v1 = const u64 0 + v768v1 = get_elem_ptr v724v1, __ptr { u64 }, v197v1, !134 + mem_copy_val v768v1, v797v1 + v801v1 = get_local __ptr { { u64 } }, __tmp_block_arg0 + mem_copy_val v801v1, v724v1 + v807v1 = get_local __ptr { { u64 } }, __tmp_block_arg1 + mem_copy_val v807v1, v801v1 + br decode_script_data_0_decode_from_raw_ptr_1_block2(v807v1), !135 - decode_script_data_0_decode_from_raw_ptr_1_block2(v802v1: __ptr { { u64 } }): - v810v1 = get_local __ptr { { u64 } }, __tmp_block_arg2 - mem_copy_val v810v1, v802v1 - v814v1 = get_local __ptr { { u64 } }, __tmp_block_arg3 - mem_copy_val v814v1, v810v1 - v139v1 = get_local __ptr { { u64 } }, args, !136 - mem_copy_val v139v1, v814v1 - v163v1 = get_local __ptr { { u64 } }, args, !137 - v164v1 = const u64 0 - v165v1 = get_elem_ptr v163v1, __ptr { u64 }, v164v1, !138 - v820v1 = get_local __ptr { u64 }, __tmp_arg - mem_copy_val v820v1, v165v1 - v822v1 = call main_15(v820v1) - v168v1 = get_local __ptr u64, _result, !139 - store v822v1 to v168v1, !139 - v187v1 = get_local __ptr u64, _result, !140 - v188v3 = get_local __ptr __ptr u64, item_, !143 - store v187v1 to v188v3, !143 - v785v1 = get_local __ptr bool, IS_TRIVIAL, !145 - v173v1 = const bool true, !146 - store v173v1 to v785v1, !147 - v787v1 = get_local __ptr u64, size, !149 - v178v1 = const u64 8 - store v178v1 to v787v1, !150 - v789v1 = get_local __ptr __ptr u64, item_, !152 - v790v1 = load v789v1, !143 - v791v1 = get_local __ptr u64, size, !154 - v792v1 = load v791v1, !143 - retd v790v1 v792v1, !156 + decode_script_data_0_decode_from_raw_ptr_1_block2(v803v1: __ptr { { u64 } }): + v811v1 = get_local __ptr { { u64 } }, __tmp_block_arg2 + mem_copy_val v811v1, v803v1 + v815v1 = get_local __ptr { { u64 } }, __tmp_block_arg3 + mem_copy_val v815v1, v811v1 + v140v1 = get_local __ptr { { u64 } }, args, !136 + mem_copy_val v140v1, v815v1 + v164v1 = get_local __ptr { { u64 } }, args, !137 + v165v1 = const u64 0 + v166v1 = get_elem_ptr v164v1, __ptr { u64 }, v165v1, !138 + v821v1 = get_local __ptr { u64 }, __tmp_arg + mem_copy_val v821v1, v166v1 + v823v1 = call main_15(v821v1) + v169v1 = get_local __ptr u64, _result, !139 + store v823v1 to v169v1, !139 + v188v1 = get_local __ptr u64, _result, !140 + v189v3 = get_local __ptr __ptr u64, item_, !143 + store v188v1 to v189v3, !143 + v786v1 = get_local __ptr bool, IS_TRIVIAL, !145 + v174v1 = const bool true, !146 + store v174v1 to v786v1, !147 + v788v1 = get_local __ptr u64, size, !149 + v179v1 = const u64 8 + store v179v1 to v788v1, !150 + v790v1 = get_local __ptr __ptr u64, item_, !152 + v791v1 = load v790v1, !143 + v792v1 = get_local __ptr u64, size, !154 + v793v1 = load v792v1, !143 + retd v791v1 v793v1, !156 } entry_orig fn main_15(baba: __ptr { u64 }) -> u64, !160 { local u64 other_ entry(baba: __ptr { u64 }): - v157v1 = const u64 0 - v158v1 = get_elem_ptr baba, __ptr u64, v157v1, !161 - v649v1 = get_local __ptr u64, other_, !164 - v160v1 = const u64 1, !165 - store v160v1 to v649v1, !164 - v652v1 = load v158v1, !164 - v653v1 = get_local __ptr u64, other_, !167 - v654v1 = load v653v1, !164 - v655v1 = add v652v1, v654v1, !164 - ret u64 v655v1 + v158v1 = const u64 0 + v159v1 = get_elem_ptr baba, __ptr u64, v158v1, !161 + v650v1 = get_local __ptr u64, other_, !164 + v161v1 = const u64 1, !165 + store v161v1 to v650v1, !164 + v653v1 = load v159v1, !164 + v654v1 = get_local __ptr u64, other_, !167 + v655v1 = load v654v1, !164 + v656v1 = add v653v1, v655v1, !164 + ret u64 v656v1 } } @@ -217,24 +217,24 @@ script { !2 = fn_name_span !0 7 14 !3 = (!1 !2) !4 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core/src/codec.sw" -!5 = span !4 1542 1543 +!5 = span !4 1558 1559 !6 = span !0 66 103 !7 = fn_call_path_span !0 66 84 -!8 = span !4 91615 91647 -!9 = fn_call_path_span !4 91615 91645 -!10 = span !4 1525 1549 +!8 = span !4 91631 91663 +!9 = fn_call_path_span !4 91631 91661 +!10 = span !4 1541 1565 !11 = (!6 !7 !8 !9 !10) !12 = (!6 !7 !8 !9 !10) -!13 = span !4 91590 91648 -!14 = fn_call_path_span !4 91590 91609 +!13 = span !4 91606 91664 +!14 = fn_call_path_span !4 91606 91625 !15 = (!6 !7 !13 !14) !16 = (!6 !7 !13 !14) -!17 = span !4 91330 91354 -!18 = fn_call_path_span !4 91330 91347 -!19 = span !4 3731 3753 -!20 = fn_call_path_span !4 3731 3751 -!21 = span !4 54488 54545 -!22 = fn_call_path_span !4 54515 54517 +!17 = span !4 91346 91370 +!18 = fn_call_path_span !4 91346 91363 +!19 = span !4 3747 3769 +!20 = fn_call_path_span !4 3747 3767 +!21 = span !4 54504 54561 +!22 = fn_call_path_span !4 54531 54533 !23 = (!6 !7 !13 !14 !17 !18 !19 !20 !21 !22) !24 = (!6 !7 !13 !14 !17 !18 !19 !20 !21 !22) !25 = (!6 !7 !13 !14 !17 !18 !19 !20 !21 !22) @@ -247,10 +247,10 @@ script { !32 = (!6 !7 !13 !14 !17 !18 !19 !20 !21 !22 !31) !33 = (!6 !7 !13 !14 !17 !18 !19 !20 !21 !22) !34 = (!6 !7 !13 !14 !17 !18 !19 !20 !21 !22) -!35 = span !4 54488 54573 +!35 = span !4 54504 54589 !36 = (!6 !7 !13 !14 !17 !18 !19 !20 !35) -!37 = span !4 54549 54573 -!38 = fn_call_path_span !4 54549 54566 +!37 = span !4 54565 54589 +!38 = fn_call_path_span !4 54565 54582 !39 = span !0 157 214 !40 = fn_call_path_span !0 184 186 !41 = (!6 !7 !13 !14 !17 !18 !19 !20 !37 !38 !19 !20 !39 !40) @@ -264,40 +264,40 @@ script { !49 = (!6 !7 !13 !14 !17 !18 !19 !20 !37 !38 !19 !20 !39 !40) !50 = span !0 157 244 !51 = (!6 !7 !13 !14 !17 !18 !19 !20 !37 !38 !19 !20 !50) -!52 = span !4 51022 51026 +!52 = span !4 51038 51042 !53 = (!6 !7 !13 !14 !17 !18 !19 !20 !37 !38 !19 !20 !50) !54 = (!6 !7 !13 !14 !17 !18 !19 !20 !35) !55 = (!6 !7 !13 !14 !17) -!56 = span !4 91406 91409 +!56 = span !4 91422 91425 !57 = (!6 !7 !13 !14 !56) !58 = (!6 !7 !13 !14) !59 = (!6 !7 !13 !14) -!60 = span !4 91365 91411 +!60 = span !4 91381 91427 !61 = (!6 !7 !13 !14 !60) !62 = (!6 !7 !13 !14 !60) -!63 = span !4 91421 91424 +!63 = span !4 91437 91440 !64 = (!6 !7 !13 !14 !63) !65 = (!6 !7 !13 !14) !66 = (!6 !7 !13 !14) -!67 = span !4 91463 91483 +!67 = span !4 91479 91499 !68 = (!6 !7 !13 !14 !67) -!69 = span !4 91478 91481 +!69 = span !4 91494 91497 !70 = (!6 !7 !13 !14 !69) !71 = (!6 !7 !13 !14 !67) -!72 = span !4 91446 91484 +!72 = span !4 91462 91500 !73 = (!6 !7 !13 !14 !72) -!74 = span !4 91507 91513 +!74 = span !4 91523 91529 !75 = (!6 !7 !13 !14 !74) -!76 = span !4 91493 91514 -!77 = fn_call_path_span !4 91493 91506 +!76 = span !4 91509 91530 +!77 = fn_call_path_span !4 91509 91522 !78 = (!6 !7 !13 !14 !76 !77) !79 = (!6 !7 !13 !14 !76 !77) -!80 = span !4 54646 54671 +!80 = span !4 54662 54687 !81 = (!6 !7 !13 !14 !76 !77 !80) -!82 = span !4 54661 54667 +!82 = span !4 54677 54683 !83 = (!6 !7 !13 !14 !76 !77 !82) -!84 = span !4 54647 54668 -!85 = fn_call_path_span !4 54647 54660 +!84 = span !4 54663 54684 +!85 = fn_call_path_span !4 54663 54676 !86 = (!6 !7 !13 !14 !76 !77 !84 !85) !87 = span !0 373 410 !88 = (!6 !7 !13 !14 !76 !77 !84 !85 !87) @@ -306,42 +306,42 @@ script { !91 = span !0 385 407 !92 = fn_call_path_span !0 392 398 !93 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92) -!94 = span !4 3480 3484 +!94 = span !4 3496 3500 !95 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !94) -!96 = span !4 3466 3485 -!97 = fn_call_path_span !4 3466 3479 +!96 = span !4 3482 3501 +!97 = fn_call_path_span !4 3482 3495 !98 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97) -!99 = span !4 51098 51104 +!99 = span !4 51114 51120 !100 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !99) -!101 = span !4 51098 51126 -!102 = fn_call_path_span !4 51105 51117 +!101 = span !4 51114 51142 +!102 = fn_call_path_span !4 51121 51133 !103 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) -!104 = span !4 2282 2286 +!104 = span !4 2298 2302 !105 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !104) !106 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) -!107 = span !4 625 641 +!107 = span !4 641 657 !108 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !107) !109 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) -!110 = span !4 2273 2354 +!110 = span !4 2289 2370 !111 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !110) -!112 = span !4 2311 2324 -!113 = span !4 2265 2355 +!112 = span !4 2327 2340 +!113 = span !4 2281 2371 !114 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !113) !115 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !113) -!116 = span !4 2391 2395 +!116 = span !4 2407 2411 !117 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !116) !118 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) !119 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !107) !120 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) -!121 = span !4 2401 2402 +!121 = span !4 2417 2418 !122 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) !123 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) -!124 = span !4 2364 2403 +!124 = span !4 2380 2419 !125 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !124) !126 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) !127 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !124) !128 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !124) -!129 = span !4 2413 2414 +!129 = span !4 2429 2430 !130 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102 !129) !131 = (!6 !7 !13 !14 !76 !77 !84 !85 !91 !92 !96 !97 !101 !102) !132 = (!6 !7 !13 !14 !76 !77 !84 !85 !87) @@ -356,18 +356,18 @@ script { !141 = span !0 170 204 !142 = fn_call_path_span !0 170 187 !143 = (!141 !142) -!144 = span !4 49045 49094 +!144 = span !4 49061 49110 !145 = (!141 !142 !144) -!146 = span !4 49070 49094 +!146 = span !4 49086 49110 !147 = (!141 !142 !144) -!148 = span !4 49124 49152 +!148 = span !4 49140 49168 !149 = (!141 !142 !148) !150 = (!141 !142 !148) -!151 = span !4 49176 49180 +!151 = span !4 49192 49196 !152 = (!141 !142 !151) -!153 = span !4 49182 49186 +!153 = span !4 49198 49202 !154 = (!141 !142 !153) -!155 = span !4 49161 49187 +!155 = span !4 49177 49203 !156 = (!141 !142 !155) !157 = "test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_ref/src/main.sw" !158 = span !157 46 99 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_two_u64/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_two_u64/stdout.snap index e84211afe1a..fe4facc0639 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_two_u64/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_two_u64/stdout.snap @@ -34,80 +34,80 @@ script { local mut { ptr } buffer entry(): - v111v1 = const u64 0, !5 - v355v1 = gtf v111v1, 10, !11 - v356v1 = bitcast v355v1 to ptr, !12 - v28v1 = const bool true, !13 - cbr v28v1, decode_script_data_0_decode_from_raw_ptr_1_block0(), decode_script_data_0_decode_from_raw_ptr_1_block1(), !17 + v112v1 = const u64 0, !5 + v356v1 = gtf v112v1, 10, !11 + v357v1 = bitcast v356v1 to ptr, !12 + v29v1 = const bool true, !13 + cbr v29v1, decode_script_data_0_decode_from_raw_ptr_1_block0(), decode_script_data_0_decode_from_raw_ptr_1_block1(), !17 decode_script_data_0_decode_from_raw_ptr_1_block0(): - v399v1 = cast_ptr v356v1 to __ptr { u64, u64 }, !18 - v439v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_0 - mem_copy_val v439v1, v399v1 - v436v1 = get_local __ptr { u64, u64 }, __tmp_block_arg - mem_copy_val v436v1, v439v1 - br decode_script_data_0_decode_from_raw_ptr_1_block2(v436v1), !19 + v400v1 = cast_ptr v357v1 to __ptr { u64, u64 }, !18 + v440v1 = get_local __ptr { u64, u64 }, __aggr_memcpy_0 + mem_copy_val v440v1, v400v1 + v437v1 = get_local __ptr { u64, u64 }, __tmp_block_arg + mem_copy_val v437v1, v440v1 + br decode_script_data_0_decode_from_raw_ptr_1_block2(v437v1), !19 decode_script_data_0_decode_from_raw_ptr_1_block1(): - v376v1 = get_local __ptr { ptr }, __struct_init_0, !21 - v179v1 = const u64 0 - v378v1 = get_elem_ptr v376v1, __ptr ptr, v179v1, !22 - store v356v1 to v378v1, !23 - v381v1 = get_local __ptr { ptr }, buffer, !25 - mem_copy_val v381v1, v376v1 - v383v1 = get_local __ptr { ptr }, buffer, !27 - v386v1 = get_local __ptr { u64, u64 }, __tuple_init_0, !31 - v68v1 = const u64 0 - v388v3 = get_elem_ptr v383v1, __ptr ptr, v68v1, !37 - v413v1 = load v388v3, !38 - v414v1 = asm(ptr: v413v1, val) -> u64 val, !40 { + v377v1 = get_local __ptr { ptr }, __struct_init_0, !21 + v180v1 = const u64 0 + v379v1 = get_elem_ptr v377v1, __ptr ptr, v180v1, !22 + store v357v1 to v379v1, !23 + v382v1 = get_local __ptr { ptr }, buffer, !25 + mem_copy_val v382v1, v377v1 + v384v1 = get_local __ptr { ptr }, buffer, !27 + v387v1 = get_local __ptr { u64, u64 }, __tuple_init_0, !31 + v69v1 = const u64 0 + v389v3 = get_elem_ptr v384v1, __ptr ptr, v69v1, !37 + v414v1 = load v389v3, !38 + v415v1 = asm(ptr: v414v1, val) -> u64 val, !40 { lw val ptr i0, !41 } - v416v1 = load v388v3, !42 - v417v1 = const u64 8, !43 - v418v1 = add v416v1, v417v1, !44 - store v418v1 to v388v3, !46 - v423v1 = load v388v3, !49 - v424v1 = asm(ptr: v423v1, val) -> u64 val, !50 { + v417v1 = load v389v3, !42 + v418v1 = const u64 8, !43 + v419v1 = add v417v1, v418v1, !44 + store v419v1 to v389v3, !46 + v424v1 = load v389v3, !49 + v425v1 = asm(ptr: v424v1, val) -> u64 val, !50 { lw val ptr i0, !41 } - v426v1 = load v388v3, !51 - v427v1 = const u64 8, !52 - v428v1 = add v426v1, v427v1, !53 - store v428v1 to v388v3, !54 - v182v1 = const u64 0 - v391v1 = get_elem_ptr v386v1, __ptr u64, v182v1, !55 - store v414v1 to v391v1, !56 - v185v1 = const u64 1 - v393v1 = get_elem_ptr v386v1, __ptr u64, v185v1, !57 - store v424v1 to v393v1, !58 - v434v1 = get_local __ptr { u64, u64 }, __tmp_block_arg - mem_copy_val v434v1, v386v1 - br decode_script_data_0_decode_from_raw_ptr_1_block2(v434v1), !59 + v427v1 = load v389v3, !51 + v428v1 = const u64 8, !52 + v429v1 = add v427v1, v428v1, !53 + store v429v1 to v389v3, !54 + v183v1 = const u64 0 + v392v1 = get_elem_ptr v387v1, __ptr u64, v183v1, !55 + store v415v1 to v392v1, !56 + v186v1 = const u64 1 + v394v1 = get_elem_ptr v387v1, __ptr u64, v186v1, !57 + store v425v1 to v394v1, !58 + v435v1 = get_local __ptr { u64, u64 }, __tmp_block_arg + mem_copy_val v435v1, v387v1 + br decode_script_data_0_decode_from_raw_ptr_1_block2(v435v1), !59 - decode_script_data_0_decode_from_raw_ptr_1_block2(v432v1: __ptr { u64, u64 }): - v119v1 = get_local __ptr { u64, u64 }, args, !60 - mem_copy_val v119v1, v432v1 - v145v1 = get_local __ptr { u64, u64 }, args, !61 - v146v1 = const u64 0 - v147v1 = get_elem_ptr v145v1, __ptr u64, v146v1, !62 - v148v1 = load v147v1 - v149v1 = get_local __ptr { u64, u64 }, args, !63 - v150v1 = const u64 1 - v151v1 = get_elem_ptr v149v1, __ptr u64, v150v1, !64 - v152v1 = load v151v1 - v153v1 = call main_11(v148v1, v152v1), !67 - v154v1 = get_local __ptr u64, _result, !68 - store v153v1 to v154v1, !68 - v173v1 = get_local __ptr u64, _result, !69 - v164v1 = const u64 8 - retd v173v1 v164v1, !73 + decode_script_data_0_decode_from_raw_ptr_1_block2(v433v1: __ptr { u64, u64 }): + v120v1 = get_local __ptr { u64, u64 }, args, !60 + mem_copy_val v120v1, v433v1 + v146v1 = get_local __ptr { u64, u64 }, args, !61 + v147v1 = const u64 0 + v148v1 = get_elem_ptr v146v1, __ptr u64, v147v1, !62 + v149v1 = load v148v1 + v150v1 = get_local __ptr { u64, u64 }, args, !63 + v151v1 = const u64 1 + v152v1 = get_elem_ptr v150v1, __ptr u64, v151v1, !64 + v153v1 = load v152v1 + v154v1 = call main_11(v149v1, v153v1), !67 + v155v1 = get_local __ptr u64, _result, !68 + store v154v1 to v155v1, !68 + v174v1 = get_local __ptr u64, _result, !69 + v165v1 = const u64 8 + retd v174v1 v165v1, !73 } entry_orig fn main_11(baba !75: u64, keke !76: u64) -> u64, !79 { entry(baba: u64, keke: u64): - v340v1 = add baba, keke, !82 - ret u64 v340v1 + v341v1 = add baba, keke, !82 + ret u64 v341v1 } } @@ -116,50 +116,50 @@ script { !2 = fn_name_span !0 7 14 !3 = (!1 !2) !4 = "test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core/src/codec.sw" -!5 = span !4 1542 1543 +!5 = span !4 1558 1559 !6 = span !0 64 99 !7 = fn_call_path_span !0 64 82 -!8 = span !4 91615 91647 -!9 = fn_call_path_span !4 91615 91645 -!10 = span !4 1525 1549 +!8 = span !4 91631 91663 +!9 = fn_call_path_span !4 91631 91661 +!10 = span !4 1541 1565 !11 = (!6 !7 !8 !9 !10) !12 = (!6 !7 !8 !9 !10) -!13 = span !4 51022 51026 -!14 = span !4 91590 91648 -!15 = fn_call_path_span !4 91590 91609 -!16 = span !4 91330 91354 +!13 = span !4 51038 51042 +!14 = span !4 91606 91664 +!15 = fn_call_path_span !4 91606 91625 +!16 = span !4 91346 91370 !17 = (!6 !7 !14 !15 !16) !18 = (!6 !7 !14 !15) !19 = (!6 !7 !14 !15) -!20 = span !4 91463 91483 +!20 = span !4 91479 91499 !21 = (!6 !7 !14 !15 !20) !22 = (!6 !7 !14 !15 !20) !23 = (!6 !7 !14 !15 !20) -!24 = span !4 91446 91484 +!24 = span !4 91462 91500 !25 = (!6 !7 !14 !15 !24) -!26 = span !4 91507 91513 +!26 = span !4 91523 91529 !27 = (!6 !7 !14 !15 !26) -!28 = span !4 91493 91514 -!29 = fn_call_path_span !4 91493 91506 -!30 = span !4 54987 55033 +!28 = span !4 91509 91530 +!29 = fn_call_path_span !4 91509 91522 +!30 = span !4 55003 55049 !31 = (!6 !7 !14 !15 !28 !29 !30) -!32 = span !4 54988 55009 -!33 = fn_call_path_span !4 54988 55001 -!34 = span !4 51098 51126 -!35 = fn_call_path_span !4 51105 51117 -!36 = span !4 625 641 +!32 = span !4 55004 55025 +!33 = fn_call_path_span !4 55004 55017 +!34 = span !4 51114 51142 +!35 = fn_call_path_span !4 51121 51133 +!36 = span !4 641 657 !37 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35 !36) !38 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35) -!39 = span !4 2273 2354 +!39 = span !4 2289 2370 !40 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35 !39) -!41 = span !4 2311 2324 +!41 = span !4 2327 2340 !42 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35) !43 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35) !44 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35) -!45 = span !4 2364 2403 +!45 = span !4 2380 2419 !46 = (!6 !7 !14 !15 !28 !29 !32 !33 !34 !35 !45) -!47 = span !4 55011 55032 -!48 = fn_call_path_span !4 55011 55024 +!47 = span !4 55027 55048 +!48 = fn_call_path_span !4 55027 55040 !49 = (!6 !7 !14 !15 !28 !29 !47 !48 !34 !35) !50 = (!6 !7 !14 !15 !28 !29 !47 !48 !34 !35 !39) !51 = (!6 !7 !14 !15 !28 !29 !47 !48 !34 !35) @@ -183,7 +183,7 @@ script { !69 = span !0 200 207 !70 = span !0 174 208 !71 = fn_call_path_span !0 174 191 -!72 = span !4 49161 49187 +!72 = span !4 49177 49203 !73 = (!70 !71 !72) !74 = "test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_two_u64/src/main.sw" !75 = span !74 17 21 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap index 598b43b4e91..dde12155ba5 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/main_args/main_args_various_types/stdout.snap @@ -54,182 +54,182 @@ script { local slice slice_ entry(): - v472v1 = const u64 0, !5 - v4042v1 = gtf v472v1, 10, !11 - v4043v1 = bitcast v4042v1 to ptr, !12 - v4085v1 = get_local __ptr { ptr }, __struct_init_0, !16 - v1130v1 = const u64 0 - v4087v1 = get_elem_ptr v4085v1, __ptr ptr, v1130v1, !17 - store v4043v1 to v4087v1, !18 - v4090v1 = get_local __ptr { ptr }, buffer, !20 - mem_copy_val v4090v1, v4085v1 - v4092v1 = get_local __ptr { ptr }, buffer, !22 - v4095v1 = get_local __ptr { [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] }, __tuple_init_0, !26 - v4099v1 = get_local __ptr [u8; 48], __array_init_0, !30 - mem_clear_val v4099v1, !31 - v4102v1 = get_local __ptr [u8; 48], array, !33 - mem_copy_val v4102v1, v4099v1 - v4104v1 = get_local __ptr [u8; 48], array, !35 - v4105v1 = cast_ptr v4104v1 to __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], !36 - v194v1 = const u64 0, !37 - br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while(v194v1), !38 + v473v1 = const u64 0, !5 + v4043v1 = gtf v473v1, 10, !11 + v4044v1 = bitcast v4043v1 to ptr, !12 + v4086v1 = get_local __ptr { ptr }, __struct_init_0, !16 + v1131v1 = const u64 0 + v4088v1 = get_elem_ptr v4086v1, __ptr ptr, v1131v1, !17 + store v4044v1 to v4088v1, !18 + v4091v1 = get_local __ptr { ptr }, buffer, !20 + mem_copy_val v4091v1, v4086v1 + v4093v1 = get_local __ptr { ptr }, buffer, !22 + v4096v1 = get_local __ptr { [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] }, __tuple_init_0, !26 + v4100v1 = get_local __ptr [u8; 48], __array_init_0, !30 + mem_clear_val v4100v1, !31 + v4103v1 = get_local __ptr [u8; 48], array, !33 + mem_copy_val v4103v1, v4100v1 + v4105v1 = get_local __ptr [u8; 48], array, !35 + v4106v1 = cast_ptr v4105v1 to __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], !36 + v195v1 = const u64 0, !37 + br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while(v195v1), !38 - decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while(v4022v1: u64): - v212v1 = const u64 2 - v4114v1 = cmp lt v4022v1 v212v1, !41 - cbr v4114v1, decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while_body(), decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_end_while(), !42 + decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while(v4023v1: u64): + v213v1 = const u64 2 + v4115v1 = cmp lt v4023v1 v213v1, !41 + cbr v4115v1, decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while_body(), decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_end_while(), !42 decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while_body(): - v218v1 = const u64 24 - v4127v1 = asm(idx: v4022v1, elem_ir_type_size: v218v1, ptr: v4105v1, offset_temp, ptr_out) -> __ptr { { string<3> }, { u64, ( u64 | u64 ) } } ptr_out, !43 { + v219v1 = const u64 24 + v4128v1 = asm(idx: v4023v1, elem_ir_type_size: v219v1, ptr: v4106v1, offset_temp, ptr_out) -> __ptr { { string<3> }, { u64, ( u64 | u64 ) } } ptr_out, !43 { mul offset_temp idx elem_ir_type_size add ptr_out ptr offset_temp } - v4133v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, __tuple_init_00, !49 - v4136v1 = get_local __ptr { string<3> }, __struct_init_00, !53 - v4144v1 = get_local __ptr { ptr, u64 }, __tuple_init_000, !59 - v247v1 = const u64 0 - v4146v1 = get_elem_ptr v4092v1, __ptr ptr, v247v1, !61 - v1145v1 = const u64 0 - v4149v1 = get_elem_ptr v4144v1, __ptr ptr, v1145v1, !62 - mem_copy_val v4149v1, v4146v1 - v1148v1 = const u64 1 - v4151v1 = get_elem_ptr v4144v1, __ptr u64, v1148v1, !63 - v276v1 = const u64 3 - store v276v1 to v4151v1, !64 - v4392v1 = asm(ptr: v4144v1) -> __ptr slice ptr { + v4134v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, __tuple_init_00, !49 + v4137v1 = get_local __ptr { string<3> }, __struct_init_00, !53 + v4145v1 = get_local __ptr { ptr, u64 }, __tuple_init_000, !59 + v248v1 = const u64 0 + v4147v1 = get_elem_ptr v4093v1, __ptr ptr, v248v1, !61 + v1146v1 = const u64 0 + v4150v1 = get_elem_ptr v4145v1, __ptr ptr, v1146v1, !62 + mem_copy_val v4150v1, v4147v1 + v1149v1 = const u64 1 + v4152v1 = get_elem_ptr v4145v1, __ptr u64, v1149v1, !63 + v277v1 = const u64 3 + store v277v1 to v4152v1, !64 + v4393v1 = asm(ptr: v4145v1) -> __ptr slice ptr { } - v4420v1 = get_local __ptr slice, __aggr_memcpy_0 - mem_copy_val v4420v1, v4392v1 - v4155v1 = get_local __ptr slice, slice, !66 - mem_copy_val v4155v1, v4420v1 - v4159v1 = load v4146v1, !67 - v4161v1 = const u64 3, !68 - v4162v1 = add v4159v1, v4161v1, !69 - store v4162v1 to v4146v1, !71 - v4166v1 = get_local __ptr slice, slice, !73 - v4169v1 = get_local __ptr slice, data, !75 - mem_copy_val v4169v1, v4166v1 - v4171v1 = get_local __ptr slice, data, !77 - v4173v1 = get_local __ptr slice, self_00000, !80 - mem_copy_val v4173v1, v4171v1 - v4175v1 = get_local __ptr slice, self_00000, !83 - v4177v1 = get_local __ptr slice, slice_, !86 - mem_copy_val v4177v1, v4175v1 - v4179v1 = get_local __ptr slice, slice_, !88 - v4394v1 = asm(ptr: v4179v1) -> __ptr { ptr, u64 } ptr { + v4421v1 = get_local __ptr slice, __aggr_memcpy_0 + mem_copy_val v4421v1, v4393v1 + v4156v1 = get_local __ptr slice, slice, !66 + mem_copy_val v4156v1, v4421v1 + v4160v1 = load v4147v1, !67 + v4162v1 = const u64 3, !68 + v4163v1 = add v4160v1, v4162v1, !69 + store v4163v1 to v4147v1, !71 + v4167v1 = get_local __ptr slice, slice, !73 + v4170v1 = get_local __ptr slice, data, !75 + mem_copy_val v4170v1, v4167v1 + v4172v1 = get_local __ptr slice, data, !77 + v4174v1 = get_local __ptr slice, self_00000, !80 + mem_copy_val v4174v1, v4172v1 + v4176v1 = get_local __ptr slice, self_00000, !83 + v4178v1 = get_local __ptr slice, slice_, !86 + mem_copy_val v4178v1, v4176v1 + v4180v1 = get_local __ptr slice, slice_, !88 + v4395v1 = asm(ptr: v4180v1) -> __ptr { ptr, u64 } ptr { } - v4426v1 = get_local __ptr { ptr, u64 }, __aggr_memcpy_00 - mem_copy_val v4426v1, v4394v1 - v4183v1 = get_local __ptr { ptr, u64 }, __anon_0, !89 - mem_copy_val v4183v1, v4426v1 - v295v1 = const u64 0 - v4185v1 = get_elem_ptr v4183v1, __ptr ptr, v295v1, !91 - v4186v1 = load v4185v1, !92 - v4396v1 = asm(s: v4186v1) -> __ptr string<3> s { + v4427v1 = get_local __ptr { ptr, u64 }, __aggr_memcpy_00 + mem_copy_val v4427v1, v4395v1 + v4184v1 = get_local __ptr { ptr, u64 }, __anon_0, !89 + mem_copy_val v4184v1, v4427v1 + v296v1 = const u64 0 + v4186v1 = get_elem_ptr v4184v1, __ptr ptr, v296v1, !91 + v4187v1 = load v4186v1, !92 + v4397v1 = asm(s: v4187v1) -> __ptr string<3> s { } - v4429v1 = get_local __ptr string<3>, __aggr_memcpy_01 - mem_copy_val v4429v1, v4396v1 - v1142v1 = const u64 0 - v4191v1 = get_elem_ptr v4136v1, __ptr string<3>, v1142v1, !93 - mem_copy_val v4191v1, v4429v1 - v4288v1 = load v4146v1, !100 - v4289v1 = asm(ptr: v4288v1, val) -> u64 val, !102 { + v4430v1 = get_local __ptr string<3>, __aggr_memcpy_01 + mem_copy_val v4430v1, v4397v1 + v1143v1 = const u64 0 + v4192v1 = get_elem_ptr v4137v1, __ptr string<3>, v1143v1, !93 + mem_copy_val v4192v1, v4430v1 + v4289v1 = load v4147v1, !100 + v4290v1 = asm(ptr: v4289v1, val) -> u64 val, !102 { lw val ptr i0, !103 } - v4291v1 = load v4146v1, !104 - v4292v1 = const u64 8, !105 - v4293v1 = add v4291v1, v4292v1, !106 - store v4293v1 to v4146v1, !108 - v371v1 = const u64 0, !109 - v4207v1 = cmp eq v4289v1 v371v1, !112 - cbr v4207v1, decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block0(), decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block1(), !113 + v4292v1 = load v4147v1, !104 + v4293v1 = const u64 8, !105 + v4294v1 = add v4292v1, v4293v1, !106 + store v4294v1 to v4147v1, !108 + v372v1 = const u64 0, !109 + v4208v1 = cmp eq v4290v1 v372v1, !112 + cbr v4208v1, decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block0(), decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block1(), !113 decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block0(): - v4229v1 = get_local __ptr { u64, ( u64 | u64 ) }, __anon_00, !116 - v375v1 = const u64 0 - v4230v1 = get_elem_ptr v4229v1, __ptr u64, v375v1, !117 - v373v1 = const u64 0, !115 - store v373v1 to v4230v1, !118 - v4298v1 = load v4146v1, !121 - v4299v1 = asm(ptr: v4298v1, val) -> u64 val, !122 { + v4230v1 = get_local __ptr { u64, ( u64 | u64 ) }, __anon_00, !116 + v376v1 = const u64 0 + v4231v1 = get_elem_ptr v4230v1, __ptr u64, v376v1, !117 + v374v1 = const u64 0, !115 + store v374v1 to v4231v1, !118 + v4299v1 = load v4147v1, !121 + v4300v1 = asm(ptr: v4299v1, val) -> u64 val, !122 { lw val ptr i0, !103 } - v4301v1 = load v4146v1, !123 - v4302v1 = const u64 8, !124 - v4303v1 = add v4301v1, v4302v1, !125 - store v4303v1 to v4146v1, !126 - v381v1 = const u64 1 - v382v1 = const u64 0 - v4234v1 = get_elem_ptr v4229v1, __ptr u64, v381v1, v382v1, !127 - store v4299v1 to v4234v1, !128 - v4321v1 = get_local __ptr { u64, ( u64 | u64 ) }, __tmp_block_arg - mem_copy_val v4321v1, v4229v1 - br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block5(v4321v1), !129 + v4302v1 = load v4147v1, !123 + v4303v1 = const u64 8, !124 + v4304v1 = add v4302v1, v4303v1, !125 + store v4304v1 to v4147v1, !126 + v382v1 = const u64 1 + v383v1 = const u64 0 + v4235v1 = get_elem_ptr v4230v1, __ptr u64, v382v1, v383v1, !127 + store v4300v1 to v4235v1, !128 + v4322v1 = get_local __ptr { u64, ( u64 | u64 ) }, __tmp_block_arg + mem_copy_val v4322v1, v4230v1 + br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block5(v4322v1), !129 decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block1(): - v388v1 = const u64 1, !130 - v4215v1 = cmp eq v4289v1 v388v1, !133 - cbr v4215v1, decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block2(), decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block3(), !134 + v389v1 = const u64 1, !130 + v4216v1 = cmp eq v4290v1 v389v1, !133 + cbr v4216v1, decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block2(), decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block3(), !134 decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block2(): - v4219v1 = get_local __ptr { u64, ( u64 | u64 ) }, __anon_1, !135 - v392v1 = const u64 0 - v4220v1 = get_elem_ptr v4219v1, __ptr u64, v392v1, !136 - v390v1 = const u64 1, !115 - store v390v1 to v4220v1, !137 - v4308v1 = load v4146v1, !140 - v4309v1 = asm(ptr: v4308v1, val) -> u64 val, !141 { + v4220v1 = get_local __ptr { u64, ( u64 | u64 ) }, __anon_1, !135 + v393v1 = const u64 0 + v4221v1 = get_elem_ptr v4220v1, __ptr u64, v393v1, !136 + v391v1 = const u64 1, !115 + store v391v1 to v4221v1, !137 + v4309v1 = load v4147v1, !140 + v4310v1 = asm(ptr: v4309v1, val) -> u64 val, !141 { lw val ptr i0, !103 } - v4311v1 = load v4146v1, !142 - v4312v1 = const u64 8, !143 - v4313v1 = add v4311v1, v4312v1, !144 - store v4313v1 to v4146v1, !145 - v398v1 = const u64 1 + v4312v1 = load v4147v1, !142 + v4313v1 = const u64 8, !143 + v4314v1 = add v4312v1, v4313v1, !144 + store v4314v1 to v4147v1, !145 v399v1 = const u64 1 - v4224v1 = get_elem_ptr v4219v1, __ptr u64, v398v1, v399v1, !146 - store v4309v1 to v4224v1, !147 - v4319v1 = get_local __ptr { u64, ( u64 | u64 ) }, __tmp_block_arg - mem_copy_val v4319v1, v4219v1 - br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block5(v4319v1), !148 + v400v1 = const u64 1 + v4225v1 = get_elem_ptr v4220v1, __ptr u64, v399v1, v400v1, !146 + store v4310v1 to v4225v1, !147 + v4320v1 = get_local __ptr { u64, ( u64 | u64 ) }, __tmp_block_arg + mem_copy_val v4320v1, v4220v1 + br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block5(v4320v1), !148 decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block3(): - v403v1 = const u64 0, !149 - revert v403v1, !151 + v404v1 = const u64 0, !149 + revert v404v1, !151 - decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block5(v4317v1: __ptr { u64, ( u64 | u64 ) }): - v1136v1 = const u64 0 - v4239v1 = get_elem_ptr v4133v1, __ptr { string<3> }, v1136v1, !152 - mem_copy_val v4239v1, v4136v1 - v1139v1 = const u64 1 - v4241v1 = get_elem_ptr v4133v1, __ptr { u64, ( u64 | u64 ) }, v1139v1, !153 - mem_copy_val v4241v1, v4317v1 - v4436v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, __aggr_memcpy_02 - mem_copy_val v4436v1, v4133v1 - mem_copy_val v4127v1, v4436v1 - v444v1 = const u64 1, !154 - v4253v1 = add v4022v1, v444v1, !157 - br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while(v4253v1), !158 + decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_decode_18_abi_decode_19_abi_decode_26_block5(v4318v1: __ptr { u64, ( u64 | u64 ) }): + v1137v1 = const u64 0 + v4240v1 = get_elem_ptr v4134v1, __ptr { string<3> }, v1137v1, !152 + mem_copy_val v4240v1, v4137v1 + v1140v1 = const u64 1 + v4242v1 = get_elem_ptr v4134v1, __ptr { u64, ( u64 | u64 ) }, v1140v1, !153 + mem_copy_val v4242v1, v4318v1 + v4437v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, __aggr_memcpy_02 + mem_copy_val v4437v1, v4134v1 + mem_copy_val v4128v1, v4437v1 + v445v1 = const u64 1, !154 + v4254v1 = add v4023v1, v445v1, !157 + br decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_while(v4254v1), !158 decode_script_data_0_decode_from_raw_ptr_1_abi_decode_15_abi_decode_16_end_while(): - v1133v1 = const u64 0 - v4120v1 = get_elem_ptr v4095v1, __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], v1133v1, !159 - mem_copy_val v4120v1, v4105v1 - v480v1 = get_local __ptr { [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] }, args, !160 - mem_copy_val v480v1, v4095v1 - v1097v1 = get_local __ptr { [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] }, args, !161 - v1098v1 = const u64 0 - v1099v1 = get_elem_ptr v1097v1, __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], v1098v1, !162 - v4325v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], __tmp_arg - mem_copy_val v4325v1, v1099v1 - v4373v1 = get_local __ptr { u64 }, __ret_val - v4374v1 = call main_32(v4325v1, v4373v1) - v1102v1 = get_local __ptr { u64 }, _result, !163 - mem_copy_val v1102v1, v4373v1 - v1121v1 = get_local __ptr { u64 }, _result, !164 - v1112v1 = const u64 8 - retd v1121v1 v1112v1, !168 + v1134v1 = const u64 0 + v4121v1 = get_elem_ptr v4096v1, __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], v1134v1, !159 + mem_copy_val v4121v1, v4106v1 + v481v1 = get_local __ptr { [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] }, args, !160 + mem_copy_val v481v1, v4096v1 + v1098v1 = get_local __ptr { [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2] }, args, !161 + v1099v1 = const u64 0 + v1100v1 = get_elem_ptr v1098v1, __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], v1099v1, !162 + v4326v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], __tmp_arg + mem_copy_val v4326v1, v1100v1 + v4374v1 = get_local __ptr { u64 }, __ret_val + v4375v1 = call main_32(v4326v1, v4374v1) + v1103v1 = get_local __ptr { u64 }, _result, !163 + mem_copy_val v1103v1, v4374v1 + v1122v1 = get_local __ptr { u64 }, _result, !164 + v1113v1 = const u64 8 + retd v1122v1 v1113v1, !168 } entry_orig fn main_32(ops: __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], __ret_value: __ptr { u64 }) -> (), !171 { @@ -295,431 +295,431 @@ script { local { { ptr, u64, u64 } } self_3 entry(ops: __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], __ret_value: __ptr { u64 }): - v483v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_ - mem_copy_val v483v1, ops - v897v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !172 - v3687v1 = const bool false, !181 - cbr v3687v1, encode_allow_alias_33_block0(), encode_allow_alias_33_block1(), !182 + v484v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_ + mem_copy_val v484v1, ops + v898v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !172 + v3688v1 = const bool false, !181 + cbr v3688v1, encode_allow_alias_33_block0(), encode_allow_alias_33_block1(), !182 encode_allow_alias_33_block0(): - v3958v1 = get_local __ptr { __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], u64 }, __tuple_init_0, !184 - v1154v1 = const u64 0 - v3961v1 = get_elem_ptr v3958v1, __ptr __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], v1154v1, !185 - store v897v1 to v3961v1, !186 - v1157v1 = const u64 1 - v3963v1 = get_elem_ptr v3958v1, __ptr u64, v1157v1, !187 - v539v1 = const u64 48 - store v539v1 to v3963v1, !188 - v3966v1 = get_local __ptr { __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], u64 }, __anon_00, !172 - mem_copy_val v3966v1, v3958v1 - v3968v1 = cast_ptr v3966v1 to __ptr slice, !172 - v4336v1 = get_local __ptr slice, __tmp_block_arg0 - mem_copy_val v4336v1, v3968v1 - br encode_allow_alias_33_block2(v4336v1), !172 + v3959v1 = get_local __ptr { __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], u64 }, __tuple_init_0, !184 + v1155v1 = const u64 0 + v3962v1 = get_elem_ptr v3959v1, __ptr __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], v1155v1, !185 + store v898v1 to v3962v1, !186 + v1158v1 = const u64 1 + v3964v1 = get_elem_ptr v3959v1, __ptr u64, v1158v1, !187 + v540v1 = const u64 48 + store v540v1 to v3964v1, !188 + v3967v1 = get_local __ptr { __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], u64 }, __anon_00, !172 + mem_copy_val v3967v1, v3959v1 + v3969v1 = cast_ptr v3967v1 to __ptr slice, !172 + v4337v1 = get_local __ptr slice, __tmp_block_arg0 + mem_copy_val v4337v1, v3969v1 + br encode_allow_alias_33_block2(v4337v1), !172 encode_allow_alias_33_block1(): - v3728v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_00, !192 - v840v1 = const u64 1024 - v3729v1 = asm(cap: v840v1) -> ptr hp, !193 { + v3729v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_00, !192 + v841v1 = const u64 1024 + v3730v1 = asm(cap: v841v1) -> ptr hp, !193 { aloc cap } - v3730v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !194 - v844v1 = const u64 0 - v3731v1 = get_elem_ptr v3730v1, __ptr ptr, v844v1, !195 - store v3729v1 to v3731v1, !196 - v847v1 = const u64 1 - v3733v1 = get_elem_ptr v3730v1, __ptr u64, v847v1, !197 - store v840v1 to v3733v1, !198 - v850v1 = const u64 2 - v3735v1 = get_elem_ptr v3730v1, __ptr u64, v850v1, !199 - v842v1 = const u64 0 - store v842v1 to v3735v1, !200 - v4401v1 = asm(buffer: v3730v1) -> __ptr { ptr, u64, u64 } buffer { + v3731v1 = get_local __ptr { ptr, u64, u64 }, __anon_000, !194 + v845v1 = const u64 0 + v3732v1 = get_elem_ptr v3731v1, __ptr ptr, v845v1, !195 + store v3730v1 to v3732v1, !196 + v848v1 = const u64 1 + v3734v1 = get_elem_ptr v3731v1, __ptr u64, v848v1, !197 + store v841v1 to v3734v1, !198 + v851v1 = const u64 2 + v3736v1 = get_elem_ptr v3731v1, __ptr u64, v851v1, !199 + v843v1 = const u64 0 + store v843v1 to v3736v1, !200 + v4402v1 = asm(buffer: v3731v1) -> __ptr { ptr, u64, u64 } buffer { } - v4446v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v4446v1, v4401v1 - v1166v1 = const u64 0 - v3738v1 = get_elem_ptr v3728v1, __ptr { ptr, u64, u64 }, v1166v1, !201 - mem_copy_val v3738v1, v4446v1 - v3742v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], self_2, !204 - mem_copy_val v3742v1, v897v1 - v3744v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !205 - mem_copy_val v3744v1, v3728v1 - v3746v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !207 - v3748v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !209 - mem_copy_val v3748v1, v3746v1 - v563v1 = const u64 0, !210 - br encode_allow_alias_33_abi_encode_46_while(v563v1), !211 + v4447v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v4447v1, v4402v1 + v1167v1 = const u64 0 + v3739v1 = get_elem_ptr v3729v1, __ptr { ptr, u64, u64 }, v1167v1, !201 + mem_copy_val v3739v1, v4447v1 + v3743v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], self_2, !204 + mem_copy_val v3743v1, v898v1 + v3745v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !205 + mem_copy_val v3745v1, v3729v1 + v3747v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !207 + v3749v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !209 + mem_copy_val v3749v1, v3747v1 + v564v1 = const u64 0, !210 + br encode_allow_alias_33_abi_encode_46_while(v564v1), !211 - encode_allow_alias_33_abi_encode_46_while(v3666v1: u64): - v569v1 = const u64 2 - v3757v1 = cmp lt v3666v1 v569v1, !214 - cbr v3757v1, encode_allow_alias_33_abi_encode_46_while_body(), encode_allow_alias_33_abi_encode_46_end_while(), !215 + encode_allow_alias_33_abi_encode_46_while(v3667v1: u64): + v570v1 = const u64 2 + v3758v1 = cmp lt v3667v1 v570v1, !214 + cbr v3758v1, encode_allow_alias_33_abi_encode_46_while_body(), encode_allow_alias_33_abi_encode_46_end_while(), !215 encode_allow_alias_33_abi_encode_46_while_body(): - v3789v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], self_2, !217 - v3791v1 = get_elem_ptr v3789v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v3666v1, !219 - v3793v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !221 - v3795v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, self_10, !224 - mem_copy_val v3795v1, v3791v1 - v3797v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !225 - mem_copy_val v3797v1, v3793v1 - v3799v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, self_10, !227 - v654v1 = const u64 0 - v3800v1 = get_elem_ptr v3799v1, __ptr { string<3> }, v654v1, !229 - v3802v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !231 - v3804v1 = get_local __ptr { string<3> }, self_000, !234 - mem_copy_val v3804v1, v3800v1 - v3806v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_00, !235 - mem_copy_val v3806v1, v3802v1 - v3808v1 = get_local __ptr { string<3> }, self_000, !237 - v642v1 = const u64 0 - v3809v1 = get_elem_ptr v3808v1, __ptr string<3>, v642v1, !239 - v3811v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_00, !241 - v3813v1 = get_local __ptr string<3>, self_0000, !244 - mem_copy_val v3813v1, v3809v1 - v3815v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_000, !245 - mem_copy_val v3815v1, v3811v1 - v3817v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_000, !247 - v3818v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_000, !249 - v591v1 = const u64 0 - v3819v1 = get_elem_ptr v3818v1, __ptr { ptr, u64, u64 }, v591v1, !251 - v4403v1 = asm(buffer: v3819v1) -> __ptr { ptr, u64, u64 } buffer { + v3790v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], self_2, !217 + v3792v1 = get_elem_ptr v3790v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v3667v1, !219 + v3794v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !221 + v3796v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, self_10, !224 + mem_copy_val v3796v1, v3792v1 + v3798v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !225 + mem_copy_val v3798v1, v3794v1 + v3800v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, self_10, !227 + v655v1 = const u64 0 + v3801v1 = get_elem_ptr v3800v1, __ptr { string<3> }, v655v1, !229 + v3803v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_0, !231 + v3805v1 = get_local __ptr { string<3> }, self_000, !234 + mem_copy_val v3805v1, v3801v1 + v3807v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_00, !235 + mem_copy_val v3807v1, v3803v1 + v3809v1 = get_local __ptr { string<3> }, self_000, !237 + v643v1 = const u64 0 + v3810v1 = get_elem_ptr v3809v1, __ptr string<3>, v643v1, !239 + v3812v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_00, !241 + v3814v1 = get_local __ptr string<3>, self_0000, !244 + mem_copy_val v3814v1, v3810v1 + v3816v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_000, !245 + mem_copy_val v3816v1, v3812v1 + v3818v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_000, !247 + v3819v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_000, !249 + v592v1 = const u64 0 + v3820v1 = get_elem_ptr v3819v1, __ptr { ptr, u64, u64 }, v592v1, !251 + v4404v1 = asm(buffer: v3820v1) -> __ptr { ptr, u64, u64 } buffer { } - v4458v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 - mem_copy_val v4458v1, v4403v1 - v3822v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !252 - mem_copy_val v3822v1, v4458v1 - v597v1 = const u64 0 - v3824v1 = get_elem_ptr v3822v1, __ptr ptr, v597v1, !253 - v3825v1 = load v3824v1, !254 - v600v1 = const u64 1 - v3826v1 = get_elem_ptr v3822v1, __ptr u64, v600v1, !255 - v3827v1 = load v3826v1, !256 - v603v1 = const u64 2 - v3828v1 = get_elem_ptr v3822v1, __ptr u64, v603v1, !257 - v3829v1 = load v3828v1, !258 - v3830v1 = get_local __ptr string<3>, self_0000, !260 - v608v1 = const u64 3 - v3832v1 = add v3829v1, v608v1, !261 - v3833v1 = cmp gt v3832v1 v3827v1, !262 - cbr v3833v1, encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block1(), encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block0(v3825v1, v3827v1), !263 + v4459v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v4459v1, v4404v1 + v3823v1 = get_local __ptr { ptr, u64, u64 }, __anon_01, !252 + mem_copy_val v3823v1, v4459v1 + v598v1 = const u64 0 + v3825v1 = get_elem_ptr v3823v1, __ptr ptr, v598v1, !253 + v3826v1 = load v3825v1, !254 + v601v1 = const u64 1 + v3827v1 = get_elem_ptr v3823v1, __ptr u64, v601v1, !255 + v3828v1 = load v3827v1, !256 + v604v1 = const u64 2 + v3829v1 = get_elem_ptr v3823v1, __ptr u64, v604v1, !257 + v3830v1 = load v3829v1, !258 + v3831v1 = get_local __ptr string<3>, self_0000, !260 + v609v1 = const u64 3 + v3833v1 = add v3830v1, v609v1, !261 + v3834v1 = cmp gt v3833v1 v3828v1, !262 + cbr v3834v1, encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block1(), encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block0(v3826v1, v3828v1), !263 - encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block0(v3668v1: ptr, v3669v1: u64): - v3840v1 = get_local __ptr string<3>, __anon_10, !264 - mem_copy_val v3840v1, v3830v1 - v3842v1 = add v3668v1, v3829v1, !265 - v3843v1 = cast_ptr v3842v1 to __ptr u8, !266 - mem_copy_bytes v3843v1, v3840v1, 3, !267 - v3846v1 = get_local __ptr { ptr, u64, u64 }, __anon_20, !268 - v628v1 = const u64 0 - v3847v1 = get_elem_ptr v3846v1, __ptr ptr, v628v1, !269 - store v3668v1 to v3847v1, !270 - v631v1 = const u64 1 - v3849v1 = get_elem_ptr v3846v1, __ptr u64, v631v1, !271 - store v3669v1 to v3849v1, !272 - v634v1 = const u64 2 - v3851v1 = get_elem_ptr v3846v1, __ptr u64, v634v1, !273 - store v3832v1 to v3851v1, !274 - v4405v1 = asm(buffer: v3846v1) -> __ptr { ptr, u64, u64 } buffer { + encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block0(v3669v1: ptr, v3670v1: u64): + v3841v1 = get_local __ptr string<3>, __anon_10, !264 + mem_copy_val v3841v1, v3831v1 + v3843v1 = add v3669v1, v3830v1, !265 + v3844v1 = cast_ptr v3843v1 to __ptr u8, !266 + mem_copy_bytes v3844v1, v3841v1, 3, !267 + v3847v1 = get_local __ptr { ptr, u64, u64 }, __anon_20, !268 + v629v1 = const u64 0 + v3848v1 = get_elem_ptr v3847v1, __ptr ptr, v629v1, !269 + store v3669v1 to v3848v1, !270 + v632v1 = const u64 1 + v3850v1 = get_elem_ptr v3847v1, __ptr u64, v632v1, !271 + store v3670v1 to v3850v1, !272 + v635v1 = const u64 2 + v3852v1 = get_elem_ptr v3847v1, __ptr u64, v635v1, !273 + store v3833v1 to v3852v1, !274 + v4406v1 = asm(buffer: v3847v1) -> __ptr { ptr, u64, u64 } buffer { } - v4462v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 - mem_copy_val v4462v1, v4405v1 - v1160v1 = const u64 0 - v3854v1 = get_elem_ptr v3817v1, __ptr { ptr, u64, u64 }, v1160v1, !275 - mem_copy_val v3854v1, v4462v1 - v3858v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__00, !277 - mem_copy_val v3858v1, v3817v1 - v3860v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__00, !279 - v3863v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !281 - mem_copy_val v3863v1, v3860v1 - v3865v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, self_10, !283 - v799v1 = const u64 1 - v3866v1 = get_elem_ptr v3865v1, __ptr { u64, ( u64 | u64 ) }, v799v1, !285 - v3868v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !287 - v3870v1 = get_local __ptr { u64, ( u64 | u64 ) }, self_100, !290 - mem_copy_val v3870v1, v3866v1 - v3872v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !291 - mem_copy_val v3872v1, v3868v1 - v3874v1 = get_local __ptr { u64, ( u64 | u64 ) }, self_100, !293 - v3876v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !295 - mem_copy_val v3876v1, v3874v1 - v3878v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !296 - v673v1 = const u64 0 - v3879v1 = get_elem_ptr v3878v1, __ptr u64, v673v1, !297 - v3880v1 = load v3879v1, !298 - v676v1 = const u64 0, !292 - v3885v1 = cmp eq v3880v1 v676v1, !301 - cbr v3885v1, encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block0(), encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block1(), !302 + v4463v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_01 + mem_copy_val v4463v1, v4406v1 + v1161v1 = const u64 0 + v3855v1 = get_elem_ptr v3818v1, __ptr { ptr, u64, u64 }, v1161v1, !275 + mem_copy_val v3855v1, v4463v1 + v3859v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__00, !277 + mem_copy_val v3859v1, v3818v1 + v3861v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__00, !279 + v3864v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !281 + mem_copy_val v3864v1, v3861v1 + v3866v1 = get_local __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, self_10, !283 + v800v1 = const u64 1 + v3867v1 = get_elem_ptr v3866v1, __ptr { u64, ( u64 | u64 ) }, v800v1, !285 + v3869v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__0, !287 + v3871v1 = get_local __ptr { u64, ( u64 | u64 ) }, self_100, !290 + mem_copy_val v3871v1, v3867v1 + v3873v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !291 + mem_copy_val v3873v1, v3869v1 + v3875v1 = get_local __ptr { u64, ( u64 | u64 ) }, self_100, !293 + v3877v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !295 + mem_copy_val v3877v1, v3875v1 + v3879v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !296 + v674v1 = const u64 0 + v3880v1 = get_elem_ptr v3879v1, __ptr u64, v674v1, !297 + v3881v1 = load v3880v1, !298 + v677v1 = const u64 0, !292 + v3886v1 = cmp eq v3881v1 v677v1, !301 + cbr v3886v1, encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block0(), encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block1(), !302 encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block1(): - v614v1 = const u64 2 - v3836v1 = mul v3827v1, v614v1, !303 - v3837v1 = add v3836v1, v608v1, !304 - v3838v1 = asm(new_cap: v3837v1, old_ptr: v3825v1, len: v3829v1) -> __ptr u8 hp, !305 { + v615v1 = const u64 2 + v3837v1 = mul v3828v1, v615v1, !303 + v3838v1 = add v3837v1, v609v1, !304 + v3839v1 = asm(new_cap: v3838v1, old_ptr: v3826v1, len: v3830v1) -> __ptr u8 hp, !305 { aloc new_cap mcp hp old_ptr len } - br encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block0(v3838v1, v3837v1), !306 + br encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_48_abi_encode_49_block0(v3839v1, v3838v1), !306 encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block0(): - v3918v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !307 - v679v1 = const u64 1 - v680v1 = const u64 0 - v3919v1 = get_elem_ptr v3918v1, __ptr u64, v679v1, v680v1, !308 - v3920v1 = load v3919v1, !309 - v3922v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !311 - v4342v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg - mem_copy_val v4342v1, v3922v1 - v4380v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val - v741v1 = const u64 0, !312 - v4381v1 = call abi_encode_51(v741v1, v4342v1, v4380v1) - v3925v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__1, !314 - mem_copy_val v3925v1, v4380v1 - v3928v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__1, !316 - v4345v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg0 - mem_copy_val v4345v1, v3928v1 - v4383v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val0 - v4384v1 = call abi_encode_51(v3920v1, v4345v1, v4383v1) - v3931v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___0, !318 - mem_copy_val v3931v1, v4383v1 - v3933v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___0, !320 - v4332v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - mem_copy_val v4332v1, v3933v1 - br encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block5(v4332v1), !321 + v3919v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !307 + v680v1 = const u64 1 + v681v1 = const u64 0 + v3920v1 = get_elem_ptr v3919v1, __ptr u64, v680v1, v681v1, !308 + v3921v1 = load v3920v1, !309 + v3923v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !311 + v4343v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg + mem_copy_val v4343v1, v3923v1 + v4381v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val + v742v1 = const u64 0, !312 + v4382v1 = call abi_encode_51(v742v1, v4343v1, v4381v1) + v3926v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__1, !314 + mem_copy_val v3926v1, v4381v1 + v3929v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__1, !316 + v4346v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg0 + mem_copy_val v4346v1, v3929v1 + v4384v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val0 + v4385v1 = call abi_encode_51(v3921v1, v4346v1, v4384v1) + v3932v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___0, !318 + mem_copy_val v3932v1, v4384v1 + v3934v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___0, !320 + v4333v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg + mem_copy_val v4333v1, v3934v1 + br encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block5(v4333v1), !321 encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block1(): - v3888v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !322 - v757v1 = const u64 0 - v3889v1 = get_elem_ptr v3888v1, __ptr u64, v757v1, !323 - v3890v1 = load v3889v1, !324 - v760v1 = const u64 1, !292 - v3895v1 = cmp eq v3890v1 v760v1, !327 - cbr v3895v1, encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block2(), encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block3(), !328 + v3889v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !322 + v758v1 = const u64 0 + v3890v1 = get_elem_ptr v3889v1, __ptr u64, v758v1, !323 + v3891v1 = load v3890v1, !324 + v761v1 = const u64 1, !292 + v3896v1 = cmp eq v3891v1 v761v1, !327 + cbr v3896v1, encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block2(), encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block3(), !328 encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block2(): - v3899v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !329 - v763v1 = const u64 1 + v3900v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_10, !329 v764v1 = const u64 1 - v3900v1 = get_elem_ptr v3899v1, __ptr u64, v763v1, v764v1, !330 - v3901v1 = load v3900v1, !331 - v3903v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !333 - v4348v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg1 - mem_copy_val v4348v1, v3903v1 - v4386v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val1 - v769v1 = const u64 1, !334 - v4387v1 = call abi_encode_51(v769v1, v4348v1, v4386v1) - v3906v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !336 - mem_copy_val v3906v1, v4386v1 - v3909v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !338 - v4351v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg2 - mem_copy_val v4351v1, v3909v1 - v4389v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val2 - v4390v1 = call abi_encode_51(v3901v1, v4351v1, v4389v1) - v3912v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !340 - mem_copy_val v3912v1, v4389v1 - v3914v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !342 - v4330v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg - mem_copy_val v4330v1, v3914v1 - br encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block5(v4330v1), !343 + v765v1 = const u64 1 + v3901v1 = get_elem_ptr v3900v1, __ptr u64, v764v1, v765v1, !330 + v3902v1 = load v3901v1, !331 + v3904v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_1, !333 + v4349v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg1 + mem_copy_val v4349v1, v3904v1 + v4387v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val1 + v770v1 = const u64 1, !334 + v4388v1 = call abi_encode_51(v770v1, v4349v1, v4387v1) + v3907v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !336 + mem_copy_val v3907v1, v4387v1 + v3910v1 = get_local __ptr { { ptr, u64, u64 } }, buffer____, !338 + v4352v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_arg2 + mem_copy_val v4352v1, v3910v1 + v4390v1 = get_local __ptr { { ptr, u64, u64 } }, __ret_val2 + v4391v1 = call abi_encode_51(v3902v1, v4352v1, v4390v1) + v3913v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !340 + mem_copy_val v3913v1, v4390v1 + v3915v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_____, !342 + v4331v1 = get_local __ptr { { ptr, u64, u64 } }, __tmp_block_arg + mem_copy_val v4331v1, v3915v1 + br encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block5(v4331v1), !343 encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block3(): - v784v1 = const u64 14757395258967588866, !294 - revert v784v1, !344 + v785v1 = const u64 14757395258967588866, !294 + revert v785v1, !344 - encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block5(v4328v1: __ptr { { ptr, u64, u64 } }): - v3936v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !346 - mem_copy_val v3936v1, v4328v1 - v3938v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !348 - v3941v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !350 - mem_copy_val v3941v1, v3938v1 - v3943v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !352 - v3946v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !354 - mem_copy_val v3946v1, v3943v1 - v823v1 = const u64 1, !355 - v3953v1 = add v3666v1, v823v1, !358 - br encode_allow_alias_33_abi_encode_46_while(v3953v1), !359 + encode_allow_alias_33_abi_encode_46_abi_encode_47_abi_encode_50_block5(v4329v1: __ptr { { ptr, u64, u64 } }): + v3937v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !346 + mem_copy_val v3937v1, v4329v1 + v3939v1 = get_local __ptr { { ptr, u64, u64 } }, buffer______, !348 + v3942v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !350 + mem_copy_val v3942v1, v3939v1 + v3944v1 = get_local __ptr { { ptr, u64, u64 } }, buffer___, !352 + v3947v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !354 + mem_copy_val v3947v1, v3944v1 + v824v1 = const u64 1, !355 + v3954v1 = add v3667v1, v824v1, !358 + br encode_allow_alias_33_abi_encode_46_while(v3954v1), !359 encode_allow_alias_33_abi_encode_46_end_while(): - v3760v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !361 - v3763v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !363 - mem_copy_val v3763v1, v3760v1 - v3765v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !365 - v3767v1 = get_local __ptr { { ptr, u64, u64 } }, self_3, !368 - mem_copy_val v3767v1, v3765v1 - v3769v1 = get_local __ptr { { ptr, u64, u64 } }, self_3, !370 - v865v1 = const u64 0 - v3770v1 = get_elem_ptr v3769v1, __ptr { ptr, u64, u64 }, v865v1, !371 - v4407v1 = asm(buffer: v3770v1) -> __ptr { ptr, u64, u64 } buffer { + v3761v1 = get_local __ptr { { ptr, u64, u64 } }, buffer__, !361 + v3764v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !363 + mem_copy_val v3764v1, v3761v1 + v3766v1 = get_local __ptr { { ptr, u64, u64 } }, buffer, !365 + v3768v1 = get_local __ptr { { ptr, u64, u64 } }, self_3, !368 + mem_copy_val v3768v1, v3766v1 + v3770v1 = get_local __ptr { { ptr, u64, u64 } }, self_3, !370 + v866v1 = const u64 0 + v3771v1 = get_elem_ptr v3770v1, __ptr { ptr, u64, u64 }, v866v1, !371 + v4408v1 = asm(buffer: v3771v1) -> __ptr { ptr, u64, u64 } buffer { } - v4485v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 - mem_copy_val v4485v1, v4407v1 - v3773v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !372 - mem_copy_val v3773v1, v4485v1 - v871v1 = const u64 0 - v3775v1 = get_elem_ptr v3773v1, __ptr ptr, v871v1, !373 - v877v1 = const u64 2 - v3779v1 = get_elem_ptr v3773v1, __ptr u64, v877v1, !374 - v3781v1 = get_local __ptr { ptr, u64 }, __anon_100, !375 - v881v1 = const u64 0 - v3782v1 = get_elem_ptr v3781v1, __ptr ptr, v881v1, !376 - mem_copy_val v3782v1, v3775v1 - v884v1 = const u64 1 - v3784v1 = get_elem_ptr v3781v1, __ptr u64, v884v1, !377 - mem_copy_val v3784v1, v3779v1 - v4409v1 = asm(s: v3781v1) -> __ptr slice s { + v4486v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_02 + mem_copy_val v4486v1, v4408v1 + v3774v1 = get_local __ptr { ptr, u64, u64 }, __anon_02, !372 + mem_copy_val v3774v1, v4486v1 + v872v1 = const u64 0 + v3776v1 = get_elem_ptr v3774v1, __ptr ptr, v872v1, !373 + v878v1 = const u64 2 + v3780v1 = get_elem_ptr v3774v1, __ptr u64, v878v1, !374 + v3782v1 = get_local __ptr { ptr, u64 }, __anon_100, !375 + v882v1 = const u64 0 + v3783v1 = get_elem_ptr v3782v1, __ptr ptr, v882v1, !376 + mem_copy_val v3783v1, v3776v1 + v885v1 = const u64 1 + v3785v1 = get_elem_ptr v3782v1, __ptr u64, v885v1, !377 + mem_copy_val v3785v1, v3780v1 + v4410v1 = asm(s: v3782v1) -> __ptr slice s { } - v4490v1 = get_local __ptr slice, __aggr_memcpy_03 - mem_copy_val v4490v1, v4409v1 - v4338v1 = get_local __ptr slice, __tmp_block_arg0 - mem_copy_val v4338v1, v4490v1 - br encode_allow_alias_33_block2(v4338v1), !172 + v4491v1 = get_local __ptr slice, __aggr_memcpy_03 + mem_copy_val v4491v1, v4410v1 + v4339v1 = get_local __ptr slice, __tmp_block_arg0 + mem_copy_val v4339v1, v4491v1 + br encode_allow_alias_33_block2(v4339v1), !172 - encode_allow_alias_33_block2(v4334v1: __ptr slice): - v4398v1 = get_local __ptr slice, __log_arg - mem_copy_val v4398v1, v4334v1 - v899v1 = const u64 3647243719605075626 - log __ptr slice v4398v1, v899v1 - v980v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !378 - v981v1 = const u64 0, !379 - v982v1 = get_elem_ptr v980v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v981v1, !380 - v983v1 = const u64 0 - v984v1 = get_elem_ptr v982v1, __ptr { string<3> }, v983v1, !381 - v985v1 = const u64 0 - v986v1 = get_elem_ptr v984v1, __ptr string<3>, v985v1, !238 - v989v1 = get_global __ptr string<3>, __const_global - v990v1 = cast_ptr v989v1 to ptr, !382 - v992v1 = get_local __ptr { ptr, u64 }, __anon_0, !382 - v993v1 = const u64 0 - v994v1 = get_elem_ptr v992v1, __ptr ptr, v993v1 - store v990v1 to v994v1, !382 - v996v1 = const u64 1 - v997v1 = get_elem_ptr v992v1, __ptr u64, v996v1 - v991v1 = const u64 3 - store v991v1 to v997v1, !382 - v999v1 = get_local __ptr slice, __anon_1, !382 - mem_copy_bytes v999v1, v992v1, 16 - v4358v1 = get_local __ptr string<3>, __tmp_arg3 - mem_copy_val v4358v1, v986v1 - v4360v1 = get_local __ptr slice, __tmp_arg4 - mem_copy_val v4360v1, v999v1 - v4362v1 = call eq_str_3_57(v4358v1, v4360v1) - v910v1 = const bool false, !384 - v1003v3 = cmp eq v4362v1 v910v1, !390 - cbr v1003v3, assert_54_block0(), assert_54_block1(), !391 + encode_allow_alias_33_block2(v4335v1: __ptr slice): + v4399v1 = get_local __ptr slice, __log_arg + mem_copy_val v4399v1, v4335v1 + v900v1 = const u64 3647243719605075626 + log __ptr slice v4399v1, v900v1 + v981v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !378 + v982v1 = const u64 0, !379 + v983v1 = get_elem_ptr v981v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v982v1, !380 + v984v1 = const u64 0 + v985v1 = get_elem_ptr v983v1, __ptr { string<3> }, v984v1, !381 + v986v1 = const u64 0 + v987v1 = get_elem_ptr v985v1, __ptr string<3>, v986v1, !238 + v990v1 = get_global __ptr string<3>, __const_global + v991v1 = cast_ptr v990v1 to ptr, !382 + v993v1 = get_local __ptr { ptr, u64 }, __anon_0, !382 + v994v1 = const u64 0 + v995v1 = get_elem_ptr v993v1, __ptr ptr, v994v1 + store v991v1 to v995v1, !382 + v997v1 = const u64 1 + v998v1 = get_elem_ptr v993v1, __ptr u64, v997v1 + v992v1 = const u64 3 + store v992v1 to v998v1, !382 + v1000v1 = get_local __ptr slice, __anon_1, !382 + mem_copy_bytes v1000v1, v993v1, 16 + v4359v1 = get_local __ptr string<3>, __tmp_arg3 + mem_copy_val v4359v1, v987v1 + v4361v1 = get_local __ptr slice, __tmp_arg4 + mem_copy_val v4361v1, v1000v1 + v4363v1 = call eq_str_3_57(v4359v1, v4361v1) + v911v1 = const bool false, !384 + v1004v3 = cmp eq v4363v1 v911v1, !390 + cbr v1004v3, assert_54_block0(), assert_54_block1(), !391 assert_54_block0(): - v1171v1 = const u64 18446744073709486084 - revert v1171v1, !396 + v1172v1 = const u64 18446744073709486084 + revert v1172v1, !396 assert_54_block1(): - v1004v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !397 - v1005v1 = const u64 0, !398 - v1006v1 = get_elem_ptr v1004v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v1005v1, !399 - v1007v1 = const u64 1 - v1008v1 = get_elem_ptr v1006v1, __ptr { u64, ( u64 | u64 ) }, v1007v1, !400 - v1010v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_1, !401 - mem_copy_val v1010v1, v1008v1 - v1012v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_1, !402 - v1013v1 = const u64 0 - v1014v1 = get_elem_ptr v1012v1, __ptr u64, v1013v1, !402 - v1015v1 = load v1014v1 - v1016v1 = const u64 0, !402 - v3976v1 = cmp eq v1015v1 v1016v1, !405 - cbr v3976v1, block0(), block1(), !403 + v1005v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !397 + v1006v1 = const u64 0, !398 + v1007v1 = get_elem_ptr v1005v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v1006v1, !399 + v1008v1 = const u64 1 + v1009v1 = get_elem_ptr v1007v1, __ptr { u64, ( u64 | u64 ) }, v1008v1, !400 + v1011v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_1, !401 + mem_copy_val v1011v1, v1009v1 + v1013v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_1, !402 + v1014v1 = const u64 0 + v1015v1 = get_elem_ptr v1013v1, __ptr u64, v1014v1, !402 + v1016v1 = load v1015v1 + v1017v1 = const u64 0, !402 + v3977v1 = cmp eq v1016v1 v1017v1, !405 + cbr v3977v1, block0(), block1(), !403 block0(): - v1018v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_1, !402 - v1019v1 = const u64 1 - v1020v1 = const u64 0 - v1021v1 = get_elem_ptr v1018v1, __ptr u64, v1019v1, v1020v1 - v1022v1 = load v1021v1 - v1033v1 = const u64 1338, !406 - v3985v1 = cmp eq v1022v1 v1033v1, !409 - v1035v3 = cmp eq v3985v1 v910v1, !412 - cbr v1035v3, assert_54_block015(), assert_54_block116(), !413 + v1019v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_1, !402 + v1020v1 = const u64 1 + v1021v1 = const u64 0 + v1022v1 = get_elem_ptr v1019v1, __ptr u64, v1020v1, v1021v1 + v1023v1 = load v1022v1 + v1034v1 = const u64 1338, !406 + v3986v1 = cmp eq v1023v1 v1034v1, !409 + v1036v3 = cmp eq v3986v1 v911v1, !412 + cbr v1036v3, assert_54_block015(), assert_54_block116(), !413 assert_54_block015(): - revert v1171v1, !414 + revert v1172v1, !414 assert_54_block116(): - v1036v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !415 - v1037v1 = const u64 1, !416 - v1038v1 = get_elem_ptr v1036v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v1037v1, !417 - v1039v1 = const u64 0 - v1040v1 = get_elem_ptr v1038v1, __ptr { string<3> }, v1039v1, !418 - v1041v1 = const u64 0 - v1042v1 = get_elem_ptr v1040v1, __ptr string<3>, v1041v1, !238 - v1045v1 = get_global __ptr string<3>, __const_global0 - v1046v1 = cast_ptr v1045v1 to ptr, !419 - v1048v1 = get_local __ptr { ptr, u64 }, __anon_2, !419 - v1049v1 = const u64 0 - v1050v1 = get_elem_ptr v1048v1, __ptr ptr, v1049v1 - store v1046v1 to v1050v1, !419 - v1052v1 = const u64 1 - v1053v1 = get_elem_ptr v1048v1, __ptr u64, v1052v1 - v1047v1 = const u64 3 - store v1047v1 to v1053v1, !419 - v1055v1 = get_local __ptr slice, __anon_3, !419 - mem_copy_bytes v1055v1, v1048v1, 16 - v4363v1 = get_local __ptr string<3>, __tmp_arg5 - mem_copy_val v4363v1, v1042v1 - v4365v1 = get_local __ptr slice, __tmp_arg6 - mem_copy_val v4365v1, v1055v1 - v4367v1 = call eq_str_3_57(v4363v1, v4365v1) - v1059v3 = cmp eq v4367v1 v910v1, !422 - cbr v1059v3, assert_54_block018(), assert_54_block119(), !423 + v1037v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !415 + v1038v1 = const u64 1, !416 + v1039v1 = get_elem_ptr v1037v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v1038v1, !417 + v1040v1 = const u64 0 + v1041v1 = get_elem_ptr v1039v1, __ptr { string<3> }, v1040v1, !418 + v1042v1 = const u64 0 + v1043v1 = get_elem_ptr v1041v1, __ptr string<3>, v1042v1, !238 + v1046v1 = get_global __ptr string<3>, __const_global0 + v1047v1 = cast_ptr v1046v1 to ptr, !419 + v1049v1 = get_local __ptr { ptr, u64 }, __anon_2, !419 + v1050v1 = const u64 0 + v1051v1 = get_elem_ptr v1049v1, __ptr ptr, v1050v1 + store v1047v1 to v1051v1, !419 + v1053v1 = const u64 1 + v1054v1 = get_elem_ptr v1049v1, __ptr u64, v1053v1 + v1048v1 = const u64 3 + store v1048v1 to v1054v1, !419 + v1056v1 = get_local __ptr slice, __anon_3, !419 + mem_copy_bytes v1056v1, v1049v1, 16 + v4364v1 = get_local __ptr string<3>, __tmp_arg5 + mem_copy_val v4364v1, v1043v1 + v4366v1 = get_local __ptr slice, __tmp_arg6 + mem_copy_val v4366v1, v1056v1 + v4368v1 = call eq_str_3_57(v4364v1, v4366v1) + v1060v3 = cmp eq v4368v1 v911v1, !422 + cbr v1060v3, assert_54_block018(), assert_54_block119(), !423 assert_54_block018(): - revert v1171v1, !424 + revert v1172v1, !424 assert_54_block119(): - v1060v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !425 - v1061v1 = const u64 1, !426 - v1062v1 = get_elem_ptr v1060v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v1061v1, !427 - v1063v1 = const u64 1 - v1064v1 = get_elem_ptr v1062v1, __ptr { u64, ( u64 | u64 ) }, v1063v1, !428 - v1066v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_2, !429 - mem_copy_val v1066v1, v1064v1 - v1068v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_2, !430 - v1069v1 = const u64 0 - v1070v1 = get_elem_ptr v1068v1, __ptr u64, v1069v1, !430 - v1071v1 = load v1070v1 - v1072v1 = const u64 1, !430 - v3991v1 = cmp eq v1071v1 v1072v1, !433 - cbr v3991v1, block3(), block4(), !431 + v1061v1 = get_local __ptr [{ { string<3> }, { u64, ( u64 | u64 ) } }; 2], ops_, !425 + v1062v1 = const u64 1, !426 + v1063v1 = get_elem_ptr v1061v1, __ptr { { string<3> }, { u64, ( u64 | u64 ) } }, v1062v1, !427 + v1064v1 = const u64 1 + v1065v1 = get_elem_ptr v1063v1, __ptr { u64, ( u64 | u64 ) }, v1064v1, !428 + v1067v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_2, !429 + mem_copy_val v1067v1, v1065v1 + v1069v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_2, !430 + v1070v1 = const u64 0 + v1071v1 = get_elem_ptr v1069v1, __ptr u64, v1070v1, !430 + v1072v1 = load v1071v1 + v1073v1 = const u64 1, !430 + v3992v1 = cmp eq v1072v1 v1073v1, !433 + cbr v3992v1, block3(), block4(), !431 block1(): - v1027v1 = const u64 1, !434 - revert v1027v1, !437 + v1028v1 = const u64 1, !434 + revert v1028v1, !437 block3(): - v1074v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_2, !430 - v1075v1 = const u64 1 + v1075v1 = get_local __ptr { u64, ( u64 | u64 ) }, __matched_value_2, !430 v1076v1 = const u64 1 - v1077v1 = get_elem_ptr v1074v1, __ptr u64, v1075v1, v1076v1 - v1078v1 = load v1077v1 - v1089v1 = const u64 1, !438 - v4000v1 = cmp eq v1078v1 v1089v1, !441 - v1091v3 = cmp eq v4000v1 v910v1, !444 - cbr v1091v3, assert_54_block021(), assert_54_block122(), !445 + v1077v1 = const u64 1 + v1078v1 = get_elem_ptr v1075v1, __ptr u64, v1076v1, v1077v1 + v1079v1 = load v1078v1 + v1090v1 = const u64 1, !438 + v4001v1 = cmp eq v1079v1 v1090v1, !441 + v1092v3 = cmp eq v4001v1 v911v1, !444 + cbr v1092v3, assert_54_block021(), assert_54_block122(), !445 assert_54_block021(): - revert v1171v1, !446 + revert v1172v1, !446 assert_54_block122(): - v1092v1 = get_local __ptr { u64 }, __struct_init_0, !447 - v1151v1 = const u64 0 - v1152v1 = get_elem_ptr v1092v1, __ptr u64, v1151v1, !447 - v1093v1 = const u64 1, !448 - store v1093v1 to v1152v1, !447 - mem_copy_val __ret_value, v1092v1 - v4371v1 = const unit () - ret () v4371v1 + v1093v1 = get_local __ptr { u64 }, __struct_init_0, !447 + v1152v1 = const u64 0 + v1153v1 = get_elem_ptr v1093v1, __ptr u64, v1152v1, !447 + v1094v1 = const u64 1, !448 + store v1094v1 to v1153v1, !447 + mem_copy_val __ret_value, v1093v1 + v4372v1 = const unit () + ret () v4372v1 block4(): - v1083v1 = const u64 2, !449 - revert v1083v1, !452 + v1084v1 = const u64 2, !449 + revert v1084v1, !452 } pub fn abi_encode_51(self !453: u64, buffer: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr { { ptr, u64, u64 } }) -> (), !456 { @@ -731,66 +731,66 @@ script { local { { ptr, u64, u64 } } buffer_ entry(self: u64, buffer: __ptr { { ptr, u64, u64 } }, __ret_value: __ptr { { ptr, u64, u64 } }): - v689v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ - mem_copy_val v689v1, buffer - v691v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !457 - v692v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !458 - v693v1 = const u64 0 - v694v1 = get_elem_ptr v692v1, __ptr { ptr, u64, u64 }, v693v1, !250 - v4411v1 = asm(buffer: v694v1) -> __ptr { ptr, u64, u64 } buffer { + v690v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_ + mem_copy_val v690v1, buffer + v692v1 = get_local __ptr { { ptr, u64, u64 } }, __struct_init_0, !457 + v693v1 = get_local __ptr { { ptr, u64, u64 } }, buffer_, !458 + v694v1 = const u64 0 + v695v1 = get_elem_ptr v693v1, __ptr { ptr, u64, u64 }, v694v1, !250 + v4412v1 = asm(buffer: v695v1) -> __ptr { ptr, u64, u64 } buffer { } - v4502v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 - mem_copy_val v4502v1, v4411v1 - v697v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 - mem_copy_val v697v1, v4502v1 - v699v1 = const u64 0 - v700v1 = get_elem_ptr v697v1, __ptr ptr, v699v1 - v701v1 = load v700v1 - v702v1 = const u64 1 - v703v1 = get_elem_ptr v697v1, __ptr u64, v702v1 - v704v1 = load v703v1 - v705v1 = const u64 2 - v706v1 = get_elem_ptr v697v1, __ptr u64, v705v1 - v707v1 = load v706v1 - v710v1 = const u64 8 - v713v1 = add v707v1, v710v1 - v714v1 = cmp gt v713v1 v704v1 - cbr v714v1, block1(), block0(v701v1, v704v1) + v4503v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_0 + mem_copy_val v4503v1, v4412v1 + v698v1 = get_local __ptr { ptr, u64, u64 }, __anon_0 + mem_copy_val v698v1, v4503v1 + v700v1 = const u64 0 + v701v1 = get_elem_ptr v698v1, __ptr ptr, v700v1 + v702v1 = load v701v1 + v703v1 = const u64 1 + v704v1 = get_elem_ptr v698v1, __ptr u64, v703v1 + v705v1 = load v704v1 + v706v1 = const u64 2 + v707v1 = get_elem_ptr v698v1, __ptr u64, v706v1 + v708v1 = load v707v1 + v711v1 = const u64 8 + v714v1 = add v708v1, v711v1 + v715v1 = cmp gt v714v1 v705v1 + cbr v715v1, block1(), block0(v702v1, v705v1) - block0(v711v1: ptr, v712v1: u64): - v722v1 = add v711v1, v707v1 - v723v1 = cast_ptr v722v1 to __ptr u64 - store self to v723v1 - v727v1 = get_local __ptr { ptr, u64, u64 }, __anon_1 - v728v1 = const u64 0 - v729v1 = get_elem_ptr v727v1, __ptr ptr, v728v1 - store v711v1 to v729v1 - v731v1 = const u64 1 - v732v1 = get_elem_ptr v727v1, __ptr u64, v731v1 - store v712v1 to v732v1 - v734v1 = const u64 2 - v735v1 = get_elem_ptr v727v1, __ptr u64, v734v1 - store v713v1 to v735v1 - v4413v1 = asm(buffer: v727v1) -> __ptr { ptr, u64, u64 } buffer { + block0(v712v1: ptr, v713v1: u64): + v723v1 = add v712v1, v708v1 + v724v1 = cast_ptr v723v1 to __ptr u64 + store self to v724v1 + v728v1 = get_local __ptr { ptr, u64, u64 }, __anon_1 + v729v1 = const u64 0 + v730v1 = get_elem_ptr v728v1, __ptr ptr, v729v1 + store v712v1 to v730v1 + v732v1 = const u64 1 + v733v1 = get_elem_ptr v728v1, __ptr u64, v732v1 + store v713v1 to v733v1 + v735v1 = const u64 2 + v736v1 = get_elem_ptr v728v1, __ptr u64, v735v1 + store v714v1 to v736v1 + v4414v1 = asm(buffer: v728v1) -> __ptr { ptr, u64, u64 } buffer { } - v4505v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 - mem_copy_val v4505v1, v4413v1 - v1163v1 = const u64 0 - v1164v1 = get_elem_ptr v691v1, __ptr { ptr, u64, u64 }, v1163v1, !457 - mem_copy_val v1164v1, v4505v1 - mem_copy_val __ret_value, v691v1 - v4378v1 = const unit () - ret () v4378v1 + v4506v1 = get_local __ptr { ptr, u64, u64 }, __aggr_memcpy_00 + mem_copy_val v4506v1, v4414v1 + v1164v1 = const u64 0 + v1165v1 = get_elem_ptr v692v1, __ptr { ptr, u64, u64 }, v1164v1, !457 + mem_copy_val v1165v1, v4506v1 + mem_copy_val __ret_value, v692v1 + v4379v1 = const unit () + ret () v4379v1 block1(): - v716v1 = const u64 2 - v717v1 = mul v704v1, v716v1 - v718v1 = add v717v1, v710v1 - v719v1 = asm(new_cap: v718v1, old_ptr: v701v1, len: v707v1) -> __ptr u8 hp { + v717v1 = const u64 2 + v718v1 = mul v705v1, v717v1 + v719v1 = add v718v1, v711v1 + v720v1 = asm(new_cap: v719v1, old_ptr: v702v1, len: v708v1) -> __ptr u8 hp { aloc new_cap mcp hp old_ptr len } - br block0(v719v1, v718v1) + br block0(v720v1, v719v1) } fn eq_str_3_57(a: __ptr string<3>, b: __ptr slice) -> bool, !461 { @@ -799,36 +799,36 @@ script { local slice self_ entry(a: __ptr string<3>, b: __ptr slice): - v937v1 = get_local __ptr string<3>, a_ - mem_copy_val v937v1, a - v970v3 = get_local __ptr slice, self_, !464 - mem_copy_val v970v3, b - v3617v1 = get_local __ptr slice, self_, !467 - v4415v1 = asm(s: v3617v1) -> __ptr { ptr, u64 } s { + v938v1 = get_local __ptr string<3>, a_ + mem_copy_val v938v1, a + v971v3 = get_local __ptr slice, self_, !464 + mem_copy_val v971v3, b + v3618v1 = get_local __ptr slice, self_, !467 + v4416v1 = asm(s: v3618v1) -> __ptr { ptr, u64 } s { } - v4515v1 = const u64 0 - v4516v1 = get_elem_ptr v4415v1, __ptr ptr, v4515v1 - v4517v1 = load v4516v1 - v4518v1 = const u64 1 - v4519v1 = get_elem_ptr v4415v1, __ptr u64, v4518v1 - v4520v1 = load v4519v1 - v3624v1 = get_local __ptr { ptr, u64 }, __tuple_1_, !469 - v4537v1 = const u64 0 - v4538v1 = get_elem_ptr v3624v1, __ptr ptr, v4537v1 - store v4517v1 to v4538v1 - v4540v1 = const u64 1 - v4541v1 = get_elem_ptr v3624v1, __ptr u64, v4540v1 - store v4520v1 to v4541v1 - v3626v1 = get_local __ptr { ptr, u64 }, __tuple_1_, !470 - v954v1 = const u64 0 - v3627v1 = get_elem_ptr v3626v1, __ptr ptr, v954v1, !471 - v3628v1 = load v3627v1, !464 - v973v1 = get_local __ptr string<3>, a_, !472 - v977v1 = const u64 3, !473 - v978v1 = asm(a: v973v1, b: v3628v1, len: v977v1, r) -> bool r, !474 { + v4516v1 = const u64 0 + v4517v1 = get_elem_ptr v4416v1, __ptr ptr, v4516v1 + v4518v1 = load v4517v1 + v4519v1 = const u64 1 + v4520v1 = get_elem_ptr v4416v1, __ptr u64, v4519v1 + v4521v1 = load v4520v1 + v3625v1 = get_local __ptr { ptr, u64 }, __tuple_1_, !469 + v4538v1 = const u64 0 + v4539v1 = get_elem_ptr v3625v1, __ptr ptr, v4538v1 + store v4518v1 to v4539v1 + v4541v1 = const u64 1 + v4542v1 = get_elem_ptr v3625v1, __ptr u64, v4541v1 + store v4521v1 to v4542v1 + v3627v1 = get_local __ptr { ptr, u64 }, __tuple_1_, !470 + v955v1 = const u64 0 + v3628v1 = get_elem_ptr v3627v1, __ptr ptr, v955v1, !471 + v3629v1 = load v3628v1, !464 + v974v1 = get_local __ptr string<3>, a_, !472 + v978v1 = const u64 3, !473 + v979v1 = asm(a: v974v1, b: v3629v1, len: v978v1, r) -> bool r, !474 { meq r a b len, !475 } - ret bool v978v1 + ret bool v979v1 } } @@ -837,81 +837,81 @@ script { !2 = fn_name_span !0 7 14 !3 = (!1 !2) !4 = "sway-lib-std/src/codec.sw" -!5 = span !4 1542 1543 +!5 = span !4 1558 1559 !6 = span !0 80 131 !7 = fn_call_path_span !0 80 98 -!8 = span !4 91615 91647 -!9 = fn_call_path_span !4 91615 91645 -!10 = span !4 1525 1549 +!8 = span !4 91631 91663 +!9 = fn_call_path_span !4 91631 91661 +!10 = span !4 1541 1565 !11 = (!6 !7 !8 !9 !10) !12 = (!6 !7 !8 !9 !10) -!13 = span !4 91590 91648 -!14 = fn_call_path_span !4 91590 91609 -!15 = span !4 91463 91483 +!13 = span !4 91606 91664 +!14 = fn_call_path_span !4 91606 91625 +!15 = span !4 91479 91499 !16 = (!6 !7 !13 !14 !15) !17 = (!6 !7 !13 !14 !15) !18 = (!6 !7 !13 !14 !15) -!19 = span !4 91446 91484 +!19 = span !4 91462 91500 !20 = (!6 !7 !13 !14 !19) -!21 = span !4 91507 91513 +!21 = span !4 91523 91529 !22 = (!6 !7 !13 !14 !21) -!23 = span !4 91493 91514 -!24 = fn_call_path_span !4 91493 91506 -!25 = span !4 54646 54671 +!23 = span !4 91509 91530 +!24 = fn_call_path_span !4 91509 91522 +!25 = span !4 54662 54687 !26 = (!6 !7 !13 !14 !23 !24 !25) -!27 = span !4 54647 54668 -!28 = fn_call_path_span !4 54647 54660 -!29 = span !4 53906 53919 +!27 = span !4 54663 54684 +!28 = fn_call_path_span !4 54663 54676 +!29 = span !4 53922 53935 !30 = (!6 !7 !13 !14 !23 !24 !27 !28 !29) !31 = (!6 !7 !13 !14 !23 !24 !27 !28 !29) -!32 = span !4 53890 53920 +!32 = span !4 53906 53936 !33 = (!6 !7 !13 !14 !23 !24 !27 !28 !32) -!34 = span !4 54005 54010 +!34 = span !4 54021 54026 !35 = (!6 !7 !13 !14 !23 !24 !27 !28 !34) !36 = (!6 !7 !13 !14 !23 !24 !27 !28) -!37 = span !4 54034 54035 +!37 = span !4 54050 54051 !38 = (!6 !7 !13 !14 !23 !24 !27 !28) -!39 = span !4 54052 54057 -!40 = fn_call_path_span !4 54054 54055 +!39 = span !4 54068 54073 +!40 = fn_call_path_span !4 54070 54071 !41 = (!6 !7 !13 !14 !23 !24 !27 !28 !39 !40) !42 = (!6 !7 !13 !14 !23 !24 !27 !28) !43 = (!6 !7 !13 !14 !23 !24 !27 !28) -!44 = span !4 54132 54152 -!45 = fn_call_path_span !4 54139 54145 -!46 = span !4 3466 3485 -!47 = fn_call_path_span !4 3466 3479 -!48 = span !4 54987 55033 +!44 = span !4 54148 54168 +!45 = fn_call_path_span !4 54155 54161 +!46 = span !4 3482 3501 +!47 = fn_call_path_span !4 3482 3495 +!48 = span !4 55003 55049 !49 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !48) -!50 = span !4 54988 55009 -!51 = fn_call_path_span !4 54988 55001 +!50 = span !4 55004 55025 +!51 = fn_call_path_span !4 55004 55017 !52 = span !0 372 412 !53 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !52) !54 = span !0 384 409 !55 = fn_call_path_span !0 391 397 -!56 = span !4 53217 53237 -!57 = fn_call_path_span !4 53224 53234 -!58 = span !4 2697 2714 +!56 = span !4 53233 53253 +!57 = fn_call_path_span !4 53240 53250 +!58 = span !4 2713 2730 !59 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !58) -!60 = span !4 625 641 +!60 = span !4 641 657 !61 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !60) !62 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !58) !63 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !58) !64 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !58) -!65 = span !4 2676 2755 +!65 = span !4 2692 2771 !66 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !65) !67 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57) !68 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57) !69 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57) -!70 = span !4 2764 2807 +!70 = span !4 2780 2823 !71 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !70) -!72 = span !4 2817 2822 +!72 = span !4 2833 2838 !73 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !56 !57 !72) -!74 = span !4 53206 53238 +!74 = span !4 53222 53254 !75 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !74) -!76 = span !4 53254 53258 +!76 = span !4 53270 53274 !77 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !76) -!78 = span !4 53254 53264 -!79 = fn_call_path_span !4 53259 53262 +!78 = span !4 53270 53280 +!79 = fn_call_path_span !4 53275 53278 !80 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !78 !79) !81 = "sway-lib-std/src/raw_slice.sw" !82 = span !81 2922 2926 @@ -926,20 +926,20 @@ script { !91 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !78 !79 !90) !92 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !54 !55 !46 !47 !78 !79) !93 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !50 !51 !52) -!94 = span !4 55011 55032 -!95 = fn_call_path_span !4 55011 55024 +!94 = span !4 55027 55048 +!95 = fn_call_path_span !4 55027 55040 !96 = span !0 309 331 !97 = fn_call_path_span !0 316 322 -!98 = span !4 51098 51126 -!99 = fn_call_path_span !4 51105 51117 +!98 = span !4 51114 51142 +!99 = fn_call_path_span !4 51121 51133 !100 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !96 !97 !46 !47 !98 !99) -!101 = span !4 2273 2354 +!101 = span !4 2289 2370 !102 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !96 !97 !46 !47 !98 !99 !101) -!103 = span !4 2311 2324 +!103 = span !4 2327 2340 !104 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !96 !97 !46 !47 !98 !99) !105 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !96 !97 !46 !47 !98 !99) !106 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !96 !97 !46 !47 !98 !99) -!107 = span !4 2364 2403 +!107 = span !4 2380 2419 !108 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !96 !97 !46 !47 !98 !99 !107) !109 = span !0 349 350 !110 = span !0 349 398 @@ -986,9 +986,9 @@ script { !151 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !94 !95 !150) !152 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !48) !153 = (!6 !7 !13 !14 !23 !24 !27 !28 !44 !45 !46 !47 !48) -!154 = span !4 54171 54172 -!155 = span !4 54166 54172 -!156 = fn_call_path_span !4 54168 54170 +!154 = span !4 54187 54188 +!155 = span !4 54182 54188 +!156 = fn_call_path_span !4 54184 54186 !157 = (!6 !7 !13 !14 !23 !24 !27 !28 !155 !156) !158 = (!6 !7 !13 !14 !23 !24 !27 !28) !159 = (!6 !7 !13 !14 !23 !24 !25) @@ -999,31 +999,31 @@ script { !164 = span !0 234 241 !165 = span !0 203 242 !166 = fn_call_path_span !0 203 220 -!167 = span !4 49161 49187 +!167 = span !4 49177 49203 !168 = (!165 !166 !167) !169 = span !114 297 695 !170 = fn_name_span !114 300 304 !171 = (!169 !170) !172 = span !114 360 363 -!173 = span !4 48742 48766 -!174 = fn_call_path_span !4 48742 48759 -!175 = span !4 3637 3659 -!176 = fn_call_path_span !4 3637 3657 -!177 = span !4 6939 6963 -!178 = fn_call_path_span !4 6939 6956 -!179 = span !4 7838 7895 -!180 = fn_call_path_span !4 7865 7867 +!173 = span !4 48758 48782 +!174 = fn_call_path_span !4 48758 48775 +!175 = span !4 3653 3675 +!176 = fn_call_path_span !4 3653 3673 +!177 = span !4 6955 6979 +!178 = fn_call_path_span !4 6955 6972 +!179 = span !4 7854 7911 +!180 = fn_call_path_span !4 7881 7883 !181 = (!172 !173 !174 !175 !176 !177 !178 !175 !176 !179 !180) !182 = (!172 !173) -!183 = span !4 48850 48862 +!183 = span !4 48866 48878 !184 = (!172 !183) !185 = (!172 !183) !186 = (!172 !183) !187 = (!172 !183) !188 = (!172 !183) -!189 = span !4 48917 48930 -!190 = fn_call_path_span !4 48917 48928 -!191 = span !4 191 254 +!189 = span !4 48933 48946 +!190 = fn_call_path_span !4 48933 48944 +!191 = span !4 207 270 !192 = (!172 !189 !190 !191) !193 = (!172 !189 !190) !194 = (!172 !189 !190) @@ -1034,38 +1034,38 @@ script { !199 = (!172 !189 !190) !200 = (!172 !189 !190) !201 = (!172 !189 !190 !191) -!202 = span !4 48898 48931 -!203 = fn_call_path_span !4 48906 48916 +!202 = span !4 48914 48947 +!203 = fn_call_path_span !4 48922 48932 !204 = (!172 !202 !203) !205 = (!172 !202 !203) -!206 = span !4 7047 7053 +!206 = span !4 7063 7069 !207 = (!172 !202 !203 !206) -!208 = span !4 7030 7054 +!208 = span !4 7046 7070 !209 = (!172 !202 !203 !208) -!210 = span !4 7075 7076 +!210 = span !4 7091 7092 !211 = (!172 !202 !203) -!212 = span !4 7093 7098 -!213 = fn_call_path_span !4 7095 7096 +!212 = span !4 7109 7114 +!213 = fn_call_path_span !4 7111 7112 !214 = (!172 !202 !203 !212 !213) !215 = (!172 !202 !203) -!216 = span !4 7122 7126 +!216 = span !4 7138 7142 !217 = (!172 !202 !203 !216) -!218 = span !4 7122 7129 +!218 = span !4 7138 7145 !219 = (!172 !202 !203 !218) -!220 = span !4 7141 7147 +!220 = span !4 7157 7163 !221 = (!172 !202 !203 !220) -!222 = span !4 7122 7148 -!223 = fn_call_path_span !4 7130 7140 +!222 = span !4 7138 7164 +!223 = fn_call_path_span !4 7146 7156 !224 = (!172 !202 !203 !222 !223) !225 = (!172 !202 !203 !222 !223) -!226 = span !4 8031 8035 +!226 = span !4 8047 8051 !227 = (!172 !202 !203 !222 !223 !226) -!228 = span !4 8036 8037 +!228 = span !4 8052 8053 !229 = (!172 !202 !203 !222 !223 !228) -!230 = span !4 8049 8055 +!230 = span !4 8065 8071 !231 = (!172 !202 !203 !222 !223 !230) -!232 = span !4 8031 8056 -!233 = fn_call_path_span !4 8038 8048 +!232 = span !4 8047 8072 +!233 = fn_call_path_span !4 8054 8064 !234 = (!172 !202 !203 !222 !223 !232 !233) !235 = (!172 !202 !203 !222 !223 !232 !233) !236 = span !0 379 383 @@ -1078,11 +1078,11 @@ script { !243 = fn_call_path_span !0 388 398 !244 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) !245 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) -!246 = span !4 6162 6245 +!246 = span !4 6178 6261 !247 = (!172 !202 !203 !222 !223 !232 !233 !242 !243 !246) -!248 = span !4 6214 6220 +!248 = span !4 6230 6236 !249 = (!172 !202 !203 !222 !223 !232 !233 !242 !243 !248) -!250 = span !4 87 114 +!250 = span !4 103 130 !251 = (!172 !202 !203 !222 !223 !232 !233 !242 !243 !250) !252 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) !253 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) @@ -1091,7 +1091,7 @@ script { !256 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) !257 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) !258 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) -!259 = span !4 6229 6233 +!259 = span !4 6245 6249 !260 = (!172 !202 !203 !222 !223 !232 !233 !242 !243 !259) !261 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) !262 = (!172 !202 !203 !222 !223 !232 !233 !242 !243) @@ -1112,16 +1112,16 @@ script { !277 = (!172 !202 !203 !222 !223 !232 !233 !276) !278 = span !0 425 431 !279 = (!172 !202 !203 !222 !223 !232 !233 !278) -!280 = span !4 8018 8057 +!280 = span !4 8034 8073 !281 = (!172 !202 !203 !222 !223 !280) -!282 = span !4 8079 8083 +!282 = span !4 8095 8099 !283 = (!172 !202 !203 !222 !223 !282) -!284 = span !4 8084 8085 +!284 = span !4 8100 8101 !285 = (!172 !202 !203 !222 !223 !284) -!286 = span !4 8097 8103 +!286 = span !4 8113 8119 !287 = (!172 !202 !203 !222 !223 !286) -!288 = span !4 8079 8104 -!289 = fn_call_path_span !4 8086 8096 +!288 = span !4 8095 8120 +!289 = fn_call_path_span !4 8102 8112 !290 = (!172 !202 !203 !222 !223 !288 !289) !291 = (!172 !202 !203 !222 !223 !288 !289) !292 = span !0 415 419 @@ -1181,27 +1181,27 @@ script { !346 = (!172 !202 !203 !222 !223 !288 !289 !345) !347 = span !0 866 872 !348 = (!172 !202 !203 !222 !223 !288 !289 !347) -!349 = span !4 8066 8105 +!349 = span !4 8082 8121 !350 = (!172 !202 !203 !222 !223 !349) -!351 = span !4 8114 8120 +!351 = span !4 8130 8136 !352 = (!172 !202 !203 !222 !223 !351) -!353 = span !4 7113 7148 +!353 = span !4 7129 7164 !354 = (!172 !202 !203 !353) -!355 = span !4 7167 7168 -!356 = span !4 7162 7168 -!357 = fn_call_path_span !4 7164 7166 +!355 = span !4 7183 7184 +!356 = span !4 7178 7184 +!357 = fn_call_path_span !4 7180 7182 !358 = (!172 !202 !203 !356 !357) !359 = (!172 !202 !203) -!360 = span !4 7190 7196 +!360 = span !4 7206 7212 !361 = (!172 !202 !203 !360) -!362 = span !4 48885 48932 +!362 = span !4 48901 48948 !363 = (!172 !362) -!364 = span !4 48941 48947 +!364 = span !4 48957 48963 !365 = (!172 !364) -!366 = span !4 48941 48962 -!367 = fn_call_path_span !4 48948 48960 +!366 = span !4 48957 48978 +!367 = fn_call_path_span !4 48964 48976 !368 = (!172 !366 !367) -!369 = span !4 573 577 +!369 = span !4 589 593 !370 = (!172 !366 !367 !369) !371 = (!172 !366 !367 !250) !372 = (!172 !366 !367) @@ -1285,12 +1285,12 @@ script { !450 = span !114 636 645 !451 = fn_call_path_span !114 636 642 !452 = (!450 !451 !395) -!453 = span !4 4703 4707 -!454 = span !4 4689 4834 -!455 = fn_name_span !4 4692 4702 +!453 = span !4 4719 4723 +!454 = span !4 4705 4850 +!455 = fn_name_span !4 4708 4718 !456 = (!454 !455) -!457 = span !4 4745 4828 -!458 = span !4 4797 4803 +!457 = span !4 4761 4844 +!458 = span !4 4813 4819 !459 = span !114 50 202 !460 = fn_name_span !114 53 61 !461 = (!459 !460) diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_const_eval_string_slices_not_in_bytecode/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_const_eval_string_slices_not_in_bytecode/stdout.snap index e052aea4d69..f0a138fb844 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_const_eval_string_slices_not_in_bytecode/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_const_eval_string_slices_not_in_bytecode/stdout.snap @@ -2,14 +2,14 @@ source: test/src/snapshot/mod.rs --- > forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/panic_expression/panic_const_eval_string_slices_not_in_bytecode --ir initial | regex ' (v[0-9a-zA-Z_]+ = call call|v[0-9a-zA-Z_]+ = const|v[0-9a-zA-Z_]+ = and|v[0-9a-zA-Z_]+ = or|revert)' - v32v1 = const u64 0, !8 - v33v1 = const u64 0, !9 - v24v1 = const u64 1 - v25v1 = call call_return_const_str_0_1(v24v1), !17 - v26v1 = const u64 9259400833873739776 - revert v26v1, !18 - v19v1 = const u64 36028797018963967 - v20v1 = and __backtrace, v19v1, !22 - v18v1 = const u64 9223372036854775808 - v21v1 = or v18v1, v20v1, !22 - revert v21v1, !22 + v34v1 = const u64 0, !8 + v35v1 = const u64 0, !9 + v26v1 = const u64 1 + v27v1 = call call_return_const_str_0_1(v26v1), !17 + v28v1 = const u64 9259400833873739776 + revert v28v1, !18 + v21v1 = const u64 36028797018963967 + v22v1 = and __backtrace, v21v1, !22 + v20v1 = const u64 9223372036854775808 + v23v1 = or v20v1, v22v1, !22 + revert v23v1, !22 diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/Forc.lock b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/Forc.lock new file mode 100644 index 00000000000..84f5dd2f1f8 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/Forc.lock @@ -0,0 +1,8 @@ +[[package]] +name = "std" +source = "path+from-root-71CDE16504A18FC1" + +[[package]] +name = "trivial_bool_and_enum" +source = "member" +dependencies = ["std"] diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/Forc.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/Forc.toml new file mode 100644 index 00000000000..6ca9f5e6d36 --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/Forc.toml @@ -0,0 +1,8 @@ +[project] +authors = ["Fuel Labs "] +entry = "main.sw" +license = "Apache-2.0" +name = "trivial_bool_and_enum" + +[dependencies] +std = { path = "../../../../reduced_std_libs/sway-lib-std-assert" } diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/snapshot.toml b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/snapshot.toml new file mode 100644 index 00000000000..81299a9fd3b --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/snapshot.toml @@ -0,0 +1,4 @@ +cmds = [ + "forc build --path {root}", + "forc test --path {root} --logs" +] \ No newline at end of file diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw new file mode 100644 index 00000000000..af53b425d2b --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw @@ -0,0 +1,33 @@ +// ignore garbage_collection_all_language_tests - needs a experimental feature +script; + +enum SomeEnum { + A: u64, + B: u16, +} + +fn encode_decode(s: SomeEnum) -> SomeEnum { + let bytes = encode(s); + abi_decode::>(bytes).unwrap() +} + +#[require(trivially_decodable = "true")] +struct MyStruct { + a: TrivialEnum, +} + +fn main() { + let bytes = encode(SomeEnum::A(1)); + let s = abi_decode::(bytes); + let e = s.a.unwrap(); +} + +#[test] +fn unwrap_trivial_variant() { + let _ = encode_decode(SomeEnum::A(1)); +} + +#[test(should_revert)] +fn unwrap_non_trivial_variant() { + let _ = encode_decode(SomeEnum::B(2)); +} diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/stdout.snap new file mode 100644 index 00000000000..f1bbc76d87a --- /dev/null +++ b/test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/stdout.snap @@ -0,0 +1,78 @@ +--- +source: test/src/snapshot/mod.rs +--- +> forc build --path test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum +exit status: 1 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert) + Compiling script trivial_bool_and_enum (test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum) +warning + --> test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw:9:4 + | + 7 | } + 8 | + 9 | fn encode_decode(s: SomeEnum) -> SomeEnum { + | ------------- This function is never called. +10 | let bytes = encode(s); +11 | abi_decode::>(bytes).unwrap() + | +____ + +warning + --> test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw:22:9 + | +20 | let bytes = encode(SomeEnum::A(1)); +21 | let s = abi_decode::(bytes); +22 | let e = s.a.unwrap(); + | - This declaration is never used. +23 | } +24 | + | +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw:15:8 + | +... +15 | struct MyStruct { + | ^^^^^^^^ `MyStruct` is not trivially decodable. + | -------- help: Consider changing `MyStruct` to make it trivially decodable. + | + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + + Aborting due to 1 error. +error: Failed to compile trivial_bool_and_enum + +> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum --logs +exit status: 1 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-assert) + Compiling script trivial_bool_and_enum (test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum) +warning + --> test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw:22:9 + | +20 | let bytes = encode(SomeEnum::A(1)); +21 | let s = abi_decode::(bytes); +22 | let e = s.a.unwrap(); + | - This declaration is never used. +23 | } +24 | + | +____ + +error: Type is not trivially decodable + --> test/src/e2e_vm_tests/test_programs/should_pass/language/trivial_bool_and_enum/src/main.sw:15:8 + | +... +15 | struct MyStruct { + | ^^^^^^^^ `MyStruct` is not trivially decodable. + | -------- help: Consider changing `MyStruct` to make it trivially decodable. + | + = help: For more info see: https://fuellabs.github.io/sway/v0.70.3/book/advanced/trivial_encoding.html +____ + + Aborting due to 1 error. +error: Failed to compile trivial_bool_and_enum diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw index a6d6a709f24..a663303bfdf 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/src/main.sw @@ -139,6 +139,35 @@ abi MyContract { /* START ENUM_U64_U64_U64 */ fn in_enum_u64_u64_u64(v: E3) -> E3; /* END ENUM_U64_U64_U64 */ + + /* START ORDER_ARGS_WITHOUT_TRIVIAL_ENUM */ + fn order_args_without_trivial_enum(args: OrderArgsWithoutTrivialEnum) -> OrderArgsWithoutTrivialEnum; + /* END ORDER_ARGS_WITHOUT_TRIVIAL_ENUM */ + + /* START ORDER_ARGS_WITH_TRIVIAL_ENUM */ + fn order_args_with_trivial_enum(args: OrderArgsWithTrivialEnum) -> OrderArgsWithTrivialEnum; + /* END ORDER_ARGS_WITH_TRIVIAL_ENUM */ +} + +pub struct OrderArgsWithoutTrivialEnum { + pub price: u64, + pub quantity: u64, + pub order_type: OrderType, +} + +pub struct OrderArgsWithTrivialEnum { + pub price: u64, + pub quantity: u64, + pub order_type: TrivialEnum, +} + +pub enum OrderType { + Limit: (u64, u64), + Spot: (), + FillOrKill: (), + PostOnly: (), + Market: (), + BoundedMarket: (u64, u64), } impl MyContract for Contract { @@ -257,6 +286,20 @@ impl MyContract for Contract { /* START ENUM_U64_U64_U64 */ fn in_enum_u64_u64_u64(v: E3) -> E3 { v } /* END ENUM_U64_U64_U64 */ + + /* START ORDER_ARGS_WITHOUT_TRIVIAL_ENUM */ + fn order_args_without_trivial_enum(args: OrderArgsWithoutTrivialEnum) -> OrderArgsWithoutTrivialEnum { + __log(args.order_type); + args + } + /* END ORDER_ARGS_WITHOUT_TRIVIAL_ENUM */ + + /* START ORDER_ARGS_WITH_TRIVIAL_ENUM */ + fn order_args_with_trivial_enum(args: OrderArgsWithTrivialEnum) -> OrderArgsWithTrivialEnum { + __log(args.order_type.unwrap()); + args + } + /* END ORDER_ARGS_WITH_TRIVIAL_ENUM */ } /* START BOOL */ @@ -461,3 +504,27 @@ fn in_enum_u64_u64_u64() { let _ = abi(MyContract, CONTRACT_ID).in_enum_u64_u64_u64(E3::A(0)); } /* END ENUM_U64_U64_U64 */ + +/* START ORDER_ARGS_WITHOUT_TRIVIAL_ENUM */ +#[test] +fn order_args_without_trivial_enum() { + let order_args = OrderArgsWithoutTrivialEnum { + price: 0, + quantity: 0, + order_type: OrderType::Spot, + }; + let _ = abi(MyContract, CONTRACT_ID).order_args_without_trivial_enum(order_args); +} +/* END ORDER_ARGS_WITHOUT_TRIVIAL_ENUM */ + +/* START ORDER_ARGS_WITH_TRIVIAL_ENUM */ +#[test] +fn order_args_with_trivial_enum() { + let order_args = OrderArgsWithTrivialEnum { + price: 0, + quantity: 0, + order_type: TrivialEnum::from(OrderType::Spot), + }; + let _ = abi(MyContract, CONTRACT_ID).order_args_with_trivial_enum(order_args); +} +/* END ORDER_ARGS_WITH_TRIVIAL_ENUM */ \ No newline at end of file diff --git a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap index a521d5ddd51..3c52ff34552 100644 --- a/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap +++ b/test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call/stdout.snap @@ -7,42 +7,44 @@ output: Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) - Finished release [optimized + fuel] target(s) [18.592 KB] in ??? - Running 29 tests, filtered 0 tests - -tested -- const_of_contract_call - - test cost_of_in_bool ... ok (???, 1752 gas) - test cost_of_in_u8 ... ok (???, 1707 gas) - test cost_of_in_u16 ... ok (???, 1914 gas) - test cost_of_in_u32 ... ok (???, 2040 gas) - test cost_of_in_u64 ... ok (???, 1560 gas) - test cost_of_in_u256 ... ok (???, 1590 gas) - test cost_of_in_b256 ... ok (???, 1580 gas) - test cost_of_in_str_0 ... ok (???, 1934 gas) - test cost_of_in_str_1 ... ok (???, 2061 gas) - test cost_of_in_str_8 ... ok (???, 2068 gas) - test cost_of_in_str_16 ... ok (???, 2065 gas) - test cost_of_in_str_32 ... ok (???, 2075 gas) - test cost_of_in_array_0 ... ok (???, 1530 gas) - test cost_of_in_array_1 ... ok (???, 1589 gas) - test cost_of_in_array_8 ... ok (???, 2098 gas) - test cost_of_in_array_16 ... ok (???, 1629 gas) - test cost_of_in_array_32 ... ok (???, 1678 gas) - test cost_of_in_array_64 ... ok (???, 1773 gas) - test cost_of_in_tuple_0 ... ok (???, 1544 gas) - test cost_of_in_tuple_1 ... ok (???, 1616 gas) - test cost_of_in_tuple_2 ... ok (???, 1622 gas) - test cost_of_in_tuple_3 ... ok (???, 1630 gas) - test cost_of_in_tuple_4 ... ok (???, 1638 gas) - test in_struct_u64 ... ok (???, 1594 gas) - test in_struct_u64_u64 ... ok (???, 1615 gas) - test in_struct_u64_u64_u64 ... ok (???, 1626 gas) - test in_enum_u64 ... ok (???, 1673 gas) - test in_enum_u64_u64 ... ok (???, 1671 gas) - test in_enum_u64_u64_u64 ... ok (???, 1679 gas) - -test result: OK. 29 passed; 0 failed; finished in ??? + Finished release [optimized + fuel] target(s) [22.232 KB] in ??? + Running 31 tests, filtered 0 tests + +tested -- const_of_contract_call + + test cost_of_in_bool ... ok (???, 1806 gas) + test cost_of_in_u8 ... ok (???, 1760 gas) + test cost_of_in_u16 ... ok (???, 1967 gas) + test cost_of_in_u32 ... ok (???, 2093 gas) + test cost_of_in_u64 ... ok (???, 1613 gas) + test cost_of_in_u256 ... ok (???, 1643 gas) + test cost_of_in_b256 ... ok (???, 1633 gas) + test cost_of_in_str_0 ... ok (???, 1985 gas) + test cost_of_in_str_1 ... ok (???, 2115 gas) + test cost_of_in_str_8 ... ok (???, 2122 gas) + test cost_of_in_str_16 ... ok (???, 2119 gas) + test cost_of_in_str_32 ... ok (???, 2128 gas) + test cost_of_in_array_0 ... ok (???, 1582 gas) + test cost_of_in_array_1 ... ok (???, 1642 gas) + test cost_of_in_array_8 ... ok (???, 2151 gas) + test cost_of_in_array_16 ... ok (???, 1682 gas) + test cost_of_in_array_32 ... ok (???, 1731 gas) + test cost_of_in_array_64 ... ok (???, 1824 gas) + test cost_of_in_tuple_0 ... ok (???, 1595 gas) + test cost_of_in_tuple_1 ... ok (???, 1669 gas) + test cost_of_in_tuple_2 ... ok (???, 1675 gas) + test cost_of_in_tuple_3 ... ok (???, 1683 gas) + test cost_of_in_tuple_4 ... ok (???, 1691 gas) + test in_struct_u64 ... ok (???, 1645 gas) + test in_struct_u64_u64 ... ok (???, 1666 gas) + test in_struct_u64_u64_u64 ... ok (???, 1677 gas) + test in_enum_u64 ... ok (???, 1725 gas) + test in_enum_u64_u64 ... ok (???, 1723 gas) + test in_enum_u64_u64_u64 ... ok (???, 1731 gas) + test order_args_without_trivial_enum ... ok (???, 3232 gas) + test order_args_with_trivial_enum ... ok (???, 3441 gas) + +test result: OK. 31 passed; 0 failed; finished in ??? Finished in ??? @@ -266,6 +268,46 @@ test result: OK. 1 passed; 0 failed; finished in ??? Finished in ??? +> Block: ORDER_ARGS_WITHOUT_TRIVIAL_ENUM +> replace-file src/main.sw "fn cost_of_in" "fn isolated_cost_of_in" + +> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call --release +exit status: 0 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) + Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) + Finished release [optimized + fuel] target(s) [2.344 KB] in ??? + Running 1 test, filtered 0 tests + +tested -- const_of_contract_call + + test order_args_without_trivial_enum ... ok (???, 2984 gas) + +test result: OK. 1 passed; 0 failed; finished in ??? + + Finished in ??? + +> Block: ORDER_ARGS_WITH_TRIVIAL_ENUM +> replace-file src/main.sw "fn cost_of_in" "fn isolated_cost_of_in" + +> forc test --path test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call --release +exit status: 0 +output: + Building test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call + Compiling library std (test/src/e2e_vm_tests/reduced_std_libs/sway-lib-std-core) + Compiling contract const_of_contract_call (test/src/e2e_vm_tests/test_programs/should_pass/test_contracts/const_of_contract_call) + Finished release [optimized + fuel] target(s) [2.696 KB] in ??? + Running 1 test, filtered 0 tests + +tested -- const_of_contract_call + + test order_args_with_trivial_enum ... ok (???, 3176 gas) + +test result: OK. 1 passed; 0 failed; finished in ??? + + Finished in ??? + > Block: STR0 > replace-file src/main.sw "fn cost_of_in" "fn isolated_cost_of_in" diff --git a/test/src/ir_generation/tests/shadowed_locals.sw b/test/src/ir_generation/tests/shadowed_locals.sw index f42f45bcf0c..80b77f6a6dc 100644 --- a/test/src/ir_generation/tests/shadowed_locals.sw +++ b/test/src/ir_generation/tests/shadowed_locals.sw @@ -26,7 +26,7 @@ fn main() -> u64 { // check: $(struct_init=$VAL) = get_local __ptr { u64 }, __struct_init_0 // check: $(a_ptr=$VAL) = get_local __ptr u64, a_ // check: $(a_loaded=$VAL) = load $a_ptr -// check: $(init_aggr=$VAL) = init_aggr v109v1 [$a_loaded] +// check: $(init_aggr=$VAL) = init_aggr v110v1 [$a_loaded] // check: $(init_aggr_val=$VAL) = load $init_aggr // check: $(a___var=$VAL) = get_local __ptr { u64 }, a__