diff --git a/Makefile.toml b/Makefile.toml index 817428243..d87bc6a47 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -210,11 +210,6 @@ args = [ "midenc", ] -[tasks.install-cargo-component] -category = "Test" -description = "Install cargo-component extension" -command = "cargo" -args = ["install", "cargo-component@0.16.0"] [tasks.test-rust] category = "Test" @@ -227,7 +222,6 @@ args = [ "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", "${@}", ] -dependencies = ["install-cargo-component"] [tasks.test-lit] category = "Test" diff --git a/frontend-wasm/src/component/build_ir.rs b/frontend-wasm/src/component/build_ir.rs index 879f0e01e..24e9efb83 100644 --- a/frontend-wasm/src/component/build_ir.rs +++ b/frontend-wasm/src/component/build_ir.rs @@ -61,190 +61,3 @@ fn inline( .map_err(Report::msg)?; Ok(component_dfg.finish()) } - -#[cfg(test)] -mod tests { - use midenc_hir::{FunctionType, Ident, InterfaceFunctionIdent, InterfaceIdent, Symbol}; - use midenc_hir_type::Type; - - use super::*; - use crate::{component::StaticModuleIndex, test_utils::test_context}; - - #[test] - fn translate_simple() { - let wat = r#" - (component - (core module (;0;) - (type (;0;) (func)) - (type (;1;) (func (param i32 i32) (result i32))) - (func $add (;0;) (type 1) (param i32 i32) (result i32) - local.get 1 - local.get 0 - i32.add - ) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "add" (func $add)) - ) - (core instance (;0;) (instantiate 0)) - (alias core export 0 "memory" (core memory (;0;))) - (type (;0;) (func (param "a" u32) (param "b" u32) (result u32))) - (alias core export 0 "add" (core func (;0;))) - (func (;0;) (type 0) (canon lift (core func 0))) - (export (;1;) "add" (func 0)) - ) - "# - .to_string(); - let wasm = wat::parse_str(wat).unwrap(); - let context = test_context(); - let config = Default::default(); - let (mut component_types_builder, parsed_component) = - parse(&config, &wasm, &context.session).unwrap(); - let component_translation = - inline(&mut component_types_builder, &parsed_component).unwrap(); - - assert_eq!(parsed_component.static_modules.len(), 1); - // dbg!(&component_translation.component); - let module = &parsed_component.static_modules[StaticModuleIndex::from_u32(0)].module; - // dbg!(module); - assert_eq!(module.imports.len(), 0); - assert_eq!(component_translation.trampolines.len(), 0); - // dbg!(&component_translation.component.initializers); - assert_eq!(component_translation.component.initializers.len(), 1); - // dbg!(&component_translation.component.exports); - assert_eq!(component_translation.component.exports.len(), 1); - let component_types = component_types_builder.finish(); - let translator = ComponentTranslator::new( - component_types, - parsed_component.static_modules, - &config, - &context.session, - ); - let ir = translator.translate(component_translation).unwrap(); - - // dbg!(&ir.exports()); - assert!(!ir.modules().is_empty()); - assert!(!ir.exports().is_empty()); - let export_name_sym = Symbol::intern("add"); - let export = ir.exports().get(&export_name_sym.into()).unwrap(); - assert_eq!(export.function.function.as_symbol(), export_name_sym); - let expected_export_func_ty = FunctionType::new_wasm([Type::U32, Type::U32], [Type::U32]); - assert_eq!(export.function_ty, expected_export_func_ty); - } - - #[test] - fn translate_simple_import() { - let wat = r#" - (component - (type (;0;) - (instance - (type (;0;) (func (param "a" u32) (param "b" u32) (result u32))) - (export (;0;) "add" (func (type 0))) - ) - ) - (import "miden:add/add@1.0.0" (instance (;0;) (type 0))) - (core module (;0;) - (type (;0;) (func (param i32 i32) (result i32))) - (type (;1;) (func)) - (type (;2;) (func (param i32) (result i32))) - (import "miden:add/add@1.0.0" "add" (func $inc_wasm_component::bindings::miden::add::add::add::wit_import (;0;) (type 0))) - (func $inc (;1;) (type 2) (param i32) (result i32) - local.get 0 - i32.const 1 - call $inc_wasm_component::bindings::miden::add::add::add::wit_import - ) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "inc" (func $inc)) - ) - (alias export 0 "add" (func (;0;))) - (core func (;0;) (canon lower (func 0))) - (core instance (;0;) - (export "add" (func 0)) - ) - (core instance (;1;) (instantiate 0 - (with "miden:add/add@1.0.0" (instance 0)) - ) - ) - (alias core export 1 "memory" (core memory (;0;))) - (type (;1;) (func (param "a" u32) (result u32))) - (alias core export 1 "inc" (core func (;1;))) - (func (;1;) (type 1) (canon lift (core func 1))) - (export (;1;) "inc" (func 1)) - ) - "#.to_string(); - let wasm = wat::parse_str(wat).unwrap(); - let context = test_context(); - let interface_function_ident = InterfaceFunctionIdent { - interface: InterfaceIdent::from_full_ident("miden:add/add@1.0.0"), - function: Symbol::intern("add"), - }; - - let config = WasmTranslationConfig::default(); - let (mut component_types_builder, parsed_component) = - parse(&config, &wasm, &context.session).unwrap(); - let component_translation = - inline(&mut component_types_builder, &parsed_component).unwrap(); - assert_eq!(parsed_component.static_modules.len(), 1); - let module = &parsed_component.static_modules[StaticModuleIndex::from_u32(0)].module; - - // dbg!(&module.imports); - assert_eq!(module.imports.len(), 1); - - // dbg!(&component_translation.trampolines); - assert_eq!(component_translation.trampolines.len(), 1); - - // dbg!(&component_translation.component.initializers); - assert_eq!(component_translation.component.initializers.len(), 2); - - // dbg!(&component_translation.component.imports); - assert_eq!(component_translation.component.imports.len(), 1); - // dbg!(&component_translation.component.import_types); - assert_eq!(component_translation.component.import_types.len(), 1); - - // dbg!(&component_translation.component.exports); - assert_eq!(component_translation.component.exports.len(), 1); - - let component_types = component_types_builder.finish(); - - let translator = ComponentTranslator::new( - component_types, - parsed_component.static_modules, - &config, - &context.session, - ); - let ir = translator.translate(component_translation).unwrap(); - - // dbg!(&ir.exports()); - assert!(!ir.modules().is_empty()); - assert!(!ir.exports().is_empty()); - assert!(!ir.imports().is_empty()); - let export_name_sym = Symbol::intern("inc"); - let export = ir.exports().get(&export_name_sym.into()).unwrap(); - assert_eq!(export.function.function.as_symbol(), export_name_sym); - let expected_export_func_ty = FunctionType::new_wasm(vec![Type::U32], vec![Type::U32]); - assert_eq!(export.function_ty, expected_export_func_ty); - let module = ir.modules().first().unwrap().1; - // dbg!(&module.imports()); - let import_info = module.imports(); - dbg!(&import_info); - let function_id = *import_info - .imported(&Ident::from("miden:add/add@1.0.0")) - .unwrap() - .iter() - .collect::>() - .first() - .cloned() - .unwrap(); - dbg!(&function_id); - dbg!(ir.imports()); - let component_import = ir.imports().get(&function_id).unwrap().unwrap_canon_abi_import(); - assert_eq!(component_import.interface_function, interface_function_ident); - assert!(!component_import.function_ty().params.is_empty()); - let expected_import_func_ty = - FunctionType::new_wasm(vec![Type::U32, Type::U32], vec![Type::U32]); - assert_eq!(component_import.function_ty(), &expected_import_func_ty); - } -} diff --git a/tests/integration/expected/components/add_wasm_component.hir b/tests/integration/expected/components/add_wasm_component.hir deleted file mode 100644 index 691e50a1f..000000000 --- a/tests/integration/expected/components/add_wasm_component.hir +++ /dev/null @@ -1,1092 +0,0 @@ -(component - ;; Modules - (module #add_wasm_component - ;; Data Segments - (data (mut) (offset 1048576) 0x0100000002000000) - - ;; Constants - (const (id 0) 0x00100000) - - ;; Global Variables - (global (export #__stack_pointer) (id 0) (type i32) (const 0)) - - ;; Functions - (func (export #__wasm_call_ctors) - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #add_wasm_component::bindings::__link_custom_section_describing_imports) - - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #__rust_alloc) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048584)) - (let (v4 i32) (call #::alloc v3 v1 v0)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #__rust_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048584)) - (let (v7 i32) (call #::alloc v6 v2 v3)) - (let (v8 i1) (eq v7 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2 v7) (block 3))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v23 i32) - (br (block 1 v23))) - - (block 3 - (let (v11 u32) (bitcast v1)) - (let (v12 u32) (bitcast v3)) - (let (v13 i1) (lt v11 v12)) - (let (v14 i32) (sext v13)) - (let (v15 i1) (neq v14 0)) - (let (v16 i32) (select v15 v1 v3)) - (let (v17 u32) (bitcast v16)) - (let (v18 u32) (bitcast v7)) - (let (v19 (ptr u8)) (inttoptr v18)) - (let (v20 u32) (bitcast v0)) - (let (v21 (ptr u8)) (inttoptr v20)) - (memcpy v21 v19 v17) - (let (v22 i32) (const.i32 1048584)) - (call #::dealloc v22 v0 v2 v1) - (br (block 2 v7))) - ) - - (func (export #miden:add-package/add-interface@1.0.0#add) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (call #wit_bindgen_rt::run_ctors_once) - (let (v3 i32) (add.wrapping v1 v0)) - (br (block 1 v3))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #wit_bindgen_rt::cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v19 i32) - (br (block 1 v19))) - - (block 3 (param v17 i32) - (let (v18 i1) (neq v17 0)) - (condbr v18 (block 2 v17) (block 7))) - - (block 4 - (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 3 v16))) - - (block 5 - (let (v6 i1) (eq v3 0)) - (let (v7 i32) (zext v6)) - (let (v8 i1) (neq v7 0)) - (condbr v8 (block 2 v2) (block 6))) - - (block 6 - (let (v9 i32) (const.i32 0)) - (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048588)) - (let (v12 (ptr u8)) (inttoptr v11)) - (let (v13 u8) (load v12)) - (let (v14 i32) (zext v13)) - (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 3 v15))) - - (block 7 - (unreachable)) - ) - - (func (export #wit_bindgen_rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048589)) - (let (v3 (ptr u8)) (inttoptr v2)) - (let (v4 u8) (load v3)) - (let (v5 i32) (zext v4)) - (let (v6 i1) (neq v5 0)) - (condbr v6 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (call #__wasm_call_ctors) - (let (v7 i32) (const.i32 0)) - (let (v8 i32) (const.i32 1)) - (let (v9 u32) (bitcast v8)) - (let (v10 u8) (trunc v9)) - (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048589)) - (let (v13 (ptr u8)) (inttoptr v12)) - (store v13 v10) - (br (block 2))) - ) - - (func (export #wee_alloc::alloc_first_fit) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 u32) (bitcast v2)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 i1) (neq v8 0)) - (condbr v9 (block 2) (block 3))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 - (let (v11 i32) (const.i32 -1)) - (let (v12 i32) (add.wrapping v1 v11)) - (let (v13 i32) (const.i32 0)) - (let (v14 i32) (sub.wrapping v13 v1)) - (let (v15 i32) (const.i32 2)) - (let (v16 u32) (bitcast v15)) - (let (v17 i32) (shl.wrapping v0 v16)) - (br (block 4 v8 v2 v17 v14 v12))) - - (block 3 - (let (v10 i32) (const.i32 0)) - (ret v10)) - - (block 4 - (param v18 i32) - (param v169 i32) - (param v182 i32) - (param v197 i32) - (param v210 i32) - (let (v19 u32) (bitcast v18)) - (let (v20 u32) (add.checked v19 8)) - (let (v21 u32) (mod.unchecked v20 4)) - (assertz 250 v21) - (let (v22 (ptr i32)) (inttoptr v20)) - (let (v23 i32) (load v22)) - (let (v24 i32) (const.i32 1)) - (let (v25 i32) (band v23 v24)) - (let (v26 i1) (neq v25 0)) - (condbr v26 (block 7) (block 8))) - - (block 5 - (let (v344 i32) (const.i32 0)) - (br (block 1 v344))) - - (block 6 - (param v172 i32) - (param v179 i32) - (param v181 i32) - (param v196 i32) - (param v209 i32) - (param v218 i32) - (param v219 i32) - (let (v173 u32) (bitcast v172)) - (let (v174 u32) (mod.unchecked v173 4)) - (assertz 250 v174) - (let (v175 (ptr i32)) (inttoptr v173)) - (let (v176 i32) (load v175)) - (let (v177 i32) (const.i32 -4)) - (let (v178 i32) (band v176 v177)) - (let (v180 i32) (sub.wrapping v178 v179)) - (let (v188 u32) (bitcast v180)) - (let (v189 u32) (bitcast v181)) - (let (v190 i1) (lt v188 v189)) - (let (v191 i32) (sext v190)) - (let (v192 i1) (neq v191 0)) - (condbr v192 (block 22 v218 v219 v181 v196 v209) (block 23))) - - (block 7 - (br (block 9 v18 v23 v169 v182 v197 v210))) - - (block 8 - (let (v27 i32) (const.i32 8)) - (let (v28 i32) (add.wrapping v18 v27)) - (br (block 6 v18 v28 v182 v197 v210 v169 v23))) - - (block 9 - (param v29 i32) - (param v30 i32) - (param v156 i32) - (param v187 i32) - (param v202 i32) - (param v215 i32) - (let (v31 i32) (const.i32 -2)) - (let (v32 i32) (band v30 v31)) - (let (v33 u32) (bitcast v29)) - (let (v34 u32) (add.checked v33 8)) - (let (v35 u32) (mod.unchecked v34 4)) - (assertz 250 v35) - (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v32) - (let (v37 u32) (bitcast v29)) - (let (v38 u32) (add.checked v37 4)) - (let (v39 u32) (mod.unchecked v38 4)) - (assertz 250 v39) - (let (v40 (ptr i32)) (inttoptr v38)) - (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 -4)) - (let (v43 i32) (band v41 v42)) - (let (v44 i1) (neq v43 0)) - (condbr v44 (block 12) (block 13))) - - (block 10 - (let (v170 i32) (const.i32 8)) - (let (v171 i32) (add.wrapping v157 v170)) - (br (block 6 v157 v171 v183 v198 v211 v152 v165))) - - (block 11 - (param v55 i32) - (param v75 i32) - (param v122 i32) - (param v142 i32) - (param v155 i32) - (param v186 i32) - (param v201 i32) - (param v214 i32) - (let (v56 u32) (bitcast v55)) - (let (v57 u32) (mod.unchecked v56 4)) - (assertz 250 v57) - (let (v58 (ptr i32)) (inttoptr v56)) - (let (v59 i32) (load v58)) - (let (v60 i32) (const.i32 -4)) - (let (v61 i32) (band v59 v60)) - (let (v62 i1) (eq v61 0)) - (let (v63 i32) (zext v62)) - (let (v64 i1) (neq v63 0)) - (condbr v64 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 15))) - - (block 12 - (let (v46 i32) (const.i32 0)) - (let (v47 u32) (bitcast v43)) - (let (v48 (ptr u8)) (inttoptr v47)) - (let (v49 u8) (load v48)) - (let (v50 i32) (zext v49)) - (let (v51 i32) (const.i32 1)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (neq v52 0)) - (let (v54 i32) (select v53 v46 v43)) - (br (block 11 v29 v43 v41 v54 v156 v187 v202 v215))) - - (block 13 - (let (v45 i32) (const.i32 0)) - (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) - - (block 14 - (param v92 i32) - (param v102 i32) - (param v109 i32) - (param v121 i32) - (param v141 i32) - (param v154 i32) - (param v185 i32) - (param v200 i32) - (param v213 i32) - (let (v93 i1) (eq v92 0)) - (let (v94 i32) (zext v93)) - (let (v95 i1) (neq v94 0)) - (condbr v95 (block 17 v109 v121 v102 v141 v154 v185 v200 v213) (block 18))) - - (block 15 - (let (v65 i32) (const.i32 2)) - (let (v66 i32) (band v59 v65)) - (let (v67 i1) (neq v66 0)) - (condbr v67 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 16))) - - (block 16 - (let (v68 u32) (bitcast v61)) - (let (v69 u32) (add.checked v68 4)) - (let (v70 u32) (mod.unchecked v69 4)) - (assertz 250 v70) - (let (v71 (ptr i32)) (inttoptr v69)) - (let (v72 i32) (load v71)) - (let (v73 i32) (const.i32 3)) - (let (v74 i32) (band v72 v73)) - (let (v76 i32) (bor v74 v75)) - (let (v77 u32) (bitcast v61)) - (let (v78 u32) (add.checked v77 4)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v76) - (let (v81 u32) (bitcast v55)) - (let (v82 u32) (add.checked v81 4)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (let (v85 i32) (load v84)) - (let (v86 i32) (const.i32 -4)) - (let (v87 i32) (band v85 v86)) - (let (v88 u32) (bitcast v55)) - (let (v89 u32) (mod.unchecked v88 4)) - (assertz 250 v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (let (v91 i32) (load v90)) - (br (block 14 v87 v91 v55 v85 v142 v155 v186 v201 v214))) - - (block 17 - (param v119 i32) - (param v120 i32) - (param v129 i32) - (param v140 i32) - (param v153 i32) - (param v184 i32) - (param v199 i32) - (param v212 i32) - (let (v123 i32) (const.i32 3)) - (let (v124 i32) (band v120 v123)) - (let (v125 u32) (bitcast v119)) - (let (v126 u32) (add.checked v125 4)) - (let (v127 u32) (mod.unchecked v126 4)) - (assertz 250 v127) - (let (v128 (ptr i32)) (inttoptr v126)) - (store v128 v124) - (let (v130 i32) (const.i32 3)) - (let (v131 i32) (band v129 v130)) - (let (v132 u32) (bitcast v119)) - (let (v133 u32) (mod.unchecked v132 4)) - (assertz 250 v133) - (let (v134 (ptr i32)) (inttoptr v132)) - (store v134 v131) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v129 v135)) - (let (v137 i1) (eq v136 0)) - (let (v138 i32) (zext v137)) - (let (v139 i1) (neq v138 0)) - (condbr v139 (block 19 v153 v140 v184 v199 v212) (block 20))) - - (block 18 - (let (v96 u32) (bitcast v92)) - (let (v97 u32) (mod.unchecked v96 4)) - (assertz 250 v97) - (let (v98 (ptr i32)) (inttoptr v96)) - (let (v99 i32) (load v98)) - (let (v100 i32) (const.i32 3)) - (let (v101 i32) (band v99 v100)) - (let (v103 i32) (const.i32 -4)) - (let (v104 i32) (band v102 v103)) - (let (v105 i32) (bor v101 v104)) - (let (v106 u32) (bitcast v92)) - (let (v107 u32) (mod.unchecked v106 4)) - (assertz 250 v107) - (let (v108 (ptr i32)) (inttoptr v106)) - (store v108 v105) - (let (v110 u32) (bitcast v109)) - (let (v111 u32) (add.checked v110 4)) - (let (v112 u32) (mod.unchecked v111 4)) - (assertz 250 v112) - (let (v113 (ptr i32)) (inttoptr v111)) - (let (v114 i32) (load v113)) - (let (v115 u32) (bitcast v109)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (let (v118 i32) (load v117)) - (br (block 17 v109 v114 v118 v141 v154 v185 v200 v213))) - - (block 19 - (param v152 i32) - (param v157 i32) - (param v183 i32) - (param v198 i32) - (param v211 i32) - (let (v158 u32) (bitcast v152)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v161 u32) (bitcast v157)) - (let (v162 u32) (add.checked v161 8)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (band v165 v166)) - (let (v168 i1) (neq v167 0)) - (condbr v168 (block 9 v157 v165 v152 v183 v198 v211) (block 21))) - - (block 20 - (let (v143 u32) (bitcast v140)) - (let (v144 u32) (mod.unchecked v143 4)) - (assertz 250 v144) - (let (v145 (ptr i32)) (inttoptr v143)) - (let (v146 i32) (load v145)) - (let (v147 i32) (const.i32 2)) - (let (v148 i32) (bor v146 v147)) - (let (v149 u32) (bitcast v140)) - (let (v150 u32) (mod.unchecked v149 4)) - (assertz 250 v150) - (let (v151 (ptr i32)) (inttoptr v149)) - (store v151 v148) - (br (block 19 v153 v140 v184 v199 v212))) - - (block 21 - (br (block 10))) - - (block 22 - (param v335 i32) - (param v336 i32) - (param v341 i32) - (param v342 i32) - (param v343 i32) - (let (v337 u32) (bitcast v335)) - (let (v338 u32) (mod.unchecked v337 4)) - (assertz 250 v338) - (let (v339 (ptr i32)) (inttoptr v337)) - (store v339 v336) - (let (v340 i1) (neq v336 0)) - (condbr v340 (block 4 v336 v335 v341 v342 v343) (block 33))) - - (block 23 - (let (v193 i32) (const.i32 72)) - (let (v194 i32) (add.wrapping v179 v193)) - (let (v195 i32) (sub.wrapping v178 v181)) - (let (v203 i32) (band v195 v196)) - (let (v204 u32) (bitcast v194)) - (let (v205 u32) (bitcast v203)) - (let (v206 i1) (lte v204 v205)) - (let (v207 i32) (sext v206)) - (let (v208 i1) (neq v207 0)) - (condbr v208 (block 25) (block 26))) - - (block 24 (param v326 i32) (param v327 i32) - (let (v328 i32) (const.i32 1)) - (let (v329 i32) (bor v327 v328)) - (let (v330 u32) (bitcast v326)) - (let (v331 u32) (mod.unchecked v330 4)) - (assertz 250 v331) - (let (v332 (ptr i32)) (inttoptr v330)) - (store v332 v329) - (let (v333 i32) (const.i32 8)) - (let (v334 i32) (add.wrapping v326 v333)) - (ret v334)) - - (block 25 - (let (v229 i32) (const.i32 0)) - (let (v230 i32) (const.i32 0)) - (let (v231 u32) (bitcast v203)) - (let (v232 u32) (mod.unchecked v231 4)) - (assertz 250 v232) - (let (v233 (ptr i32)) (inttoptr v231)) - (store v233 v230) - (let (v234 i32) (const.i32 -8)) - (let (v235 i32) (add.wrapping v203 v234)) - (let (v236 i64) (const.i64 0)) - (let (v237 u32) (bitcast v235)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i64)) (inttoptr v237)) - (store v239 v236) - (let (v240 u32) (bitcast v172)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (let (v244 i32) (const.i32 -4)) - (let (v245 i32) (band v243 v244)) - (let (v246 u32) (bitcast v235)) - (let (v247 u32) (mod.unchecked v246 4)) - (assertz 250 v247) - (let (v248 (ptr i32)) (inttoptr v246)) - (store v248 v245) - (let (v249 u32) (bitcast v172)) - (let (v250 u32) (mod.unchecked v249 4)) - (assertz 250 v250) - (let (v251 (ptr i32)) (inttoptr v249)) - (let (v252 i32) (load v251)) - (let (v253 i32) (const.i32 -4)) - (let (v254 i32) (band v252 v253)) - (let (v255 i1) (eq v254 0)) - (let (v256 i32) (zext v255)) - (let (v257 i1) (neq v256 0)) - (condbr v257 (block 28 v235 v229 v172 v179) (block 29))) - - (block 26 - (let (v216 i32) (band v209 v179)) - (let (v217 i1) (neq v216 0)) - (condbr v217 (block 22 v218 v219 v181 v196 v209) (block 27))) - - (block 27 - (let (v220 i32) (const.i32 -4)) - (let (v221 i32) (band v219 v220)) - (let (v222 u32) (bitcast v218)) - (let (v223 u32) (mod.unchecked v222 4)) - (assertz 250 v223) - (let (v224 (ptr i32)) (inttoptr v222)) - (store v224 v221) - (let (v225 u32) (bitcast v172)) - (let (v226 u32) (mod.unchecked v225 4)) - (assertz 250 v226) - (let (v227 (ptr i32)) (inttoptr v225)) - (let (v228 i32) (load v227)) - (br (block 24 v172 v228))) - - (block 28 - (param v280 i32) - (param v281 i32) - (param v282 i32) - (param v288 i32) - (let (v283 i32) (bor v281 v282)) - (let (v284 u32) (bitcast v280)) - (let (v285 u32) (add.checked v284 4)) - (let (v286 u32) (mod.unchecked v285 4)) - (assertz 250 v286) - (let (v287 (ptr i32)) (inttoptr v285)) - (store v287 v283) - (let (v289 u32) (bitcast v288)) - (let (v290 u32) (mod.unchecked v289 4)) - (assertz 250 v290) - (let (v291 (ptr i32)) (inttoptr v289)) - (let (v292 i32) (load v291)) - (let (v293 i32) (const.i32 -2)) - (let (v294 i32) (band v292 v293)) - (let (v295 u32) (bitcast v288)) - (let (v296 u32) (mod.unchecked v295 4)) - (assertz 250 v296) - (let (v297 (ptr i32)) (inttoptr v295)) - (store v297 v294) - (let (v298 u32) (bitcast v282)) - (let (v299 u32) (mod.unchecked v298 4)) - (assertz 250 v299) - (let (v300 (ptr i32)) (inttoptr v298)) - (let (v301 i32) (load v300)) - (let (v302 i32) (const.i32 3)) - (let (v303 i32) (band v301 v302)) - (let (v304 i32) (bor v303 v280)) - (let (v305 u32) (bitcast v282)) - (let (v306 u32) (mod.unchecked v305 4)) - (assertz 250 v306) - (let (v307 (ptr i32)) (inttoptr v305)) - (store v307 v304) - (let (v308 i32) (const.i32 2)) - (let (v309 i32) (band v301 v308)) - (let (v310 i1) (neq v309 0)) - (condbr v310 (block 31) (block 32))) - - (block 29 - (let (v258 i32) (const.i32 2)) - (let (v259 i32) (band v252 v258)) - (let (v260 i1) (neq v259 0)) - (condbr v260 (block 28 v235 v229 v172 v179) (block 30))) - - (block 30 - (let (v261 u32) (bitcast v254)) - (let (v262 u32) (add.checked v261 4)) - (let (v263 u32) (mod.unchecked v262 4)) - (assertz 250 v263) - (let (v264 (ptr i32)) (inttoptr v262)) - (let (v265 i32) (load v264)) - (let (v266 i32) (const.i32 3)) - (let (v267 i32) (band v265 v266)) - (let (v268 i32) (bor v267 v235)) - (let (v269 u32) (bitcast v254)) - (let (v270 u32) (add.checked v269 4)) - (let (v271 u32) (mod.unchecked v270 4)) - (assertz 250 v271) - (let (v272 (ptr i32)) (inttoptr v270)) - (store v272 v268) - (let (v273 u32) (bitcast v235)) - (let (v274 u32) (add.checked v273 4)) - (let (v275 u32) (mod.unchecked v274 4)) - (assertz 250 v275) - (let (v276 (ptr i32)) (inttoptr v274)) - (let (v277 i32) (load v276)) - (let (v278 i32) (const.i32 3)) - (let (v279 i32) (band v277 v278)) - (br (block 28 v235 v279 v172 v179))) - - (block 31 - (let (v315 i32) (const.i32 -3)) - (let (v316 i32) (band v304 v315)) - (let (v317 u32) (bitcast v282)) - (let (v318 u32) (mod.unchecked v317 4)) - (assertz 250 v318) - (let (v319 (ptr i32)) (inttoptr v317)) - (store v319 v316) - (let (v320 u32) (bitcast v280)) - (let (v321 u32) (mod.unchecked v320 4)) - (assertz 250 v321) - (let (v322 (ptr i32)) (inttoptr v320)) - (let (v323 i32) (load v322)) - (let (v324 i32) (const.i32 2)) - (let (v325 i32) (bor v323 v324)) - (br (block 24 v280 v325))) - - (block 32 - (let (v311 u32) (bitcast v280)) - (let (v312 u32) (mod.unchecked v311 4)) - (assertz 250 v312) - (let (v313 (ptr i32)) (inttoptr v311)) - (let (v314 i32) (load v313)) - (br (block 24 v280 v314))) - - (block 33 - (br (block 5))) - ) - - (func (export #::alloc) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 16)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 i1) (neq v2 0)) - (condbr v9 (block 3) (block 4))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 (param v98 i32) (param v102 i32) - (let (v99 i32) (const.i32 16)) - (let (v100 i32) (add.wrapping v98 v99)) - (let (v101 (ptr i32)) (global.symbol #__stack_pointer)) - (store v101 v100) - (br (block 1 v102))) - - (block 3 - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (let (v13 i32) (load v12)) - (let (v14 u32) (bitcast v7)) - (let (v15 u32) (add.checked v14 12)) - (let (v16 u32) (mod.unchecked v15 4)) - (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (store v17 v13) - (let (v18 i32) (const.i32 3)) - (let (v19 i32) (add.wrapping v2 v18)) - (let (v20 i32) (const.i32 2)) - (let (v21 u32) (bitcast v19)) - (let (v22 u32) (bitcast v20)) - (let (v23 u32) (shr.wrapping v21 v22)) - (let (v24 i32) (bitcast v23)) - (let (v25 i32) (const.i32 12)) - (let (v26 i32) (add.wrapping v7 v25)) - (let (v27 i32) (call #wee_alloc::alloc_first_fit v24 v1 v26)) - (let (v28 i1) (neq v27 0)) - (condbr v28 (block 5 v0 v7 v27) (block 6))) - - (block 4 - (br (block 2 v7 v1))) - - (block 5 (param v88 i32) (param v89 i32) (param v103 i32) - (let (v90 u32) (bitcast v89)) - (let (v91 u32) (add.checked v90 12)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (let (v94 i32) (load v93)) - (let (v95 u32) (bitcast v88)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (store v97 v94) - (br (block 2 v89 v103))) - - (block 6 - (let (v29 i32) (const.i32 -4)) - (let (v30 i32) (band v19 v29)) - (let (v31 i32) (const.i32 3)) - (let (v32 u32) (bitcast v31)) - (let (v33 i32) (shl.wrapping v1 v32)) - (let (v34 i32) (const.i32 512)) - (let (v35 i32) (add.wrapping v33 v34)) - (let (v36 u32) (bitcast v30)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (gt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (let (v41 i32) (select v40 v30 v35)) - (let (v42 i32) (const.i32 65543)) - (let (v43 i32) (add.wrapping v41 v42)) - (let (v44 i32) (const.i32 16)) - (let (v45 u32) (bitcast v43)) - (let (v46 u32) (bitcast v44)) - (let (v47 u32) (shr.wrapping v45 v46)) - (let (v48 i32) (bitcast v47)) - (let (v49 u32) (bitcast v48)) - (let (v50 i32) (memory.grow v49)) - (let (v51 i32) (const.i32 -1)) - (let (v52 i1) (neq v50 v51)) - (let (v53 i32) (zext v52)) - (let (v54 i1) (neq v53 0)) - (condbr v54 (block 7) (block 8))) - - (block 7 - (let (v56 i32) (const.i32 16)) - (let (v57 u32) (bitcast v56)) - (let (v58 i32) (shl.wrapping v50 v57)) - (let (v59 i32) (const.i32 0)) - (let (v60 u32) (bitcast v58)) - (let (v61 u32) (add.checked v60 4)) - (let (v62 u32) (mod.unchecked v61 4)) - (assertz 250 v62) - (let (v63 (ptr i32)) (inttoptr v61)) - (store v63 v59) - (let (v64 u32) (bitcast v7)) - (let (v65 u32) (add.checked v64 12)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v58)) - (let (v70 u32) (add.checked v69 8)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 i32) (const.i32 -65536)) - (let (v74 i32) (band v43 v73)) - (let (v75 i32) (add.wrapping v58 v74)) - (let (v76 i32) (const.i32 2)) - (let (v77 i32) (bor v75 v76)) - (let (v78 u32) (bitcast v58)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v77) - (let (v81 u32) (bitcast v7)) - (let (v82 u32) (add.checked v81 12)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (store v84 v58) - (let (v85 i32) (const.i32 12)) - (let (v86 i32) (add.wrapping v7 v85)) - (let (v87 i32) (call #wee_alloc::alloc_first_fit v24 v1 v86)) - (br (block 5 v0 v7 v87))) - - (block 8 - (let (v55 i32) (const.i32 0)) - (br (block 5 v0 v7 v55))) - ) - - (func (export #::dealloc) - (param i32) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i1) (eq v1 0)) - (let (v6 i32) (zext v5)) - (let (v7 i1) (neq v6 0)) - (condbr v7 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (let (v8 i1) (eq v3 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2) (block 4))) - - (block 4 - (let (v11 u32) (bitcast v0)) - (let (v12 u32) (mod.unchecked v11 4)) - (assertz 250 v12) - (let (v13 (ptr i32)) (inttoptr v11)) - (let (v14 i32) (load v13)) - (let (v15 i32) (const.i32 0)) - (let (v16 u32) (bitcast v1)) - (let (v17 u32) (mod.unchecked v16 4)) - (assertz 250 v17) - (let (v18 (ptr i32)) (inttoptr v16)) - (store v18 v15) - (let (v19 i32) (const.i32 -8)) - (let (v20 i32) (add.wrapping v1 v19)) - (let (v21 u32) (bitcast v20)) - (let (v22 u32) (mod.unchecked v21 4)) - (assertz 250 v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i32) (const.i32 -2)) - (let (v26 i32) (band v24 v25)) - (let (v27 u32) (bitcast v20)) - (let (v28 u32) (mod.unchecked v27 4)) - (assertz 250 v28) - (let (v29 (ptr i32)) (inttoptr v27)) - (store v29 v26) - (let (v30 i32) (const.i32 -4)) - (let (v31 i32) (add.wrapping v1 v30)) - (let (v32 u32) (bitcast v31)) - (let (v33 u32) (mod.unchecked v32 4)) - (assertz 250 v33) - (let (v34 (ptr i32)) (inttoptr v32)) - (let (v35 i32) (load v34)) - (let (v36 i32) (const.i32 -4)) - (let (v37 i32) (band v35 v36)) - (let (v38 i1) (eq v37 0)) - (let (v39 i32) (zext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) - - (block 5 (param v177 i32) (param v183 i32) - (let (v185 u32) (bitcast v177)) - (let (v186 u32) (mod.unchecked v185 4)) - (assertz 250 v186) - (let (v187 (ptr i32)) (inttoptr v185)) - (store v187 v183) - (br (block 2))) - - (block 6 - (param v172 i32) - (param v173 i32) - (param v182 i32) - (param v184 i32) - (let (v174 u32) (bitcast v172)) - (let (v175 u32) (mod.unchecked v174 4)) - (assertz 250 v175) - (let (v176 (ptr i32)) (inttoptr v174)) - (store v176 v173) - (br (block 5 v182 v184))) - - (block 7 (param v168 i32) (param v178 i32) - (br (block 5 v178 v168))) - - (block 8 - (param v134 i32) - (param v150 i32) - (param v161 i32) - (param v171 i32) - (param v181 i32) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v134 v135)) - (let (v137 i1) (neq v136 0)) - (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) - - (block 9 - (let (v41 u32) (bitcast v37)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (let (v44 i32) (load v43)) - (let (v45 i32) (const.i32 1)) - (let (v46 i32) (band v44 v45)) - (let (v47 i1) (neq v46 0)) - (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) - - (block 10 - (let (v48 i32) (const.i32 -4)) - (let (v49 i32) (band v24 v48)) - (let (v50 i1) (neq v49 0)) - (condbr v50 (block 13) (block 14))) - - (block 11 - (param v104 i32) - (param v105 i32) - (param v111 i32) - (param v112 i32) - (param v123 i32) - (param v169 i32) - (param v179 i32) - (let (v106 i32) (const.i32 3)) - (let (v107 i32) (band v105 v106)) - (let (v108 u32) (bitcast v104)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (store v110 v107) - (let (v113 i32) (const.i32 3)) - (let (v114 i32) (band v112 v113)) - (let (v115 u32) (bitcast v111)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (store v117 v114) - (let (v118 i32) (const.i32 2)) - (let (v119 i32) (band v112 v118)) - (let (v120 i1) (eq v119 0)) - (let (v121 i32) (zext v120)) - (let (v122 i1) (neq v121 0)) - (condbr v122 (block 7 v169 v179) (block 17))) - - (block 12 - (param v83 i32) - (param v84 i32) - (param v87 i32) - (param v94 i32) - (param v99 i32) - (param v124 i32) - (param v170 i32) - (param v180 i32) - (let (v85 i32) (const.i32 -4)) - (let (v86 i32) (band v84 v85)) - (let (v88 i32) (const.i32 3)) - (let (v89 i32) (band v87 v88)) - (let (v90 i32) (bor v86 v89)) - (let (v91 u32) (bitcast v83)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (store v93 v90) - (let (v95 u32) (bitcast v94)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (let (v98 i32) (load v97)) - (let (v100 u32) (bitcast v99)) - (let (v101 u32) (mod.unchecked v100 4)) - (assertz 250 v101) - (let (v102 (ptr i32)) (inttoptr v100)) - (let (v103 i32) (load v102)) - (br (block 11 v94 v98 v99 v103 v124 v170 v180))) - - (block 13 - (let (v51 i32) (const.i32 2)) - (let (v52 i32) (band v24 v51)) - (let (v53 i1) (neq v52 0)) - (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) - - (block 14 - (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) - - (block 15 - (let (v54 u32) (bitcast v49)) - (let (v55 u32) (add.checked v54 4)) - (let (v56 u32) (mod.unchecked v55 4)) - (assertz 250 v56) - (let (v57 (ptr i32)) (inttoptr v55)) - (let (v58 i32) (load v57)) - (let (v59 i32) (const.i32 3)) - (let (v60 i32) (band v58 v59)) - (let (v61 i32) (bor v60 v37)) - (let (v62 u32) (bitcast v49)) - (let (v63 u32) (add.checked v62 4)) - (let (v64 u32) (mod.unchecked v63 4)) - (assertz 250 v64) - (let (v65 (ptr i32)) (inttoptr v63)) - (store v65 v61) - (let (v66 u32) (bitcast v20)) - (let (v67 u32) (mod.unchecked v66 4)) - (assertz 250 v67) - (let (v68 (ptr i32)) (inttoptr v66)) - (let (v69 i32) (load v68)) - (let (v70 u32) (bitcast v31)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (let (v74 i32) (const.i32 -4)) - (let (v75 i32) (band v73 v74)) - (let (v76 i1) (eq v75 0)) - (let (v77 i32) (zext v76)) - (let (v78 i1) (neq v77 0)) - (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) - - (block 16 - (let (v79 u32) (bitcast v75)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) - - (block 17 - (let (v125 u32) (bitcast v123)) - (let (v126 u32) (mod.unchecked v125 4)) - (assertz 250 v126) - (let (v127 (ptr i32)) (inttoptr v125)) - (let (v128 i32) (load v127)) - (let (v129 i32) (const.i32 2)) - (let (v130 i32) (bor v128 v129)) - (let (v131 u32) (bitcast v123)) - (let (v132 u32) (mod.unchecked v131 4)) - (assertz 250 v132) - (let (v133 (ptr i32)) (inttoptr v131)) - (store v133 v130) - (br (block 7 v169 v179))) - - (block 18 - (let (v138 i32) (const.i32 -4)) - (let (v139 i32) (band v134 v138)) - (let (v140 i1) (eq v139 0)) - (let (v141 i32) (zext v140)) - (let (v142 i1) (neq v141 0)) - (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) - - (block 19 - (let (v143 u32) (bitcast v139)) - (let (v144 (ptr u8)) (inttoptr v143)) - (let (v145 u8) (load v144)) - (let (v146 i32) (zext v145)) - (let (v147 i32) (const.i32 1)) - (let (v148 i32) (band v146 v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) - - (block 20 - (let (v151 u32) (bitcast v139)) - (let (v152 u32) (add.checked v151 8)) - (let (v153 u32) (mod.unchecked v152 4)) - (assertz 250 v153) - (let (v154 (ptr i32)) (inttoptr v152)) - (let (v155 i32) (load v154)) - (let (v156 i32) (const.i32 -4)) - (let (v157 i32) (band v155 v156)) - (let (v158 u32) (bitcast v150)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v162 i32) (const.i32 1)) - (let (v163 i32) (bor v161 v162)) - (let (v164 u32) (bitcast v139)) - (let (v165 u32) (add.checked v164 8)) - (let (v166 u32) (mod.unchecked v165 4)) - (assertz 250 v166) - (let (v167 (ptr i32)) (inttoptr v165)) - (store v167 v163) - (br (block 7 v171 v181))) - ) - - (func (export #cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) - (br (block 1 v5))) - - (block 1 (param v4 i32) - (ret v4)) - ) - ) - -) diff --git a/tests/integration/expected/components/add_wasm_component.wat b/tests/integration/expected/components/add_wasm_component.wat deleted file mode 100644 index 218186cbd..000000000 --- a/tests/integration/expected/components/add_wasm_component.wat +++ /dev/null @@ -1,700 +0,0 @@ -(component - (core module (;0;) - (type (;0;) (func)) - (type (;1;) (func (param i32 i32) (result i32))) - (type (;2;) (func (param i32 i32 i32 i32) (result i32))) - (type (;3;) (func (param i32 i32 i32) (result i32))) - (type (;4;) (func (param i32 i32 i32 i32))) - (func $__wasm_call_ctors (;0;) (type 0)) - (func $add_wasm_component::bindings::__link_custom_section_describing_imports (;1;) (type 0)) - (func $__rust_alloc (;2;) (type 1) (param i32 i32) (result i32) - i32.const 1048584 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) - (local i32) - block ;; label = @1 - i32.const 1048584 - local.get 2 - local.get 3 - call $::alloc - local.tee 4 - i32.eqz - br_if 0 (;@1;) - local.get 4 - local.get 0 - local.get 1 - local.get 3 - local.get 1 - local.get 3 - i32.lt_u - select - memory.copy - i32.const 1048584 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc - end - local.get 4 - ) - (func $miden:add-package/add-interface@1.0.0#add (;4;) (type 1) (param i32 i32) (result i32) - call $wit_bindgen_rt::run_ctors_once - local.get 1 - local.get 0 - i32.add - ) - (func $wit_bindgen_rt::cabi_realloc (;5;) (type 2) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 1 - br_if 0 (;@3;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - i32.const 0 - i32.load8_u offset=1048588 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@2;) - end - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rust_realloc - local.set 2 - end - local.get 2 - br_if 0 (;@1;) - unreachable - end - local.get 2 - ) - (func $wit_bindgen_rt::run_ctors_once (;6;) (type 0) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048589 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048589 - end - ) - (func $wee_alloc::alloc_first_fit (;7;) (type 3) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 2 - i32.load - local.tee 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 1 - i32.const -1 - i32.add - local.set 4 - i32.const 0 - local.get 1 - i32.sub - local.set 5 - local.get 0 - i32.const 2 - i32.shl - local.set 6 - loop ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - local.get 3 - i32.const 8 - i32.add - local.set 0 - br 1 (;@2;) - end - loop ;; label = @3 - local.get 3 - local.get 1 - i32.const -2 - i32.and - i32.store offset=8 - block ;; label = @4 - block ;; label = @5 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@5;) - i32.const 0 - local.set 8 - br 1 (;@4;) - end - i32.const 0 - local.get 0 - local.get 0 - i32.load8_u - i32.const 1 - i32.and - select - local.set 8 - end - block ;; label = @4 - local.get 3 - i32.load - local.tee 1 - i32.const -4 - i32.and - local.tee 9 - i32.eqz - br_if 0 (;@4;) - local.get 1 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 9 - local.get 9 - i32.load offset=4 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.set 0 - local.get 3 - i32.load - local.set 1 - end - block ;; label = @4 - local.get 0 - i32.eqz - br_if 0 (;@4;) - local.get 0 - local.get 0 - i32.load - i32.const 3 - i32.and - local.get 1 - i32.const -4 - i32.and - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 1 - end - local.get 3 - local.get 7 - i32.const 3 - i32.and - i32.store offset=4 - local.get 3 - local.get 1 - i32.const 3 - i32.and - i32.store - block ;; label = @4 - local.get 1 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 - local.get 8 - i32.store - local.get 8 - local.set 3 - local.get 8 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - end - local.get 8 - i32.const 8 - i32.add - local.set 0 - local.get 8 - local.set 3 - end - block ;; label = @2 - local.get 3 - i32.load - i32.const -4 - i32.and - local.tee 8 - local.get 0 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.const 72 - i32.add - local.get 8 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 8 - i32.le_u - br_if 0 (;@4;) - local.get 4 - local.get 0 - i32.and - br_if 2 (;@2;) - local.get 2 - local.get 1 - i32.const -4 - i32.and - i32.store - local.get 3 - i32.load - local.set 0 - local.get 3 - local.set 1 - br 1 (;@3;) - end - i32.const 0 - local.set 7 - local.get 8 - i32.const 0 - i32.store - local.get 8 - i32.const -8 - i32.add - local.tee 1 - i64.const 0 - i64.store align=4 - local.get 1 - local.get 3 - i32.load - i32.const -4 - i32.and - i32.store - block ;; label = @4 - local.get 3 - i32.load - local.tee 9 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@4;) - local.get 9 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 1 - i32.load offset=4 - i32.const 3 - i32.and - local.set 7 - end - local.get 1 - local.get 7 - local.get 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 0 - i32.load - i32.const -2 - i32.and - i32.store - local.get 3 - local.get 3 - i32.load - local.tee 0 - i32.const 3 - i32.and - local.get 1 - i32.or - local.tee 8 - i32.store - block ;; label = @4 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 1 - i32.load - local.set 0 - br 1 (;@3;) - end - local.get 3 - local.get 8 - i32.const -3 - i32.and - i32.store - local.get 1 - i32.load - i32.const 2 - i32.or - local.set 0 - end - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store - local.get 1 - i32.const 8 - i32.add - return - end - local.get 2 - local.get 1 - i32.store - local.get 1 - local.set 3 - local.get 1 - br_if 0 (;@1;) - end - i32.const 0 - ) - (func $::alloc (;8;) (type 3) (param i32 i32 i32) (result i32) - (local i32 i32 i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 3 - global.set $__stack_pointer - block ;; label = @1 - block ;; label = @2 - local.get 2 - br_if 0 (;@2;) - local.get 1 - local.set 2 - br 1 (;@1;) - end - local.get 3 - local.get 0 - i32.load - i32.store offset=12 - block ;; label = @2 - local.get 2 - i32.const 3 - i32.add - local.tee 4 - i32.const 2 - i32.shr_u - local.tee 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.tee 2 - br_if 0 (;@2;) - block ;; label = @3 - local.get 4 - i32.const -4 - i32.and - local.tee 2 - local.get 1 - i32.const 3 - i32.shl - i32.const 512 - i32.add - local.tee 4 - local.get 2 - local.get 4 - i32.gt_u - select - i32.const 65543 - i32.add - local.tee 4 - i32.const 16 - i32.shr_u - memory.grow - local.tee 2 - i32.const -1 - i32.ne - br_if 0 (;@3;) - i32.const 0 - local.set 2 - br 1 (;@2;) - end - local.get 2 - i32.const 16 - i32.shl - local.tee 2 - i32.const 0 - i32.store offset=4 - local.get 2 - local.get 3 - i32.load offset=12 - i32.store offset=8 - local.get 2 - local.get 2 - local.get 4 - i32.const -65536 - i32.and - i32.add - i32.const 2 - i32.or - i32.store - local.get 3 - local.get 2 - i32.store offset=12 - local.get 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.set 2 - end - local.get 0 - local.get 3 - i32.load offset=12 - i32.store - end - local.get 3 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 2 - ) - (func $::dealloc (;9;) (type 4) (param i32 i32 i32 i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 1 - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.eqz - br_if 0 (;@1;) - local.get 0 - i32.load - local.set 4 - local.get 1 - i32.const 0 - i32.store - local.get 1 - i32.const -8 - i32.add - local.tee 3 - local.get 3 - i32.load - local.tee 5 - i32.const -2 - i32.and - local.tee 6 - i32.store - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - local.get 1 - i32.const -4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - br_if 0 (;@5;) - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 5 - i32.const -4 - i32.and - local.tee 10 - br_if 0 (;@8;) - local.get 8 - local.set 1 - br 1 (;@7;) - end - local.get 8 - local.set 1 - local.get 5 - i32.const 2 - i32.and - br_if 0 (;@7;) - local.get 10 - local.get 10 - i32.load offset=4 - i32.const 3 - i32.and - local.get 8 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 6 - local.get 7 - i32.load - local.tee 5 - i32.const -4 - i32.and - local.tee 1 - i32.eqz - br_if 1 (;@6;) - local.get 1 - i32.load - local.set 9 - end - local.get 1 - local.get 6 - i32.const -4 - i32.and - local.get 9 - i32.const 3 - i32.and - i32.or - i32.store - local.get 7 - i32.load - local.set 5 - local.get 3 - i32.load - local.set 6 - end - local.get 7 - local.get 5 - i32.const 3 - i32.and - i32.store - local.get 3 - local.get 6 - i32.const 3 - i32.and - i32.store - local.get 6 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - br 1 (;@4;) - end - local.get 5 - i32.const 2 - i32.and - br_if 1 (;@3;) - local.get 5 - i32.const -4 - i32.and - local.tee 5 - i32.eqz - br_if 1 (;@3;) - local.get 5 - i32.load8_u - i32.const 1 - i32.and - br_if 1 (;@3;) - local.get 1 - local.get 5 - i32.load offset=8 - i32.const -4 - i32.and - i32.store - local.get 5 - local.get 3 - i32.const 1 - i32.or - i32.store offset=8 - end - local.get 4 - local.set 3 - br 1 (;@2;) - end - local.get 1 - local.get 4 - i32.store - end - local.get 0 - local.get 3 - i32.store - end - ) - (func $cabi_realloc (;10;) (type 2) (param i32 i32 i32 i32) (result i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $wit_bindgen_rt::cabi_realloc - ) - (table (;0;) 3 3 funcref) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "miden:add-package/add-interface@1.0.0#add" (func $miden:add-package/add-interface@1.0.0#add)) - (export "cabi_realloc" (func $cabi_realloc)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $add_wasm_component::bindings::__link_custom_section_describing_imports $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\02\00\00\00") - ) - (core instance (;0;) (instantiate 0)) - (alias core export 0 "memory" (core memory (;0;))) - (alias core export 0 "cabi_realloc" (core func (;0;))) - (type (;0;) (func (param "a" u32) (param "b" u32) (result u32))) - (alias core export 0 "miden:add-package/add-interface@1.0.0#add" (core func (;1;))) - (func (;0;) (type 0) (canon lift (core func 1))) - (component (;0;) - (type (;0;) (func (param "a" u32) (param "b" u32) (result u32))) - (import "import-func-add" (func (;0;) (type 0))) - (type (;1;) (func (param "a" u32) (param "b" u32) (result u32))) - (export (;1;) "add" (func 0) (func (type 1))) - ) - (instance (;0;) (instantiate 0 - (with "import-func-add" (func 0)) - ) - ) - (export (;1;) "miden:add-package/add-interface@1.0.0" (instance 0)) -) \ No newline at end of file diff --git a/tests/integration/expected/components/adder_wasm_component.wat b/tests/integration/expected/components/adder_wasm_component.wat deleted file mode 100644 index f62be4cde..000000000 --- a/tests/integration/expected/components/adder_wasm_component.wat +++ /dev/null @@ -1,6103 +0,0 @@ -(component - (core module (;0;) - (type (;0;) (func)) - (type (;1;) (func (param i32 i32) (result i32))) - (type (;2;) (func (param i32 i32 i32 i32) (result i32))) - (type (;3;) (func (param i32) (result i32))) - (type (;4;) (func (param i32))) - (type (;5;) (func (param i32 i32))) - (type (;6;) (func (param i32 i32 i32) (result i32))) - (func $__wasm_call_ctors (;0;) (type 0)) - (func $add (;1;) (type 1) (param i32 i32) (result i32) - call $wit_bindgen::rt::run_ctors_once - local.get 1 - local.get 0 - i32.add - ) - (func $__rust_alloc (;2;) (type 1) (param i32 i32) (result i32) - (local i32) - local.get 0 - local.get 1 - call $__rdl_alloc - local.set 2 - local.get 2 - return - ) - (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) - (local i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rdl_realloc - local.set 4 - local.get 4 - return - ) - (func $wit_bindgen::rt::run_ctors_once (;4;) (type 0) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048577 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048577 - end - ) - (func $cabi_realloc (;5;) (type 2) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 1 - br_if 0 (;@3;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - i32.const 0 - i32.load8_u offset=1048576 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@2;) - end - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rust_realloc - local.set 2 - end - local.get 2 - br_if 0 (;@1;) - unreachable - unreachable - end - local.get 2 - ) - (func $__rdl_alloc (;6;) (type 1) (param i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - local.get 1 - i32.const 8 - i32.gt_u - br_if 0 (;@2;) - local.get 1 - local.get 0 - i32.le_u - br_if 1 (;@1;) - end - local.get 1 - local.get 0 - call $aligned_alloc - return - end - local.get 0 - call $malloc - ) - (func $__rdl_realloc (;7;) (type 2) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - local.get 2 - i32.const 8 - i32.gt_u - br_if 0 (;@2;) - local.get 2 - local.get 3 - i32.le_u - br_if 1 (;@1;) - end - block ;; label = @2 - local.get 2 - local.get 3 - call $aligned_alloc - local.tee 2 - br_if 0 (;@2;) - i32.const 0 - return - end - local.get 2 - local.get 0 - local.get 1 - local.get 3 - local.get 1 - local.get 3 - i32.lt_u - select - call $memcpy - local.set 3 - local.get 0 - call $free - local.get 3 - return - end - local.get 0 - local.get 3 - call $realloc - ) - (func $malloc (;8;) (type 3) (param i32) (result i32) - local.get 0 - call $dlmalloc - ) - (func $dlmalloc (;9;) (type 3) (param i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 1 - global.set $__stack_pointer - block ;; label = @1 - i32.const 0 - i32.load offset=1048604 - local.tee 2 - br_if 0 (;@1;) - block ;; label = @2 - block ;; label = @3 - i32.const 0 - i32.load offset=1049052 - local.tee 3 - i32.eqz - br_if 0 (;@3;) - i32.const 0 - i32.load offset=1049056 - local.set 4 - br 1 (;@2;) - end - i32.const 0 - i64.const -1 - i64.store offset=1049064 align=4 - i32.const 0 - i64.const 281474976776192 - i64.store offset=1049056 align=4 - i32.const 0 - local.get 1 - i32.const 8 - i32.add - i32.const -16 - i32.and - i32.const 1431655768 - i32.xor - local.tee 3 - i32.store offset=1049052 - i32.const 0 - i32.const 0 - i32.store offset=1049072 - i32.const 0 - i32.const 0 - i32.store offset=1049024 - i32.const 65536 - local.set 4 - end - i32.const 0 - local.set 2 - i32.const 1114112 - i32.const 1049088 - local.get 4 - i32.add - i32.const -1 - i32.add - i32.const 0 - local.get 4 - i32.sub - i32.and - i32.const 1114112 - select - i32.const 1049088 - i32.sub - local.tee 5 - i32.const 89 - i32.lt_u - br_if 0 (;@1;) - i32.const 0 - local.set 4 - i32.const 0 - local.get 5 - i32.store offset=1049032 - i32.const 0 - i32.const 1049088 - i32.store offset=1049028 - i32.const 0 - i32.const 1049088 - i32.store offset=1048596 - i32.const 0 - local.get 3 - i32.store offset=1048616 - i32.const 0 - i32.const -1 - i32.store offset=1048612 - loop ;; label = @2 - local.get 4 - i32.const 1048640 - i32.add - local.get 4 - i32.const 1048628 - i32.add - local.tee 3 - i32.store - local.get 3 - local.get 4 - i32.const 1048620 - i32.add - local.tee 6 - i32.store - local.get 4 - i32.const 1048632 - i32.add - local.get 6 - i32.store - local.get 4 - i32.const 1048648 - i32.add - local.get 4 - i32.const 1048636 - i32.add - local.tee 6 - i32.store - local.get 6 - local.get 3 - i32.store - local.get 4 - i32.const 1048656 - i32.add - local.get 4 - i32.const 1048644 - i32.add - local.tee 3 - i32.store - local.get 3 - local.get 6 - i32.store - local.get 4 - i32.const 1048652 - i32.add - local.get 3 - i32.store - local.get 4 - i32.const 32 - i32.add - local.tee 4 - i32.const 256 - i32.ne - br_if 0 (;@2;) - end - i32.const 1049088 - i32.const -8 - i32.const 1049088 - i32.sub - i32.const 15 - i32.and - i32.const 0 - i32.const 1049088 - i32.const 8 - i32.add - i32.const 15 - i32.and - select - local.tee 4 - i32.add - local.tee 2 - i32.const 4 - i32.add - local.get 5 - i32.const -56 - i32.add - local.tee 3 - local.get 4 - i32.sub - local.tee 4 - i32.const 1 - i32.or - i32.store - i32.const 0 - i32.const 0 - i32.load offset=1049068 - i32.store offset=1048608 - i32.const 0 - local.get 4 - i32.store offset=1048592 - i32.const 0 - local.get 2 - i32.store offset=1048604 - i32.const 1049088 - local.get 3 - i32.add - i32.const 56 - i32.store offset=4 - end - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - block ;; label = @9 - block ;; label = @10 - block ;; label = @11 - block ;; label = @12 - local.get 0 - i32.const 236 - i32.gt_u - br_if 0 (;@12;) - block ;; label = @13 - i32.const 0 - i32.load offset=1048580 - local.tee 7 - i32.const 16 - local.get 0 - i32.const 19 - i32.add - i32.const -16 - i32.and - local.get 0 - i32.const 11 - i32.lt_u - select - local.tee 5 - i32.const 3 - i32.shr_u - local.tee 3 - i32.shr_u - local.tee 4 - i32.const 3 - i32.and - i32.eqz - br_if 0 (;@13;) - block ;; label = @14 - block ;; label = @15 - local.get 4 - i32.const 1 - i32.and - local.get 3 - i32.or - i32.const 1 - i32.xor - local.tee 6 - i32.const 3 - i32.shl - local.tee 3 - i32.const 1048620 - i32.add - local.tee 4 - local.get 3 - i32.const 1048628 - i32.add - i32.load - local.tee 3 - i32.load offset=8 - local.tee 5 - i32.ne - br_if 0 (;@15;) - i32.const 0 - local.get 7 - i32.const -2 - local.get 6 - i32.rotl - i32.and - i32.store offset=1048580 - br 1 (;@14;) - end - local.get 4 - local.get 5 - i32.store offset=8 - local.get 5 - local.get 4 - i32.store offset=12 - end - local.get 3 - i32.const 8 - i32.add - local.set 4 - local.get 3 - local.get 6 - i32.const 3 - i32.shl - local.tee 6 - i32.const 3 - i32.or - i32.store offset=4 - local.get 3 - local.get 6 - i32.add - local.tee 3 - local.get 3 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - br 12 (;@1;) - end - local.get 5 - i32.const 0 - i32.load offset=1048588 - local.tee 8 - i32.le_u - br_if 1 (;@11;) - block ;; label = @13 - local.get 4 - i32.eqz - br_if 0 (;@13;) - block ;; label = @14 - block ;; label = @15 - local.get 4 - local.get 3 - i32.shl - i32.const 2 - local.get 3 - i32.shl - local.tee 4 - i32.const 0 - local.get 4 - i32.sub - i32.or - i32.and - local.tee 4 - i32.const 0 - local.get 4 - i32.sub - i32.and - i32.ctz - local.tee 3 - i32.const 3 - i32.shl - local.tee 4 - i32.const 1048620 - i32.add - local.tee 6 - local.get 4 - i32.const 1048628 - i32.add - i32.load - local.tee 4 - i32.load offset=8 - local.tee 0 - i32.ne - br_if 0 (;@15;) - i32.const 0 - local.get 7 - i32.const -2 - local.get 3 - i32.rotl - i32.and - local.tee 7 - i32.store offset=1048580 - br 1 (;@14;) - end - local.get 6 - local.get 0 - i32.store offset=8 - local.get 0 - local.get 6 - i32.store offset=12 - end - local.get 4 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - local.get 4 - local.get 3 - i32.const 3 - i32.shl - local.tee 3 - i32.add - local.get 3 - local.get 5 - i32.sub - local.tee 6 - i32.store - local.get 4 - local.get 5 - i32.add - local.tee 0 - local.get 6 - i32.const 1 - i32.or - i32.store offset=4 - block ;; label = @14 - local.get 8 - i32.eqz - br_if 0 (;@14;) - local.get 8 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 5 - i32.const 0 - i32.load offset=1048600 - local.set 3 - block ;; label = @15 - block ;; label = @16 - local.get 7 - i32.const 1 - local.get 8 - i32.const 3 - i32.shr_u - i32.shl - local.tee 9 - i32.and - br_if 0 (;@16;) - i32.const 0 - local.get 7 - local.get 9 - i32.or - i32.store offset=1048580 - local.get 5 - local.set 9 - br 1 (;@15;) - end - local.get 5 - i32.load offset=8 - local.set 9 - end - local.get 9 - local.get 3 - i32.store offset=12 - local.get 5 - local.get 3 - i32.store offset=8 - local.get 3 - local.get 5 - i32.store offset=12 - local.get 3 - local.get 9 - i32.store offset=8 - end - local.get 4 - i32.const 8 - i32.add - local.set 4 - i32.const 0 - local.get 0 - i32.store offset=1048600 - i32.const 0 - local.get 6 - i32.store offset=1048588 - br 12 (;@1;) - end - i32.const 0 - i32.load offset=1048584 - local.tee 10 - i32.eqz - br_if 1 (;@11;) - local.get 10 - i32.const 0 - local.get 10 - i32.sub - i32.and - i32.ctz - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - i32.load - local.tee 0 - i32.load offset=4 - i32.const -8 - i32.and - local.get 5 - i32.sub - local.set 3 - local.get 0 - local.set 6 - block ;; label = @13 - loop ;; label = @14 - block ;; label = @15 - local.get 6 - i32.load offset=16 - local.tee 4 - br_if 0 (;@15;) - local.get 6 - i32.const 20 - i32.add - i32.load - local.tee 4 - i32.eqz - br_if 2 (;@13;) - end - local.get 4 - i32.load offset=4 - i32.const -8 - i32.and - local.get 5 - i32.sub - local.tee 6 - local.get 3 - local.get 6 - local.get 3 - i32.lt_u - local.tee 6 - select - local.set 3 - local.get 4 - local.get 0 - local.get 6 - select - local.set 0 - local.get 4 - local.set 6 - br 0 (;@14;) - end - end - local.get 0 - i32.load offset=24 - local.set 11 - block ;; label = @13 - local.get 0 - i32.load offset=12 - local.tee 9 - local.get 0 - i32.eq - br_if 0 (;@13;) - local.get 0 - i32.load offset=8 - local.tee 4 - i32.const 0 - i32.load offset=1048596 - i32.lt_u - drop - local.get 9 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 9 - i32.store offset=12 - br 11 (;@2;) - end - block ;; label = @13 - local.get 0 - i32.const 20 - i32.add - local.tee 6 - i32.load - local.tee 4 - br_if 0 (;@13;) - local.get 0 - i32.load offset=16 - local.tee 4 - i32.eqz - br_if 3 (;@10;) - local.get 0 - i32.const 16 - i32.add - local.set 6 - end - loop ;; label = @13 - local.get 6 - local.set 2 - local.get 4 - local.tee 9 - i32.const 20 - i32.add - local.tee 6 - i32.load - local.tee 4 - br_if 0 (;@13;) - local.get 9 - i32.const 16 - i32.add - local.set 6 - local.get 9 - i32.load offset=16 - local.tee 4 - br_if 0 (;@13;) - end - local.get 2 - i32.const 0 - i32.store - br 10 (;@2;) - end - i32.const -1 - local.set 5 - local.get 0 - i32.const -65 - i32.gt_u - br_if 0 (;@11;) - local.get 0 - i32.const 19 - i32.add - local.tee 4 - i32.const -16 - i32.and - local.set 5 - i32.const 0 - i32.load offset=1048584 - local.tee 10 - i32.eqz - br_if 0 (;@11;) - i32.const 0 - local.set 8 - block ;; label = @12 - local.get 5 - i32.const 256 - i32.lt_u - br_if 0 (;@12;) - i32.const 31 - local.set 8 - local.get 5 - i32.const 16777215 - i32.gt_u - br_if 0 (;@12;) - local.get 5 - i32.const 38 - local.get 4 - i32.const 8 - i32.shr_u - i32.clz - local.tee 4 - i32.sub - i32.shr_u - i32.const 1 - i32.and - local.get 4 - i32.const 1 - i32.shl - i32.sub - i32.const 62 - i32.add - local.set 8 - end - i32.const 0 - local.get 5 - i32.sub - local.set 3 - block ;; label = @12 - block ;; label = @13 - block ;; label = @14 - block ;; label = @15 - local.get 8 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - i32.load - local.tee 6 - br_if 0 (;@15;) - i32.const 0 - local.set 4 - i32.const 0 - local.set 9 - br 1 (;@14;) - end - i32.const 0 - local.set 4 - local.get 5 - i32.const 0 - i32.const 25 - local.get 8 - i32.const 1 - i32.shr_u - i32.sub - local.get 8 - i32.const 31 - i32.eq - select - i32.shl - local.set 0 - i32.const 0 - local.set 9 - loop ;; label = @15 - block ;; label = @16 - local.get 6 - i32.load offset=4 - i32.const -8 - i32.and - local.get 5 - i32.sub - local.tee 7 - local.get 3 - i32.ge_u - br_if 0 (;@16;) - local.get 7 - local.set 3 - local.get 6 - local.set 9 - local.get 7 - br_if 0 (;@16;) - i32.const 0 - local.set 3 - local.get 6 - local.set 9 - local.get 6 - local.set 4 - br 3 (;@13;) - end - local.get 4 - local.get 6 - i32.const 20 - i32.add - i32.load - local.tee 7 - local.get 7 - local.get 6 - local.get 0 - i32.const 29 - i32.shr_u - i32.const 4 - i32.and - i32.add - i32.const 16 - i32.add - i32.load - local.tee 6 - i32.eq - select - local.get 4 - local.get 7 - select - local.set 4 - local.get 0 - i32.const 1 - i32.shl - local.set 0 - local.get 6 - br_if 0 (;@15;) - end - end - block ;; label = @14 - local.get 4 - local.get 9 - i32.or - br_if 0 (;@14;) - i32.const 0 - local.set 9 - i32.const 2 - local.get 8 - i32.shl - local.tee 4 - i32.const 0 - local.get 4 - i32.sub - i32.or - local.get 10 - i32.and - local.tee 4 - i32.eqz - br_if 3 (;@11;) - local.get 4 - i32.const 0 - local.get 4 - i32.sub - i32.and - i32.ctz - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - i32.load - local.set 4 - end - local.get 4 - i32.eqz - br_if 1 (;@12;) - end - loop ;; label = @13 - local.get 4 - i32.load offset=4 - i32.const -8 - i32.and - local.get 5 - i32.sub - local.tee 7 - local.get 3 - i32.lt_u - local.set 0 - block ;; label = @14 - local.get 4 - i32.load offset=16 - local.tee 6 - br_if 0 (;@14;) - local.get 4 - i32.const 20 - i32.add - i32.load - local.set 6 - end - local.get 7 - local.get 3 - local.get 0 - select - local.set 3 - local.get 4 - local.get 9 - local.get 0 - select - local.set 9 - local.get 6 - local.set 4 - local.get 6 - br_if 0 (;@13;) - end - end - local.get 9 - i32.eqz - br_if 0 (;@11;) - local.get 3 - i32.const 0 - i32.load offset=1048588 - local.get 5 - i32.sub - i32.ge_u - br_if 0 (;@11;) - local.get 9 - i32.load offset=24 - local.set 2 - block ;; label = @12 - local.get 9 - i32.load offset=12 - local.tee 0 - local.get 9 - i32.eq - br_if 0 (;@12;) - local.get 9 - i32.load offset=8 - local.tee 4 - i32.const 0 - i32.load offset=1048596 - i32.lt_u - drop - local.get 0 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 0 - i32.store offset=12 - br 9 (;@3;) - end - block ;; label = @12 - local.get 9 - i32.const 20 - i32.add - local.tee 6 - i32.load - local.tee 4 - br_if 0 (;@12;) - local.get 9 - i32.load offset=16 - local.tee 4 - i32.eqz - br_if 3 (;@9;) - local.get 9 - i32.const 16 - i32.add - local.set 6 - end - loop ;; label = @12 - local.get 6 - local.set 7 - local.get 4 - local.tee 0 - i32.const 20 - i32.add - local.tee 6 - i32.load - local.tee 4 - br_if 0 (;@12;) - local.get 0 - i32.const 16 - i32.add - local.set 6 - local.get 0 - i32.load offset=16 - local.tee 4 - br_if 0 (;@12;) - end - local.get 7 - i32.const 0 - i32.store - br 8 (;@3;) - end - block ;; label = @11 - i32.const 0 - i32.load offset=1048588 - local.tee 4 - local.get 5 - i32.lt_u - br_if 0 (;@11;) - i32.const 0 - i32.load offset=1048600 - local.set 3 - block ;; label = @12 - block ;; label = @13 - local.get 4 - local.get 5 - i32.sub - local.tee 6 - i32.const 16 - i32.lt_u - br_if 0 (;@13;) - local.get 3 - local.get 5 - i32.add - local.tee 0 - local.get 6 - i32.const 1 - i32.or - i32.store offset=4 - local.get 3 - local.get 4 - i32.add - local.get 6 - i32.store - local.get 3 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - br 1 (;@12;) - end - local.get 3 - local.get 4 - i32.const 3 - i32.or - i32.store offset=4 - local.get 3 - local.get 4 - i32.add - local.tee 4 - local.get 4 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - i32.const 0 - local.set 0 - i32.const 0 - local.set 6 - end - i32.const 0 - local.get 6 - i32.store offset=1048588 - i32.const 0 - local.get 0 - i32.store offset=1048600 - local.get 3 - i32.const 8 - i32.add - local.set 4 - br 10 (;@1;) - end - block ;; label = @11 - i32.const 0 - i32.load offset=1048592 - local.tee 6 - local.get 5 - i32.le_u - br_if 0 (;@11;) - local.get 2 - local.get 5 - i32.add - local.tee 4 - local.get 6 - local.get 5 - i32.sub - local.tee 3 - i32.const 1 - i32.or - i32.store offset=4 - i32.const 0 - local.get 4 - i32.store offset=1048604 - i32.const 0 - local.get 3 - i32.store offset=1048592 - local.get 2 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - local.get 2 - i32.const 8 - i32.add - local.set 4 - br 10 (;@1;) - end - block ;; label = @11 - block ;; label = @12 - i32.const 0 - i32.load offset=1049052 - i32.eqz - br_if 0 (;@12;) - i32.const 0 - i32.load offset=1049060 - local.set 3 - br 1 (;@11;) - end - i32.const 0 - i64.const -1 - i64.store offset=1049064 align=4 - i32.const 0 - i64.const 281474976776192 - i64.store offset=1049056 align=4 - i32.const 0 - local.get 1 - i32.const 12 - i32.add - i32.const -16 - i32.and - i32.const 1431655768 - i32.xor - i32.store offset=1049052 - i32.const 0 - i32.const 0 - i32.store offset=1049072 - i32.const 0 - i32.const 0 - i32.store offset=1049024 - i32.const 65536 - local.set 3 - end - i32.const 0 - local.set 4 - block ;; label = @11 - local.get 3 - local.get 5 - i32.const 71 - i32.add - local.tee 8 - i32.add - local.tee 0 - i32.const 0 - local.get 3 - i32.sub - local.tee 7 - i32.and - local.tee 9 - local.get 5 - i32.gt_u - br_if 0 (;@11;) - i32.const 0 - i32.const 48 - i32.store offset=1049076 - br 10 (;@1;) - end - block ;; label = @11 - i32.const 0 - i32.load offset=1049020 - local.tee 4 - i32.eqz - br_if 0 (;@11;) - block ;; label = @12 - i32.const 0 - i32.load offset=1049012 - local.tee 3 - local.get 9 - i32.add - local.tee 10 - local.get 3 - i32.le_u - br_if 0 (;@12;) - local.get 10 - local.get 4 - i32.le_u - br_if 1 (;@11;) - end - i32.const 0 - local.set 4 - i32.const 0 - i32.const 48 - i32.store offset=1049076 - br 10 (;@1;) - end - i32.const 0 - i32.load8_u offset=1049024 - i32.const 4 - i32.and - br_if 4 (;@6;) - block ;; label = @11 - block ;; label = @12 - block ;; label = @13 - local.get 2 - i32.eqz - br_if 0 (;@13;) - i32.const 1049028 - local.set 4 - loop ;; label = @14 - block ;; label = @15 - local.get 4 - i32.load - local.tee 3 - local.get 2 - i32.gt_u - br_if 0 (;@15;) - local.get 3 - local.get 4 - i32.load offset=4 - i32.add - local.get 2 - i32.gt_u - br_if 3 (;@12;) - end - local.get 4 - i32.load offset=8 - local.tee 4 - br_if 0 (;@14;) - end - end - i32.const 0 - call $sbrk - local.tee 0 - i32.const -1 - i32.eq - br_if 5 (;@7;) - local.get 9 - local.set 7 - block ;; label = @13 - i32.const 0 - i32.load offset=1049056 - local.tee 4 - i32.const -1 - i32.add - local.tee 3 - local.get 0 - i32.and - i32.eqz - br_if 0 (;@13;) - local.get 9 - local.get 0 - i32.sub - local.get 3 - local.get 0 - i32.add - i32.const 0 - local.get 4 - i32.sub - i32.and - i32.add - local.set 7 - end - local.get 7 - local.get 5 - i32.le_u - br_if 5 (;@7;) - local.get 7 - i32.const 2147483646 - i32.gt_u - br_if 5 (;@7;) - block ;; label = @13 - i32.const 0 - i32.load offset=1049020 - local.tee 4 - i32.eqz - br_if 0 (;@13;) - i32.const 0 - i32.load offset=1049012 - local.tee 3 - local.get 7 - i32.add - local.tee 6 - local.get 3 - i32.le_u - br_if 6 (;@7;) - local.get 6 - local.get 4 - i32.gt_u - br_if 6 (;@7;) - end - local.get 7 - call $sbrk - local.tee 4 - local.get 0 - i32.ne - br_if 1 (;@11;) - br 7 (;@5;) - end - local.get 0 - local.get 6 - i32.sub - local.get 7 - i32.and - local.tee 7 - i32.const 2147483646 - i32.gt_u - br_if 4 (;@7;) - local.get 7 - call $sbrk - local.tee 0 - local.get 4 - i32.load - local.get 4 - i32.load offset=4 - i32.add - i32.eq - br_if 3 (;@8;) - local.get 0 - local.set 4 - end - block ;; label = @11 - local.get 4 - i32.const -1 - i32.eq - br_if 0 (;@11;) - local.get 5 - i32.const 72 - i32.add - local.get 7 - i32.le_u - br_if 0 (;@11;) - block ;; label = @12 - local.get 8 - local.get 7 - i32.sub - i32.const 0 - i32.load offset=1049060 - local.tee 3 - i32.add - i32.const 0 - local.get 3 - i32.sub - i32.and - local.tee 3 - i32.const 2147483646 - i32.le_u - br_if 0 (;@12;) - local.get 4 - local.set 0 - br 7 (;@5;) - end - block ;; label = @12 - local.get 3 - call $sbrk - i32.const -1 - i32.eq - br_if 0 (;@12;) - local.get 3 - local.get 7 - i32.add - local.set 7 - local.get 4 - local.set 0 - br 7 (;@5;) - end - i32.const 0 - local.get 7 - i32.sub - call $sbrk - drop - br 4 (;@7;) - end - local.get 4 - local.set 0 - local.get 4 - i32.const -1 - i32.ne - br_if 5 (;@5;) - br 3 (;@7;) - end - i32.const 0 - local.set 9 - br 7 (;@2;) - end - i32.const 0 - local.set 0 - br 5 (;@3;) - end - local.get 0 - i32.const -1 - i32.ne - br_if 2 (;@5;) - end - i32.const 0 - i32.const 0 - i32.load offset=1049024 - i32.const 4 - i32.or - i32.store offset=1049024 - end - local.get 9 - i32.const 2147483646 - i32.gt_u - br_if 1 (;@4;) - local.get 9 - call $sbrk - local.set 0 - i32.const 0 - call $sbrk - local.set 4 - local.get 0 - i32.const -1 - i32.eq - br_if 1 (;@4;) - local.get 4 - i32.const -1 - i32.eq - br_if 1 (;@4;) - local.get 0 - local.get 4 - i32.ge_u - br_if 1 (;@4;) - local.get 4 - local.get 0 - i32.sub - local.tee 7 - local.get 5 - i32.const 56 - i32.add - i32.le_u - br_if 1 (;@4;) - end - i32.const 0 - i32.const 0 - i32.load offset=1049012 - local.get 7 - i32.add - local.tee 4 - i32.store offset=1049012 - block ;; label = @5 - local.get 4 - i32.const 0 - i32.load offset=1049016 - i32.le_u - br_if 0 (;@5;) - i32.const 0 - local.get 4 - i32.store offset=1049016 - end - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - i32.const 0 - i32.load offset=1048604 - local.tee 3 - i32.eqz - br_if 0 (;@8;) - i32.const 1049028 - local.set 4 - loop ;; label = @9 - local.get 0 - local.get 4 - i32.load - local.tee 6 - local.get 4 - i32.load offset=4 - local.tee 9 - i32.add - i32.eq - br_if 2 (;@7;) - local.get 4 - i32.load offset=8 - local.tee 4 - br_if 0 (;@9;) - br 3 (;@6;) - end - end - block ;; label = @8 - block ;; label = @9 - i32.const 0 - i32.load offset=1048596 - local.tee 4 - i32.eqz - br_if 0 (;@9;) - local.get 0 - local.get 4 - i32.ge_u - br_if 1 (;@8;) - end - i32.const 0 - local.get 0 - i32.store offset=1048596 - end - i32.const 0 - local.set 4 - i32.const 0 - local.get 7 - i32.store offset=1049032 - i32.const 0 - local.get 0 - i32.store offset=1049028 - i32.const 0 - i32.const -1 - i32.store offset=1048612 - i32.const 0 - i32.const 0 - i32.load offset=1049052 - i32.store offset=1048616 - i32.const 0 - i32.const 0 - i32.store offset=1049040 - loop ;; label = @8 - local.get 4 - i32.const 1048640 - i32.add - local.get 4 - i32.const 1048628 - i32.add - local.tee 3 - i32.store - local.get 3 - local.get 4 - i32.const 1048620 - i32.add - local.tee 6 - i32.store - local.get 4 - i32.const 1048632 - i32.add - local.get 6 - i32.store - local.get 4 - i32.const 1048648 - i32.add - local.get 4 - i32.const 1048636 - i32.add - local.tee 6 - i32.store - local.get 6 - local.get 3 - i32.store - local.get 4 - i32.const 1048656 - i32.add - local.get 4 - i32.const 1048644 - i32.add - local.tee 3 - i32.store - local.get 3 - local.get 6 - i32.store - local.get 4 - i32.const 1048652 - i32.add - local.get 3 - i32.store - local.get 4 - i32.const 32 - i32.add - local.tee 4 - i32.const 256 - i32.ne - br_if 0 (;@8;) - end - local.get 0 - i32.const -8 - local.get 0 - i32.sub - i32.const 15 - i32.and - i32.const 0 - local.get 0 - i32.const 8 - i32.add - i32.const 15 - i32.and - select - local.tee 4 - i32.add - local.tee 3 - local.get 7 - i32.const -56 - i32.add - local.tee 6 - local.get 4 - i32.sub - local.tee 4 - i32.const 1 - i32.or - i32.store offset=4 - i32.const 0 - i32.const 0 - i32.load offset=1049068 - i32.store offset=1048608 - i32.const 0 - local.get 4 - i32.store offset=1048592 - i32.const 0 - local.get 3 - i32.store offset=1048604 - local.get 0 - local.get 6 - i32.add - i32.const 56 - i32.store offset=4 - br 2 (;@5;) - end - local.get 4 - i32.load8_u offset=12 - i32.const 8 - i32.and - br_if 0 (;@6;) - local.get 3 - local.get 6 - i32.lt_u - br_if 0 (;@6;) - local.get 3 - local.get 0 - i32.ge_u - br_if 0 (;@6;) - local.get 3 - i32.const -8 - local.get 3 - i32.sub - i32.const 15 - i32.and - i32.const 0 - local.get 3 - i32.const 8 - i32.add - i32.const 15 - i32.and - select - local.tee 6 - i32.add - local.tee 0 - i32.const 0 - i32.load offset=1048592 - local.get 7 - i32.add - local.tee 2 - local.get 6 - i32.sub - local.tee 6 - i32.const 1 - i32.or - i32.store offset=4 - local.get 4 - local.get 9 - local.get 7 - i32.add - i32.store offset=4 - i32.const 0 - i32.const 0 - i32.load offset=1049068 - i32.store offset=1048608 - i32.const 0 - local.get 6 - i32.store offset=1048592 - i32.const 0 - local.get 0 - i32.store offset=1048604 - local.get 3 - local.get 2 - i32.add - i32.const 56 - i32.store offset=4 - br 1 (;@5;) - end - block ;; label = @6 - local.get 0 - i32.const 0 - i32.load offset=1048596 - local.tee 9 - i32.ge_u - br_if 0 (;@6;) - i32.const 0 - local.get 0 - i32.store offset=1048596 - local.get 0 - local.set 9 - end - local.get 0 - local.get 7 - i32.add - local.set 6 - i32.const 1049028 - local.set 4 - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - block ;; label = @9 - block ;; label = @10 - block ;; label = @11 - block ;; label = @12 - loop ;; label = @13 - local.get 4 - i32.load - local.get 6 - i32.eq - br_if 1 (;@12;) - local.get 4 - i32.load offset=8 - local.tee 4 - br_if 0 (;@13;) - br 2 (;@11;) - end - end - local.get 4 - i32.load8_u offset=12 - i32.const 8 - i32.and - i32.eqz - br_if 1 (;@10;) - end - i32.const 1049028 - local.set 4 - loop ;; label = @11 - block ;; label = @12 - local.get 4 - i32.load - local.tee 6 - local.get 3 - i32.gt_u - br_if 0 (;@12;) - local.get 6 - local.get 4 - i32.load offset=4 - i32.add - local.tee 6 - local.get 3 - i32.gt_u - br_if 3 (;@9;) - end - local.get 4 - i32.load offset=8 - local.set 4 - br 0 (;@11;) - end - end - local.get 4 - local.get 0 - i32.store - local.get 4 - local.get 4 - i32.load offset=4 - local.get 7 - i32.add - i32.store offset=4 - local.get 0 - i32.const -8 - local.get 0 - i32.sub - i32.const 15 - i32.and - i32.const 0 - local.get 0 - i32.const 8 - i32.add - i32.const 15 - i32.and - select - i32.add - local.tee 2 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - local.get 6 - i32.const -8 - local.get 6 - i32.sub - i32.const 15 - i32.and - i32.const 0 - local.get 6 - i32.const 8 - i32.add - i32.const 15 - i32.and - select - i32.add - local.tee 7 - local.get 2 - local.get 5 - i32.add - local.tee 5 - i32.sub - local.set 4 - block ;; label = @10 - local.get 7 - local.get 3 - i32.ne - br_if 0 (;@10;) - i32.const 0 - local.get 5 - i32.store offset=1048604 - i32.const 0 - i32.const 0 - i32.load offset=1048592 - local.get 4 - i32.add - local.tee 4 - i32.store offset=1048592 - local.get 5 - local.get 4 - i32.const 1 - i32.or - i32.store offset=4 - br 3 (;@7;) - end - block ;; label = @10 - local.get 7 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 0 (;@10;) - i32.const 0 - local.get 5 - i32.store offset=1048600 - i32.const 0 - i32.const 0 - i32.load offset=1048588 - local.get 4 - i32.add - local.tee 4 - i32.store offset=1048588 - local.get 5 - local.get 4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 5 - local.get 4 - i32.add - local.get 4 - i32.store - br 3 (;@7;) - end - block ;; label = @10 - local.get 7 - i32.load offset=4 - local.tee 3 - i32.const 3 - i32.and - i32.const 1 - i32.ne - br_if 0 (;@10;) - local.get 3 - i32.const -8 - i32.and - local.set 8 - block ;; label = @11 - block ;; label = @12 - local.get 3 - i32.const 255 - i32.gt_u - br_if 0 (;@12;) - local.get 7 - i32.load offset=8 - local.tee 6 - local.get 3 - i32.const 3 - i32.shr_u - local.tee 9 - i32.const 3 - i32.shl - i32.const 1048620 - i32.add - local.tee 0 - i32.eq - drop - block ;; label = @13 - local.get 7 - i32.load offset=12 - local.tee 3 - local.get 6 - i32.ne - br_if 0 (;@13;) - i32.const 0 - i32.const 0 - i32.load offset=1048580 - i32.const -2 - local.get 9 - i32.rotl - i32.and - i32.store offset=1048580 - br 2 (;@11;) - end - local.get 3 - local.get 0 - i32.eq - drop - local.get 3 - local.get 6 - i32.store offset=8 - local.get 6 - local.get 3 - i32.store offset=12 - br 1 (;@11;) - end - local.get 7 - i32.load offset=24 - local.set 10 - block ;; label = @12 - block ;; label = @13 - local.get 7 - i32.load offset=12 - local.tee 0 - local.get 7 - i32.eq - br_if 0 (;@13;) - local.get 7 - i32.load offset=8 - local.tee 3 - local.get 9 - i32.lt_u - drop - local.get 0 - local.get 3 - i32.store offset=8 - local.get 3 - local.get 0 - i32.store offset=12 - br 1 (;@12;) - end - block ;; label = @13 - local.get 7 - i32.const 20 - i32.add - local.tee 3 - i32.load - local.tee 6 - br_if 0 (;@13;) - local.get 7 - i32.const 16 - i32.add - local.tee 3 - i32.load - local.tee 6 - br_if 0 (;@13;) - i32.const 0 - local.set 0 - br 1 (;@12;) - end - loop ;; label = @13 - local.get 3 - local.set 9 - local.get 6 - local.tee 0 - i32.const 20 - i32.add - local.tee 3 - i32.load - local.tee 6 - br_if 0 (;@13;) - local.get 0 - i32.const 16 - i32.add - local.set 3 - local.get 0 - i32.load offset=16 - local.tee 6 - br_if 0 (;@13;) - end - local.get 9 - i32.const 0 - i32.store - end - local.get 10 - i32.eqz - br_if 0 (;@11;) - block ;; label = @12 - block ;; label = @13 - local.get 7 - local.get 7 - i32.load offset=28 - local.tee 6 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 3 - i32.load - i32.ne - br_if 0 (;@13;) - local.get 3 - local.get 0 - i32.store - local.get 0 - br_if 1 (;@12;) - i32.const 0 - i32.const 0 - i32.load offset=1048584 - i32.const -2 - local.get 6 - i32.rotl - i32.and - i32.store offset=1048584 - br 2 (;@11;) - end - local.get 10 - i32.const 16 - i32.const 20 - local.get 10 - i32.load offset=16 - local.get 7 - i32.eq - select - i32.add - local.get 0 - i32.store - local.get 0 - i32.eqz - br_if 1 (;@11;) - end - local.get 0 - local.get 10 - i32.store offset=24 - block ;; label = @12 - local.get 7 - i32.load offset=16 - local.tee 3 - i32.eqz - br_if 0 (;@12;) - local.get 0 - local.get 3 - i32.store offset=16 - local.get 3 - local.get 0 - i32.store offset=24 - end - local.get 7 - i32.load offset=20 - local.tee 3 - i32.eqz - br_if 0 (;@11;) - local.get 0 - i32.const 20 - i32.add - local.get 3 - i32.store - local.get 3 - local.get 0 - i32.store offset=24 - end - local.get 8 - local.get 4 - i32.add - local.set 4 - local.get 7 - local.get 8 - i32.add - local.tee 7 - i32.load offset=4 - local.set 3 - end - local.get 7 - local.get 3 - i32.const -2 - i32.and - i32.store offset=4 - local.get 5 - local.get 4 - i32.add - local.get 4 - i32.store - local.get 5 - local.get 4 - i32.const 1 - i32.or - i32.store offset=4 - block ;; label = @10 - local.get 4 - i32.const 255 - i32.gt_u - br_if 0 (;@10;) - local.get 4 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 3 - block ;; label = @11 - block ;; label = @12 - i32.const 0 - i32.load offset=1048580 - local.tee 6 - i32.const 1 - local.get 4 - i32.const 3 - i32.shr_u - i32.shl - local.tee 4 - i32.and - br_if 0 (;@12;) - i32.const 0 - local.get 6 - local.get 4 - i32.or - i32.store offset=1048580 - local.get 3 - local.set 4 - br 1 (;@11;) - end - local.get 3 - i32.load offset=8 - local.set 4 - end - local.get 4 - local.get 5 - i32.store offset=12 - local.get 3 - local.get 5 - i32.store offset=8 - local.get 5 - local.get 3 - i32.store offset=12 - local.get 5 - local.get 4 - i32.store offset=8 - br 3 (;@7;) - end - i32.const 31 - local.set 3 - block ;; label = @10 - local.get 4 - i32.const 16777215 - i32.gt_u - br_if 0 (;@10;) - local.get 4 - i32.const 38 - local.get 4 - i32.const 8 - i32.shr_u - i32.clz - local.tee 3 - i32.sub - i32.shr_u - i32.const 1 - i32.and - local.get 3 - i32.const 1 - i32.shl - i32.sub - i32.const 62 - i32.add - local.set 3 - end - local.get 5 - local.get 3 - i32.store offset=28 - local.get 5 - i64.const 0 - i64.store offset=16 align=4 - local.get 3 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.set 6 - block ;; label = @10 - i32.const 0 - i32.load offset=1048584 - local.tee 0 - i32.const 1 - local.get 3 - i32.shl - local.tee 9 - i32.and - br_if 0 (;@10;) - local.get 6 - local.get 5 - i32.store - i32.const 0 - local.get 0 - local.get 9 - i32.or - i32.store offset=1048584 - local.get 5 - local.get 6 - i32.store offset=24 - local.get 5 - local.get 5 - i32.store offset=8 - local.get 5 - local.get 5 - i32.store offset=12 - br 3 (;@7;) - end - local.get 4 - i32.const 0 - i32.const 25 - local.get 3 - i32.const 1 - i32.shr_u - i32.sub - local.get 3 - i32.const 31 - i32.eq - select - i32.shl - local.set 3 - local.get 6 - i32.load - local.set 0 - loop ;; label = @10 - local.get 0 - local.tee 6 - i32.load offset=4 - i32.const -8 - i32.and - local.get 4 - i32.eq - br_if 2 (;@8;) - local.get 3 - i32.const 29 - i32.shr_u - local.set 0 - local.get 3 - i32.const 1 - i32.shl - local.set 3 - local.get 6 - local.get 0 - i32.const 4 - i32.and - i32.add - i32.const 16 - i32.add - local.tee 9 - i32.load - local.tee 0 - br_if 0 (;@10;) - end - local.get 9 - local.get 5 - i32.store - local.get 5 - local.get 6 - i32.store offset=24 - local.get 5 - local.get 5 - i32.store offset=12 - local.get 5 - local.get 5 - i32.store offset=8 - br 2 (;@7;) - end - local.get 0 - i32.const -8 - local.get 0 - i32.sub - i32.const 15 - i32.and - i32.const 0 - local.get 0 - i32.const 8 - i32.add - i32.const 15 - i32.and - select - local.tee 4 - i32.add - local.tee 2 - local.get 7 - i32.const -56 - i32.add - local.tee 9 - local.get 4 - i32.sub - local.tee 4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - local.get 9 - i32.add - i32.const 56 - i32.store offset=4 - local.get 3 - local.get 6 - i32.const 55 - local.get 6 - i32.sub - i32.const 15 - i32.and - i32.const 0 - local.get 6 - i32.const -55 - i32.add - i32.const 15 - i32.and - select - i32.add - i32.const -63 - i32.add - local.tee 9 - local.get 9 - local.get 3 - i32.const 16 - i32.add - i32.lt_u - select - local.tee 9 - i32.const 35 - i32.store offset=4 - i32.const 0 - i32.const 0 - i32.load offset=1049068 - i32.store offset=1048608 - i32.const 0 - local.get 4 - i32.store offset=1048592 - i32.const 0 - local.get 2 - i32.store offset=1048604 - local.get 9 - i32.const 16 - i32.add - i32.const 0 - i64.load offset=1049036 align=4 - i64.store align=4 - local.get 9 - i32.const 0 - i64.load offset=1049028 align=4 - i64.store offset=8 align=4 - i32.const 0 - local.get 9 - i32.const 8 - i32.add - i32.store offset=1049036 - i32.const 0 - local.get 7 - i32.store offset=1049032 - i32.const 0 - local.get 0 - i32.store offset=1049028 - i32.const 0 - i32.const 0 - i32.store offset=1049040 - local.get 9 - i32.const 36 - i32.add - local.set 4 - loop ;; label = @9 - local.get 4 - i32.const 7 - i32.store - local.get 4 - i32.const 4 - i32.add - local.tee 4 - local.get 6 - i32.lt_u - br_if 0 (;@9;) - end - local.get 9 - local.get 3 - i32.eq - br_if 3 (;@5;) - local.get 9 - local.get 9 - i32.load offset=4 - i32.const -2 - i32.and - i32.store offset=4 - local.get 9 - local.get 9 - local.get 3 - i32.sub - local.tee 0 - i32.store - local.get 3 - local.get 0 - i32.const 1 - i32.or - i32.store offset=4 - block ;; label = @9 - local.get 0 - i32.const 255 - i32.gt_u - br_if 0 (;@9;) - local.get 0 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 4 - block ;; label = @10 - block ;; label = @11 - i32.const 0 - i32.load offset=1048580 - local.tee 6 - i32.const 1 - local.get 0 - i32.const 3 - i32.shr_u - i32.shl - local.tee 0 - i32.and - br_if 0 (;@11;) - i32.const 0 - local.get 6 - local.get 0 - i32.or - i32.store offset=1048580 - local.get 4 - local.set 6 - br 1 (;@10;) - end - local.get 4 - i32.load offset=8 - local.set 6 - end - local.get 6 - local.get 3 - i32.store offset=12 - local.get 4 - local.get 3 - i32.store offset=8 - local.get 3 - local.get 4 - i32.store offset=12 - local.get 3 - local.get 6 - i32.store offset=8 - br 4 (;@5;) - end - i32.const 31 - local.set 4 - block ;; label = @9 - local.get 0 - i32.const 16777215 - i32.gt_u - br_if 0 (;@9;) - local.get 0 - i32.const 38 - local.get 0 - i32.const 8 - i32.shr_u - i32.clz - local.tee 4 - i32.sub - i32.shr_u - i32.const 1 - i32.and - local.get 4 - i32.const 1 - i32.shl - i32.sub - i32.const 62 - i32.add - local.set 4 - end - local.get 3 - local.get 4 - i32.store offset=28 - local.get 3 - i64.const 0 - i64.store offset=16 align=4 - local.get 4 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.set 6 - block ;; label = @9 - i32.const 0 - i32.load offset=1048584 - local.tee 9 - i32.const 1 - local.get 4 - i32.shl - local.tee 7 - i32.and - br_if 0 (;@9;) - local.get 6 - local.get 3 - i32.store - i32.const 0 - local.get 9 - local.get 7 - i32.or - i32.store offset=1048584 - local.get 3 - local.get 6 - i32.store offset=24 - local.get 3 - local.get 3 - i32.store offset=8 - local.get 3 - local.get 3 - i32.store offset=12 - br 4 (;@5;) - end - local.get 0 - i32.const 0 - i32.const 25 - local.get 4 - i32.const 1 - i32.shr_u - i32.sub - local.get 4 - i32.const 31 - i32.eq - select - i32.shl - local.set 4 - local.get 6 - i32.load - local.set 9 - loop ;; label = @9 - local.get 9 - local.tee 6 - i32.load offset=4 - i32.const -8 - i32.and - local.get 0 - i32.eq - br_if 3 (;@6;) - local.get 4 - i32.const 29 - i32.shr_u - local.set 9 - local.get 4 - i32.const 1 - i32.shl - local.set 4 - local.get 6 - local.get 9 - i32.const 4 - i32.and - i32.add - i32.const 16 - i32.add - local.tee 7 - i32.load - local.tee 9 - br_if 0 (;@9;) - end - local.get 7 - local.get 3 - i32.store - local.get 3 - local.get 6 - i32.store offset=24 - local.get 3 - local.get 3 - i32.store offset=12 - local.get 3 - local.get 3 - i32.store offset=8 - br 3 (;@5;) - end - local.get 6 - i32.load offset=8 - local.tee 4 - local.get 5 - i32.store offset=12 - local.get 6 - local.get 5 - i32.store offset=8 - local.get 5 - i32.const 0 - i32.store offset=24 - local.get 5 - local.get 6 - i32.store offset=12 - local.get 5 - local.get 4 - i32.store offset=8 - end - local.get 2 - i32.const 8 - i32.add - local.set 4 - br 5 (;@1;) - end - local.get 6 - i32.load offset=8 - local.tee 4 - local.get 3 - i32.store offset=12 - local.get 6 - local.get 3 - i32.store offset=8 - local.get 3 - i32.const 0 - i32.store offset=24 - local.get 3 - local.get 6 - i32.store offset=12 - local.get 3 - local.get 4 - i32.store offset=8 - end - i32.const 0 - i32.load offset=1048592 - local.tee 4 - local.get 5 - i32.le_u - br_if 0 (;@4;) - i32.const 0 - i32.load offset=1048604 - local.tee 3 - local.get 5 - i32.add - local.tee 6 - local.get 4 - local.get 5 - i32.sub - local.tee 4 - i32.const 1 - i32.or - i32.store offset=4 - i32.const 0 - local.get 4 - i32.store offset=1048592 - i32.const 0 - local.get 6 - i32.store offset=1048604 - local.get 3 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - local.get 3 - i32.const 8 - i32.add - local.set 4 - br 3 (;@1;) - end - i32.const 0 - local.set 4 - i32.const 0 - i32.const 48 - i32.store offset=1049076 - br 2 (;@1;) - end - block ;; label = @3 - local.get 2 - i32.eqz - br_if 0 (;@3;) - block ;; label = @4 - block ;; label = @5 - local.get 9 - local.get 9 - i32.load offset=28 - local.tee 6 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 4 - i32.load - i32.ne - br_if 0 (;@5;) - local.get 4 - local.get 0 - i32.store - local.get 0 - br_if 1 (;@4;) - i32.const 0 - local.get 10 - i32.const -2 - local.get 6 - i32.rotl - i32.and - local.tee 10 - i32.store offset=1048584 - br 2 (;@3;) - end - local.get 2 - i32.const 16 - i32.const 20 - local.get 2 - i32.load offset=16 - local.get 9 - i32.eq - select - i32.add - local.get 0 - i32.store - local.get 0 - i32.eqz - br_if 1 (;@3;) - end - local.get 0 - local.get 2 - i32.store offset=24 - block ;; label = @4 - local.get 9 - i32.load offset=16 - local.tee 4 - i32.eqz - br_if 0 (;@4;) - local.get 0 - local.get 4 - i32.store offset=16 - local.get 4 - local.get 0 - i32.store offset=24 - end - local.get 9 - i32.const 20 - i32.add - i32.load - local.tee 4 - i32.eqz - br_if 0 (;@3;) - local.get 0 - i32.const 20 - i32.add - local.get 4 - i32.store - local.get 4 - local.get 0 - i32.store offset=24 - end - block ;; label = @3 - block ;; label = @4 - local.get 3 - i32.const 15 - i32.gt_u - br_if 0 (;@4;) - local.get 9 - local.get 3 - local.get 5 - i32.add - local.tee 4 - i32.const 3 - i32.or - i32.store offset=4 - local.get 9 - local.get 4 - i32.add - local.tee 4 - local.get 4 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - br 1 (;@3;) - end - local.get 9 - local.get 5 - i32.add - local.tee 0 - local.get 3 - i32.const 1 - i32.or - i32.store offset=4 - local.get 9 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 3 - i32.add - local.get 3 - i32.store - block ;; label = @4 - local.get 3 - i32.const 255 - i32.gt_u - br_if 0 (;@4;) - local.get 3 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 4 - block ;; label = @5 - block ;; label = @6 - i32.const 0 - i32.load offset=1048580 - local.tee 6 - i32.const 1 - local.get 3 - i32.const 3 - i32.shr_u - i32.shl - local.tee 3 - i32.and - br_if 0 (;@6;) - i32.const 0 - local.get 6 - local.get 3 - i32.or - i32.store offset=1048580 - local.get 4 - local.set 3 - br 1 (;@5;) - end - local.get 4 - i32.load offset=8 - local.set 3 - end - local.get 3 - local.get 0 - i32.store offset=12 - local.get 4 - local.get 0 - i32.store offset=8 - local.get 0 - local.get 4 - i32.store offset=12 - local.get 0 - local.get 3 - i32.store offset=8 - br 1 (;@3;) - end - i32.const 31 - local.set 4 - block ;; label = @4 - local.get 3 - i32.const 16777215 - i32.gt_u - br_if 0 (;@4;) - local.get 3 - i32.const 38 - local.get 3 - i32.const 8 - i32.shr_u - i32.clz - local.tee 4 - i32.sub - i32.shr_u - i32.const 1 - i32.and - local.get 4 - i32.const 1 - i32.shl - i32.sub - i32.const 62 - i32.add - local.set 4 - end - local.get 0 - local.get 4 - i32.store offset=28 - local.get 0 - i64.const 0 - i64.store offset=16 align=4 - local.get 4 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.set 6 - block ;; label = @4 - local.get 10 - i32.const 1 - local.get 4 - i32.shl - local.tee 5 - i32.and - br_if 0 (;@4;) - local.get 6 - local.get 0 - i32.store - i32.const 0 - local.get 10 - local.get 5 - i32.or - i32.store offset=1048584 - local.get 0 - local.get 6 - i32.store offset=24 - local.get 0 - local.get 0 - i32.store offset=8 - local.get 0 - local.get 0 - i32.store offset=12 - br 1 (;@3;) - end - local.get 3 - i32.const 0 - i32.const 25 - local.get 4 - i32.const 1 - i32.shr_u - i32.sub - local.get 4 - i32.const 31 - i32.eq - select - i32.shl - local.set 4 - local.get 6 - i32.load - local.set 5 - block ;; label = @4 - loop ;; label = @5 - local.get 5 - local.tee 6 - i32.load offset=4 - i32.const -8 - i32.and - local.get 3 - i32.eq - br_if 1 (;@4;) - local.get 4 - i32.const 29 - i32.shr_u - local.set 5 - local.get 4 - i32.const 1 - i32.shl - local.set 4 - local.get 6 - local.get 5 - i32.const 4 - i32.and - i32.add - i32.const 16 - i32.add - local.tee 7 - i32.load - local.tee 5 - br_if 0 (;@5;) - end - local.get 7 - local.get 0 - i32.store - local.get 0 - local.get 6 - i32.store offset=24 - local.get 0 - local.get 0 - i32.store offset=12 - local.get 0 - local.get 0 - i32.store offset=8 - br 1 (;@3;) - end - local.get 6 - i32.load offset=8 - local.tee 4 - local.get 0 - i32.store offset=12 - local.get 6 - local.get 0 - i32.store offset=8 - local.get 0 - i32.const 0 - i32.store offset=24 - local.get 0 - local.get 6 - i32.store offset=12 - local.get 0 - local.get 4 - i32.store offset=8 - end - local.get 9 - i32.const 8 - i32.add - local.set 4 - br 1 (;@1;) - end - block ;; label = @2 - local.get 11 - i32.eqz - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 0 - local.get 0 - i32.load offset=28 - local.tee 6 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 4 - i32.load - i32.ne - br_if 0 (;@4;) - local.get 4 - local.get 9 - i32.store - local.get 9 - br_if 1 (;@3;) - i32.const 0 - local.get 10 - i32.const -2 - local.get 6 - i32.rotl - i32.and - i32.store offset=1048584 - br 2 (;@2;) - end - local.get 11 - i32.const 16 - i32.const 20 - local.get 11 - i32.load offset=16 - local.get 0 - i32.eq - select - i32.add - local.get 9 - i32.store - local.get 9 - i32.eqz - br_if 1 (;@2;) - end - local.get 9 - local.get 11 - i32.store offset=24 - block ;; label = @3 - local.get 0 - i32.load offset=16 - local.tee 4 - i32.eqz - br_if 0 (;@3;) - local.get 9 - local.get 4 - i32.store offset=16 - local.get 4 - local.get 9 - i32.store offset=24 - end - local.get 0 - i32.const 20 - i32.add - i32.load - local.tee 4 - i32.eqz - br_if 0 (;@2;) - local.get 9 - i32.const 20 - i32.add - local.get 4 - i32.store - local.get 4 - local.get 9 - i32.store offset=24 - end - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.const 15 - i32.gt_u - br_if 0 (;@3;) - local.get 0 - local.get 3 - local.get 5 - i32.add - local.tee 4 - i32.const 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 4 - i32.add - local.tee 4 - local.get 4 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - br 1 (;@2;) - end - local.get 0 - local.get 5 - i32.add - local.tee 6 - local.get 3 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - local.get 5 - i32.const 3 - i32.or - i32.store offset=4 - local.get 6 - local.get 3 - i32.add - local.get 3 - i32.store - block ;; label = @3 - local.get 8 - i32.eqz - br_if 0 (;@3;) - local.get 8 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 5 - i32.const 0 - i32.load offset=1048600 - local.set 4 - block ;; label = @4 - block ;; label = @5 - i32.const 1 - local.get 8 - i32.const 3 - i32.shr_u - i32.shl - local.tee 9 - local.get 7 - i32.and - br_if 0 (;@5;) - i32.const 0 - local.get 9 - local.get 7 - i32.or - i32.store offset=1048580 - local.get 5 - local.set 9 - br 1 (;@4;) - end - local.get 5 - i32.load offset=8 - local.set 9 - end - local.get 9 - local.get 4 - i32.store offset=12 - local.get 5 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 5 - i32.store offset=12 - local.get 4 - local.get 9 - i32.store offset=8 - end - i32.const 0 - local.get 6 - i32.store offset=1048600 - i32.const 0 - local.get 3 - i32.store offset=1048588 - end - local.get 0 - i32.const 8 - i32.add - local.set 4 - end - local.get 1 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 4 - ) - (func $free (;10;) (type 4) (param i32) - local.get 0 - call $dlfree - ) - (func $dlfree (;11;) (type 4) (param i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 0 - i32.eqz - br_if 0 (;@1;) - local.get 0 - i32.const -8 - i32.add - local.tee 1 - local.get 0 - i32.const -4 - i32.add - i32.load - local.tee 2 - i32.const -8 - i32.and - local.tee 0 - i32.add - local.set 3 - block ;; label = @2 - local.get 2 - i32.const 1 - i32.and - br_if 0 (;@2;) - local.get 2 - i32.const 3 - i32.and - i32.eqz - br_if 1 (;@1;) - local.get 1 - local.get 1 - i32.load - local.tee 2 - i32.sub - local.tee 1 - i32.const 0 - i32.load offset=1048596 - local.tee 4 - i32.lt_u - br_if 1 (;@1;) - local.get 2 - local.get 0 - i32.add - local.set 0 - block ;; label = @3 - local.get 1 - i32.const 0 - i32.load offset=1048600 - i32.eq - br_if 0 (;@3;) - block ;; label = @4 - local.get 2 - i32.const 255 - i32.gt_u - br_if 0 (;@4;) - local.get 1 - i32.load offset=8 - local.tee 4 - local.get 2 - i32.const 3 - i32.shr_u - local.tee 5 - i32.const 3 - i32.shl - i32.const 1048620 - i32.add - local.tee 6 - i32.eq - drop - block ;; label = @5 - local.get 1 - i32.load offset=12 - local.tee 2 - local.get 4 - i32.ne - br_if 0 (;@5;) - i32.const 0 - i32.const 0 - i32.load offset=1048580 - i32.const -2 - local.get 5 - i32.rotl - i32.and - i32.store offset=1048580 - br 3 (;@2;) - end - local.get 2 - local.get 6 - i32.eq - drop - local.get 2 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 2 - i32.store offset=12 - br 2 (;@2;) - end - local.get 1 - i32.load offset=24 - local.set 7 - block ;; label = @4 - block ;; label = @5 - local.get 1 - i32.load offset=12 - local.tee 6 - local.get 1 - i32.eq - br_if 0 (;@5;) - local.get 1 - i32.load offset=8 - local.tee 2 - local.get 4 - i32.lt_u - drop - local.get 6 - local.get 2 - i32.store offset=8 - local.get 2 - local.get 6 - i32.store offset=12 - br 1 (;@4;) - end - block ;; label = @5 - local.get 1 - i32.const 20 - i32.add - local.tee 2 - i32.load - local.tee 4 - br_if 0 (;@5;) - local.get 1 - i32.const 16 - i32.add - local.tee 2 - i32.load - local.tee 4 - br_if 0 (;@5;) - i32.const 0 - local.set 6 - br 1 (;@4;) - end - loop ;; label = @5 - local.get 2 - local.set 5 - local.get 4 - local.tee 6 - i32.const 20 - i32.add - local.tee 2 - i32.load - local.tee 4 - br_if 0 (;@5;) - local.get 6 - i32.const 16 - i32.add - local.set 2 - local.get 6 - i32.load offset=16 - local.tee 4 - br_if 0 (;@5;) - end - local.get 5 - i32.const 0 - i32.store - end - local.get 7 - i32.eqz - br_if 1 (;@2;) - block ;; label = @4 - block ;; label = @5 - local.get 1 - local.get 1 - i32.load offset=28 - local.tee 4 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 2 - i32.load - i32.ne - br_if 0 (;@5;) - local.get 2 - local.get 6 - i32.store - local.get 6 - br_if 1 (;@4;) - i32.const 0 - i32.const 0 - i32.load offset=1048584 - i32.const -2 - local.get 4 - i32.rotl - i32.and - i32.store offset=1048584 - br 3 (;@2;) - end - local.get 7 - i32.const 16 - i32.const 20 - local.get 7 - i32.load offset=16 - local.get 1 - i32.eq - select - i32.add - local.get 6 - i32.store - local.get 6 - i32.eqz - br_if 2 (;@2;) - end - local.get 6 - local.get 7 - i32.store offset=24 - block ;; label = @4 - local.get 1 - i32.load offset=16 - local.tee 2 - i32.eqz - br_if 0 (;@4;) - local.get 6 - local.get 2 - i32.store offset=16 - local.get 2 - local.get 6 - i32.store offset=24 - end - local.get 1 - i32.load offset=20 - local.tee 2 - i32.eqz - br_if 1 (;@2;) - local.get 6 - i32.const 20 - i32.add - local.get 2 - i32.store - local.get 2 - local.get 6 - i32.store offset=24 - br 1 (;@2;) - end - local.get 3 - i32.load offset=4 - local.tee 2 - i32.const 3 - i32.and - i32.const 3 - i32.ne - br_if 0 (;@2;) - local.get 3 - local.get 2 - i32.const -2 - i32.and - i32.store offset=4 - i32.const 0 - local.get 0 - i32.store offset=1048588 - local.get 1 - local.get 0 - i32.add - local.get 0 - i32.store - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store offset=4 - return - end - local.get 1 - local.get 3 - i32.ge_u - br_if 0 (;@1;) - local.get 3 - i32.load offset=4 - local.tee 2 - i32.const 1 - i32.and - i32.eqz - br_if 0 (;@1;) - block ;; label = @2 - block ;; label = @3 - local.get 2 - i32.const 2 - i32.and - br_if 0 (;@3;) - block ;; label = @4 - local.get 3 - i32.const 0 - i32.load offset=1048604 - i32.ne - br_if 0 (;@4;) - i32.const 0 - local.get 1 - i32.store offset=1048604 - i32.const 0 - i32.const 0 - i32.load offset=1048592 - local.get 0 - i32.add - local.tee 0 - i32.store offset=1048592 - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store offset=4 - local.get 1 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 3 (;@1;) - i32.const 0 - i32.const 0 - i32.store offset=1048588 - i32.const 0 - i32.const 0 - i32.store offset=1048600 - return - end - block ;; label = @4 - local.get 3 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 0 (;@4;) - i32.const 0 - local.get 1 - i32.store offset=1048600 - i32.const 0 - i32.const 0 - i32.load offset=1048588 - local.get 0 - i32.add - local.tee 0 - i32.store offset=1048588 - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store offset=4 - local.get 1 - local.get 0 - i32.add - local.get 0 - i32.store - return - end - local.get 2 - i32.const -8 - i32.and - local.get 0 - i32.add - local.set 0 - block ;; label = @4 - block ;; label = @5 - local.get 2 - i32.const 255 - i32.gt_u - br_if 0 (;@5;) - local.get 3 - i32.load offset=8 - local.tee 4 - local.get 2 - i32.const 3 - i32.shr_u - local.tee 5 - i32.const 3 - i32.shl - i32.const 1048620 - i32.add - local.tee 6 - i32.eq - drop - block ;; label = @6 - local.get 3 - i32.load offset=12 - local.tee 2 - local.get 4 - i32.ne - br_if 0 (;@6;) - i32.const 0 - i32.const 0 - i32.load offset=1048580 - i32.const -2 - local.get 5 - i32.rotl - i32.and - i32.store offset=1048580 - br 2 (;@4;) - end - local.get 2 - local.get 6 - i32.eq - drop - local.get 2 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 2 - i32.store offset=12 - br 1 (;@4;) - end - local.get 3 - i32.load offset=24 - local.set 7 - block ;; label = @5 - block ;; label = @6 - local.get 3 - i32.load offset=12 - local.tee 6 - local.get 3 - i32.eq - br_if 0 (;@6;) - local.get 3 - i32.load offset=8 - local.tee 2 - i32.const 0 - i32.load offset=1048596 - i32.lt_u - drop - local.get 6 - local.get 2 - i32.store offset=8 - local.get 2 - local.get 6 - i32.store offset=12 - br 1 (;@5;) - end - block ;; label = @6 - local.get 3 - i32.const 20 - i32.add - local.tee 2 - i32.load - local.tee 4 - br_if 0 (;@6;) - local.get 3 - i32.const 16 - i32.add - local.tee 2 - i32.load - local.tee 4 - br_if 0 (;@6;) - i32.const 0 - local.set 6 - br 1 (;@5;) - end - loop ;; label = @6 - local.get 2 - local.set 5 - local.get 4 - local.tee 6 - i32.const 20 - i32.add - local.tee 2 - i32.load - local.tee 4 - br_if 0 (;@6;) - local.get 6 - i32.const 16 - i32.add - local.set 2 - local.get 6 - i32.load offset=16 - local.tee 4 - br_if 0 (;@6;) - end - local.get 5 - i32.const 0 - i32.store - end - local.get 7 - i32.eqz - br_if 0 (;@4;) - block ;; label = @5 - block ;; label = @6 - local.get 3 - local.get 3 - i32.load offset=28 - local.tee 4 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 2 - i32.load - i32.ne - br_if 0 (;@6;) - local.get 2 - local.get 6 - i32.store - local.get 6 - br_if 1 (;@5;) - i32.const 0 - i32.const 0 - i32.load offset=1048584 - i32.const -2 - local.get 4 - i32.rotl - i32.and - i32.store offset=1048584 - br 2 (;@4;) - end - local.get 7 - i32.const 16 - i32.const 20 - local.get 7 - i32.load offset=16 - local.get 3 - i32.eq - select - i32.add - local.get 6 - i32.store - local.get 6 - i32.eqz - br_if 1 (;@4;) - end - local.get 6 - local.get 7 - i32.store offset=24 - block ;; label = @5 - local.get 3 - i32.load offset=16 - local.tee 2 - i32.eqz - br_if 0 (;@5;) - local.get 6 - local.get 2 - i32.store offset=16 - local.get 2 - local.get 6 - i32.store offset=24 - end - local.get 3 - i32.load offset=20 - local.tee 2 - i32.eqz - br_if 0 (;@4;) - local.get 6 - i32.const 20 - i32.add - local.get 2 - i32.store - local.get 2 - local.get 6 - i32.store offset=24 - end - local.get 1 - local.get 0 - i32.add - local.get 0 - i32.store - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store offset=4 - local.get 1 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 1 (;@2;) - i32.const 0 - local.get 0 - i32.store offset=1048588 - return - end - local.get 3 - local.get 2 - i32.const -2 - i32.and - i32.store offset=4 - local.get 1 - local.get 0 - i32.add - local.get 0 - i32.store - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store offset=4 - end - block ;; label = @2 - local.get 0 - i32.const 255 - i32.gt_u - br_if 0 (;@2;) - local.get 0 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 2 - block ;; label = @3 - block ;; label = @4 - i32.const 0 - i32.load offset=1048580 - local.tee 4 - i32.const 1 - local.get 0 - i32.const 3 - i32.shr_u - i32.shl - local.tee 0 - i32.and - br_if 0 (;@4;) - i32.const 0 - local.get 4 - local.get 0 - i32.or - i32.store offset=1048580 - local.get 2 - local.set 0 - br 1 (;@3;) - end - local.get 2 - i32.load offset=8 - local.set 0 - end - local.get 0 - local.get 1 - i32.store offset=12 - local.get 2 - local.get 1 - i32.store offset=8 - local.get 1 - local.get 2 - i32.store offset=12 - local.get 1 - local.get 0 - i32.store offset=8 - return - end - i32.const 31 - local.set 2 - block ;; label = @2 - local.get 0 - i32.const 16777215 - i32.gt_u - br_if 0 (;@2;) - local.get 0 - i32.const 38 - local.get 0 - i32.const 8 - i32.shr_u - i32.clz - local.tee 2 - i32.sub - i32.shr_u - i32.const 1 - i32.and - local.get 2 - i32.const 1 - i32.shl - i32.sub - i32.const 62 - i32.add - local.set 2 - end - local.get 1 - local.get 2 - i32.store offset=28 - local.get 1 - i64.const 0 - i64.store offset=16 align=4 - local.get 2 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.set 4 - block ;; label = @2 - block ;; label = @3 - i32.const 0 - i32.load offset=1048584 - local.tee 6 - i32.const 1 - local.get 2 - i32.shl - local.tee 3 - i32.and - br_if 0 (;@3;) - local.get 4 - local.get 1 - i32.store - i32.const 0 - local.get 6 - local.get 3 - i32.or - i32.store offset=1048584 - local.get 1 - local.get 4 - i32.store offset=24 - local.get 1 - local.get 1 - i32.store offset=8 - local.get 1 - local.get 1 - i32.store offset=12 - br 1 (;@2;) - end - local.get 0 - i32.const 0 - i32.const 25 - local.get 2 - i32.const 1 - i32.shr_u - i32.sub - local.get 2 - i32.const 31 - i32.eq - select - i32.shl - local.set 2 - local.get 4 - i32.load - local.set 6 - block ;; label = @3 - loop ;; label = @4 - local.get 6 - local.tee 4 - i32.load offset=4 - i32.const -8 - i32.and - local.get 0 - i32.eq - br_if 1 (;@3;) - local.get 2 - i32.const 29 - i32.shr_u - local.set 6 - local.get 2 - i32.const 1 - i32.shl - local.set 2 - local.get 4 - local.get 6 - i32.const 4 - i32.and - i32.add - i32.const 16 - i32.add - local.tee 3 - i32.load - local.tee 6 - br_if 0 (;@4;) - end - local.get 3 - local.get 1 - i32.store - local.get 1 - local.get 4 - i32.store offset=24 - local.get 1 - local.get 1 - i32.store offset=12 - local.get 1 - local.get 1 - i32.store offset=8 - br 1 (;@2;) - end - local.get 4 - i32.load offset=8 - local.tee 0 - local.get 1 - i32.store offset=12 - local.get 4 - local.get 1 - i32.store offset=8 - local.get 1 - i32.const 0 - i32.store offset=24 - local.get 1 - local.get 4 - i32.store offset=12 - local.get 1 - local.get 0 - i32.store offset=8 - end - i32.const 0 - i32.const 0 - i32.load offset=1048612 - i32.const -1 - i32.add - local.tee 1 - i32.const -1 - local.get 1 - select - i32.store offset=1048612 - end - ) - (func $realloc (;12;) (type 1) (param i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 0 - br_if 0 (;@1;) - local.get 1 - call $dlmalloc - return - end - block ;; label = @1 - local.get 1 - i32.const -64 - i32.lt_u - br_if 0 (;@1;) - i32.const 0 - i32.const 48 - i32.store offset=1049076 - i32.const 0 - return - end - i32.const 16 - local.get 1 - i32.const 19 - i32.add - i32.const -16 - i32.and - local.get 1 - i32.const 11 - i32.lt_u - select - local.set 2 - local.get 0 - i32.const -4 - i32.add - local.tee 3 - i32.load - local.tee 4 - i32.const -8 - i32.and - local.set 5 - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 4 - i32.const 3 - i32.and - br_if 0 (;@3;) - local.get 2 - i32.const 256 - i32.lt_u - br_if 1 (;@2;) - local.get 5 - local.get 2 - i32.const 4 - i32.or - i32.lt_u - br_if 1 (;@2;) - local.get 5 - local.get 2 - i32.sub - i32.const 0 - i32.load offset=1049060 - i32.const 1 - i32.shl - i32.le_u - br_if 2 (;@1;) - br 1 (;@2;) - end - local.get 0 - i32.const -8 - i32.add - local.tee 6 - local.get 5 - i32.add - local.set 7 - block ;; label = @3 - local.get 5 - local.get 2 - i32.lt_u - br_if 0 (;@3;) - local.get 5 - local.get 2 - i32.sub - local.tee 1 - i32.const 16 - i32.lt_u - br_if 2 (;@1;) - local.get 3 - local.get 2 - local.get 4 - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store - local.get 6 - local.get 2 - i32.add - local.tee 2 - local.get 1 - i32.const 3 - i32.or - i32.store offset=4 - local.get 7 - local.get 7 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 2 - local.get 1 - call $dispose_chunk - local.get 0 - return - end - block ;; label = @3 - local.get 7 - i32.const 0 - i32.load offset=1048604 - i32.ne - br_if 0 (;@3;) - i32.const 0 - i32.load offset=1048592 - local.get 5 - i32.add - local.tee 5 - local.get 2 - i32.le_u - br_if 1 (;@2;) - local.get 3 - local.get 2 - local.get 4 - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store - i32.const 0 - local.get 6 - local.get 2 - i32.add - local.tee 1 - i32.store offset=1048604 - i32.const 0 - local.get 5 - local.get 2 - i32.sub - local.tee 2 - i32.store offset=1048592 - local.get 1 - local.get 2 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - return - end - block ;; label = @3 - local.get 7 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 0 (;@3;) - i32.const 0 - i32.load offset=1048588 - local.get 5 - i32.add - local.tee 5 - local.get 2 - i32.lt_u - br_if 1 (;@2;) - block ;; label = @4 - block ;; label = @5 - local.get 5 - local.get 2 - i32.sub - local.tee 1 - i32.const 16 - i32.lt_u - br_if 0 (;@5;) - local.get 3 - local.get 2 - local.get 4 - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store - local.get 6 - local.get 2 - i32.add - local.tee 2 - local.get 1 - i32.const 1 - i32.or - i32.store offset=4 - local.get 6 - local.get 5 - i32.add - local.tee 5 - local.get 1 - i32.store - local.get 5 - local.get 5 - i32.load offset=4 - i32.const -2 - i32.and - i32.store offset=4 - br 1 (;@4;) - end - local.get 3 - local.get 4 - i32.const 1 - i32.and - local.get 5 - i32.or - i32.const 2 - i32.or - i32.store - local.get 6 - local.get 5 - i32.add - local.tee 1 - local.get 1 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - i32.const 0 - local.set 1 - i32.const 0 - local.set 2 - end - i32.const 0 - local.get 2 - i32.store offset=1048600 - i32.const 0 - local.get 1 - i32.store offset=1048588 - local.get 0 - return - end - local.get 7 - i32.load offset=4 - local.tee 8 - i32.const 2 - i32.and - br_if 0 (;@2;) - local.get 8 - i32.const -8 - i32.and - local.get 5 - i32.add - local.tee 9 - local.get 2 - i32.lt_u - br_if 0 (;@2;) - local.get 9 - local.get 2 - i32.sub - local.set 10 - block ;; label = @3 - block ;; label = @4 - local.get 8 - i32.const 255 - i32.gt_u - br_if 0 (;@4;) - local.get 7 - i32.load offset=8 - local.tee 1 - local.get 8 - i32.const 3 - i32.shr_u - local.tee 11 - i32.const 3 - i32.shl - i32.const 1048620 - i32.add - local.tee 8 - i32.eq - drop - block ;; label = @5 - local.get 7 - i32.load offset=12 - local.tee 5 - local.get 1 - i32.ne - br_if 0 (;@5;) - i32.const 0 - i32.const 0 - i32.load offset=1048580 - i32.const -2 - local.get 11 - i32.rotl - i32.and - i32.store offset=1048580 - br 2 (;@3;) - end - local.get 5 - local.get 8 - i32.eq - drop - local.get 5 - local.get 1 - i32.store offset=8 - local.get 1 - local.get 5 - i32.store offset=12 - br 1 (;@3;) - end - local.get 7 - i32.load offset=24 - local.set 12 - block ;; label = @4 - block ;; label = @5 - local.get 7 - i32.load offset=12 - local.tee 8 - local.get 7 - i32.eq - br_if 0 (;@5;) - local.get 7 - i32.load offset=8 - local.tee 1 - i32.const 0 - i32.load offset=1048596 - i32.lt_u - drop - local.get 8 - local.get 1 - i32.store offset=8 - local.get 1 - local.get 8 - i32.store offset=12 - br 1 (;@4;) - end - block ;; label = @5 - local.get 7 - i32.const 20 - i32.add - local.tee 1 - i32.load - local.tee 5 - br_if 0 (;@5;) - local.get 7 - i32.const 16 - i32.add - local.tee 1 - i32.load - local.tee 5 - br_if 0 (;@5;) - i32.const 0 - local.set 8 - br 1 (;@4;) - end - loop ;; label = @5 - local.get 1 - local.set 11 - local.get 5 - local.tee 8 - i32.const 20 - i32.add - local.tee 1 - i32.load - local.tee 5 - br_if 0 (;@5;) - local.get 8 - i32.const 16 - i32.add - local.set 1 - local.get 8 - i32.load offset=16 - local.tee 5 - br_if 0 (;@5;) - end - local.get 11 - i32.const 0 - i32.store - end - local.get 12 - i32.eqz - br_if 0 (;@3;) - block ;; label = @4 - block ;; label = @5 - local.get 7 - local.get 7 - i32.load offset=28 - local.tee 5 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 1 - i32.load - i32.ne - br_if 0 (;@5;) - local.get 1 - local.get 8 - i32.store - local.get 8 - br_if 1 (;@4;) - i32.const 0 - i32.const 0 - i32.load offset=1048584 - i32.const -2 - local.get 5 - i32.rotl - i32.and - i32.store offset=1048584 - br 2 (;@3;) - end - local.get 12 - i32.const 16 - i32.const 20 - local.get 12 - i32.load offset=16 - local.get 7 - i32.eq - select - i32.add - local.get 8 - i32.store - local.get 8 - i32.eqz - br_if 1 (;@3;) - end - local.get 8 - local.get 12 - i32.store offset=24 - block ;; label = @4 - local.get 7 - i32.load offset=16 - local.tee 1 - i32.eqz - br_if 0 (;@4;) - local.get 8 - local.get 1 - i32.store offset=16 - local.get 1 - local.get 8 - i32.store offset=24 - end - local.get 7 - i32.load offset=20 - local.tee 1 - i32.eqz - br_if 0 (;@3;) - local.get 8 - i32.const 20 - i32.add - local.get 1 - i32.store - local.get 1 - local.get 8 - i32.store offset=24 - end - block ;; label = @3 - local.get 10 - i32.const 15 - i32.gt_u - br_if 0 (;@3;) - local.get 3 - local.get 4 - i32.const 1 - i32.and - local.get 9 - i32.or - i32.const 2 - i32.or - i32.store - local.get 6 - local.get 9 - i32.add - local.tee 1 - local.get 1 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - return - end - local.get 3 - local.get 2 - local.get 4 - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store - local.get 6 - local.get 2 - i32.add - local.tee 1 - local.get 10 - i32.const 3 - i32.or - i32.store offset=4 - local.get 6 - local.get 9 - i32.add - local.tee 2 - local.get 2 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 1 - local.get 10 - call $dispose_chunk - local.get 0 - return - end - block ;; label = @2 - local.get 1 - call $dlmalloc - local.tee 2 - br_if 0 (;@2;) - i32.const 0 - return - end - local.get 2 - local.get 0 - i32.const -4 - i32.const -8 - local.get 3 - i32.load - local.tee 5 - i32.const 3 - i32.and - select - local.get 5 - i32.const -8 - i32.and - i32.add - local.tee 5 - local.get 1 - local.get 5 - local.get 1 - i32.lt_u - select - call $memcpy - local.set 1 - local.get 0 - call $dlfree - local.get 1 - local.set 0 - end - local.get 0 - ) - (func $dispose_chunk (;13;) (type 5) (param i32 i32) - (local i32 i32 i32 i32 i32 i32) - local.get 0 - local.get 1 - i32.add - local.set 2 - block ;; label = @1 - block ;; label = @2 - local.get 0 - i32.load offset=4 - local.tee 3 - i32.const 1 - i32.and - br_if 0 (;@2;) - local.get 3 - i32.const 3 - i32.and - i32.eqz - br_if 1 (;@1;) - local.get 0 - i32.load - local.tee 3 - local.get 1 - i32.add - local.set 1 - block ;; label = @3 - block ;; label = @4 - local.get 0 - local.get 3 - i32.sub - local.tee 0 - i32.const 0 - i32.load offset=1048600 - i32.eq - br_if 0 (;@4;) - block ;; label = @5 - local.get 3 - i32.const 255 - i32.gt_u - br_if 0 (;@5;) - local.get 0 - i32.load offset=8 - local.tee 4 - local.get 3 - i32.const 3 - i32.shr_u - local.tee 5 - i32.const 3 - i32.shl - i32.const 1048620 - i32.add - local.tee 6 - i32.eq - drop - local.get 0 - i32.load offset=12 - local.tee 3 - local.get 4 - i32.ne - br_if 2 (;@3;) - i32.const 0 - i32.const 0 - i32.load offset=1048580 - i32.const -2 - local.get 5 - i32.rotl - i32.and - i32.store offset=1048580 - br 3 (;@2;) - end - local.get 0 - i32.load offset=24 - local.set 7 - block ;; label = @5 - block ;; label = @6 - local.get 0 - i32.load offset=12 - local.tee 6 - local.get 0 - i32.eq - br_if 0 (;@6;) - local.get 0 - i32.load offset=8 - local.tee 3 - i32.const 0 - i32.load offset=1048596 - i32.lt_u - drop - local.get 6 - local.get 3 - i32.store offset=8 - local.get 3 - local.get 6 - i32.store offset=12 - br 1 (;@5;) - end - block ;; label = @6 - local.get 0 - i32.const 20 - i32.add - local.tee 3 - i32.load - local.tee 4 - br_if 0 (;@6;) - local.get 0 - i32.const 16 - i32.add - local.tee 3 - i32.load - local.tee 4 - br_if 0 (;@6;) - i32.const 0 - local.set 6 - br 1 (;@5;) - end - loop ;; label = @6 - local.get 3 - local.set 5 - local.get 4 - local.tee 6 - i32.const 20 - i32.add - local.tee 3 - i32.load - local.tee 4 - br_if 0 (;@6;) - local.get 6 - i32.const 16 - i32.add - local.set 3 - local.get 6 - i32.load offset=16 - local.tee 4 - br_if 0 (;@6;) - end - local.get 5 - i32.const 0 - i32.store - end - local.get 7 - i32.eqz - br_if 2 (;@2;) - block ;; label = @5 - block ;; label = @6 - local.get 0 - local.get 0 - i32.load offset=28 - local.tee 4 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 3 - i32.load - i32.ne - br_if 0 (;@6;) - local.get 3 - local.get 6 - i32.store - local.get 6 - br_if 1 (;@5;) - i32.const 0 - i32.const 0 - i32.load offset=1048584 - i32.const -2 - local.get 4 - i32.rotl - i32.and - i32.store offset=1048584 - br 4 (;@2;) - end - local.get 7 - i32.const 16 - i32.const 20 - local.get 7 - i32.load offset=16 - local.get 0 - i32.eq - select - i32.add - local.get 6 - i32.store - local.get 6 - i32.eqz - br_if 3 (;@2;) - end - local.get 6 - local.get 7 - i32.store offset=24 - block ;; label = @5 - local.get 0 - i32.load offset=16 - local.tee 3 - i32.eqz - br_if 0 (;@5;) - local.get 6 - local.get 3 - i32.store offset=16 - local.get 3 - local.get 6 - i32.store offset=24 - end - local.get 0 - i32.load offset=20 - local.tee 3 - i32.eqz - br_if 2 (;@2;) - local.get 6 - i32.const 20 - i32.add - local.get 3 - i32.store - local.get 3 - local.get 6 - i32.store offset=24 - br 2 (;@2;) - end - local.get 2 - i32.load offset=4 - local.tee 3 - i32.const 3 - i32.and - i32.const 3 - i32.ne - br_if 1 (;@2;) - local.get 2 - local.get 3 - i32.const -2 - i32.and - i32.store offset=4 - i32.const 0 - local.get 1 - i32.store offset=1048588 - local.get 2 - local.get 1 - i32.store - local.get 0 - local.get 1 - i32.const 1 - i32.or - i32.store offset=4 - return - end - local.get 3 - local.get 6 - i32.eq - drop - local.get 3 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 3 - i32.store offset=12 - end - block ;; label = @2 - block ;; label = @3 - local.get 2 - i32.load offset=4 - local.tee 3 - i32.const 2 - i32.and - br_if 0 (;@3;) - block ;; label = @4 - local.get 2 - i32.const 0 - i32.load offset=1048604 - i32.ne - br_if 0 (;@4;) - i32.const 0 - local.get 0 - i32.store offset=1048604 - i32.const 0 - i32.const 0 - i32.load offset=1048592 - local.get 1 - i32.add - local.tee 1 - i32.store offset=1048592 - local.get 0 - local.get 1 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 3 (;@1;) - i32.const 0 - i32.const 0 - i32.store offset=1048588 - i32.const 0 - i32.const 0 - i32.store offset=1048600 - return - end - block ;; label = @4 - local.get 2 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 0 (;@4;) - i32.const 0 - local.get 0 - i32.store offset=1048600 - i32.const 0 - i32.const 0 - i32.load offset=1048588 - local.get 1 - i32.add - local.tee 1 - i32.store offset=1048588 - local.get 0 - local.get 1 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - local.get 1 - i32.add - local.get 1 - i32.store - return - end - local.get 3 - i32.const -8 - i32.and - local.get 1 - i32.add - local.set 1 - block ;; label = @4 - block ;; label = @5 - local.get 3 - i32.const 255 - i32.gt_u - br_if 0 (;@5;) - local.get 2 - i32.load offset=8 - local.tee 4 - local.get 3 - i32.const 3 - i32.shr_u - local.tee 5 - i32.const 3 - i32.shl - i32.const 1048620 - i32.add - local.tee 6 - i32.eq - drop - block ;; label = @6 - local.get 2 - i32.load offset=12 - local.tee 3 - local.get 4 - i32.ne - br_if 0 (;@6;) - i32.const 0 - i32.const 0 - i32.load offset=1048580 - i32.const -2 - local.get 5 - i32.rotl - i32.and - i32.store offset=1048580 - br 2 (;@4;) - end - local.get 3 - local.get 6 - i32.eq - drop - local.get 3 - local.get 4 - i32.store offset=8 - local.get 4 - local.get 3 - i32.store offset=12 - br 1 (;@4;) - end - local.get 2 - i32.load offset=24 - local.set 7 - block ;; label = @5 - block ;; label = @6 - local.get 2 - i32.load offset=12 - local.tee 6 - local.get 2 - i32.eq - br_if 0 (;@6;) - local.get 2 - i32.load offset=8 - local.tee 3 - i32.const 0 - i32.load offset=1048596 - i32.lt_u - drop - local.get 6 - local.get 3 - i32.store offset=8 - local.get 3 - local.get 6 - i32.store offset=12 - br 1 (;@5;) - end - block ;; label = @6 - local.get 2 - i32.const 20 - i32.add - local.tee 4 - i32.load - local.tee 3 - br_if 0 (;@6;) - local.get 2 - i32.const 16 - i32.add - local.tee 4 - i32.load - local.tee 3 - br_if 0 (;@6;) - i32.const 0 - local.set 6 - br 1 (;@5;) - end - loop ;; label = @6 - local.get 4 - local.set 5 - local.get 3 - local.tee 6 - i32.const 20 - i32.add - local.tee 4 - i32.load - local.tee 3 - br_if 0 (;@6;) - local.get 6 - i32.const 16 - i32.add - local.set 4 - local.get 6 - i32.load offset=16 - local.tee 3 - br_if 0 (;@6;) - end - local.get 5 - i32.const 0 - i32.store - end - local.get 7 - i32.eqz - br_if 0 (;@4;) - block ;; label = @5 - block ;; label = @6 - local.get 2 - local.get 2 - i32.load offset=28 - local.tee 4 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.tee 3 - i32.load - i32.ne - br_if 0 (;@6;) - local.get 3 - local.get 6 - i32.store - local.get 6 - br_if 1 (;@5;) - i32.const 0 - i32.const 0 - i32.load offset=1048584 - i32.const -2 - local.get 4 - i32.rotl - i32.and - i32.store offset=1048584 - br 2 (;@4;) - end - local.get 7 - i32.const 16 - i32.const 20 - local.get 7 - i32.load offset=16 - local.get 2 - i32.eq - select - i32.add - local.get 6 - i32.store - local.get 6 - i32.eqz - br_if 1 (;@4;) - end - local.get 6 - local.get 7 - i32.store offset=24 - block ;; label = @5 - local.get 2 - i32.load offset=16 - local.tee 3 - i32.eqz - br_if 0 (;@5;) - local.get 6 - local.get 3 - i32.store offset=16 - local.get 3 - local.get 6 - i32.store offset=24 - end - local.get 2 - i32.load offset=20 - local.tee 3 - i32.eqz - br_if 0 (;@4;) - local.get 6 - i32.const 20 - i32.add - local.get 3 - i32.store - local.get 3 - local.get 6 - i32.store offset=24 - end - local.get 0 - local.get 1 - i32.add - local.get 1 - i32.store - local.get 0 - local.get 1 - i32.const 1 - i32.or - i32.store offset=4 - local.get 0 - i32.const 0 - i32.load offset=1048600 - i32.ne - br_if 1 (;@2;) - i32.const 0 - local.get 1 - i32.store offset=1048588 - return - end - local.get 2 - local.get 3 - i32.const -2 - i32.and - i32.store offset=4 - local.get 0 - local.get 1 - i32.add - local.get 1 - i32.store - local.get 0 - local.get 1 - i32.const 1 - i32.or - i32.store offset=4 - end - block ;; label = @2 - local.get 1 - i32.const 255 - i32.gt_u - br_if 0 (;@2;) - local.get 1 - i32.const -8 - i32.and - i32.const 1048620 - i32.add - local.set 3 - block ;; label = @3 - block ;; label = @4 - i32.const 0 - i32.load offset=1048580 - local.tee 4 - i32.const 1 - local.get 1 - i32.const 3 - i32.shr_u - i32.shl - local.tee 1 - i32.and - br_if 0 (;@4;) - i32.const 0 - local.get 4 - local.get 1 - i32.or - i32.store offset=1048580 - local.get 3 - local.set 1 - br 1 (;@3;) - end - local.get 3 - i32.load offset=8 - local.set 1 - end - local.get 1 - local.get 0 - i32.store offset=12 - local.get 3 - local.get 0 - i32.store offset=8 - local.get 0 - local.get 3 - i32.store offset=12 - local.get 0 - local.get 1 - i32.store offset=8 - return - end - i32.const 31 - local.set 3 - block ;; label = @2 - local.get 1 - i32.const 16777215 - i32.gt_u - br_if 0 (;@2;) - local.get 1 - i32.const 38 - local.get 1 - i32.const 8 - i32.shr_u - i32.clz - local.tee 3 - i32.sub - i32.shr_u - i32.const 1 - i32.and - local.get 3 - i32.const 1 - i32.shl - i32.sub - i32.const 62 - i32.add - local.set 3 - end - local.get 0 - local.get 3 - i32.store offset=28 - local.get 0 - i64.const 0 - i64.store offset=16 align=4 - local.get 3 - i32.const 2 - i32.shl - i32.const 1048884 - i32.add - local.set 4 - block ;; label = @2 - i32.const 0 - i32.load offset=1048584 - local.tee 6 - i32.const 1 - local.get 3 - i32.shl - local.tee 2 - i32.and - br_if 0 (;@2;) - local.get 4 - local.get 0 - i32.store - i32.const 0 - local.get 6 - local.get 2 - i32.or - i32.store offset=1048584 - local.get 0 - local.get 4 - i32.store offset=24 - local.get 0 - local.get 0 - i32.store offset=8 - local.get 0 - local.get 0 - i32.store offset=12 - return - end - local.get 1 - i32.const 0 - i32.const 25 - local.get 3 - i32.const 1 - i32.shr_u - i32.sub - local.get 3 - i32.const 31 - i32.eq - select - i32.shl - local.set 3 - local.get 4 - i32.load - local.set 6 - block ;; label = @2 - loop ;; label = @3 - local.get 6 - local.tee 4 - i32.load offset=4 - i32.const -8 - i32.and - local.get 1 - i32.eq - br_if 1 (;@2;) - local.get 3 - i32.const 29 - i32.shr_u - local.set 6 - local.get 3 - i32.const 1 - i32.shl - local.set 3 - local.get 4 - local.get 6 - i32.const 4 - i32.and - i32.add - i32.const 16 - i32.add - local.tee 2 - i32.load - local.tee 6 - br_if 0 (;@3;) - end - local.get 2 - local.get 0 - i32.store - local.get 0 - local.get 4 - i32.store offset=24 - local.get 0 - local.get 0 - i32.store offset=12 - local.get 0 - local.get 0 - i32.store offset=8 - return - end - local.get 4 - i32.load offset=8 - local.tee 1 - local.get 0 - i32.store offset=12 - local.get 4 - local.get 0 - i32.store offset=8 - local.get 0 - i32.const 0 - i32.store offset=24 - local.get 0 - local.get 4 - i32.store offset=12 - local.get 0 - local.get 1 - i32.store offset=8 - end - ) - (func $internal_memalign (;14;) (type 1) (param i32 i32) (result i32) - (local i32 i32 i32 i32 i32) - block ;; label = @1 - block ;; label = @2 - local.get 0 - i32.const 16 - local.get 0 - i32.const 16 - i32.gt_u - select - local.tee 2 - local.get 2 - i32.const -1 - i32.add - i32.and - br_if 0 (;@2;) - local.get 2 - local.set 0 - br 1 (;@1;) - end - i32.const 32 - local.set 3 - loop ;; label = @2 - local.get 3 - local.tee 0 - i32.const 1 - i32.shl - local.set 3 - local.get 0 - local.get 2 - i32.lt_u - br_if 0 (;@2;) - end - end - block ;; label = @1 - i32.const -64 - local.get 0 - i32.sub - local.get 1 - i32.gt_u - br_if 0 (;@1;) - i32.const 0 - i32.const 48 - i32.store offset=1049076 - i32.const 0 - return - end - block ;; label = @1 - local.get 0 - i32.const 16 - local.get 1 - i32.const 19 - i32.add - i32.const -16 - i32.and - local.get 1 - i32.const 11 - i32.lt_u - select - local.tee 1 - i32.add - i32.const 12 - i32.add - call $dlmalloc - local.tee 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 3 - i32.const -8 - i32.add - local.set 2 - block ;; label = @1 - block ;; label = @2 - local.get 0 - i32.const -1 - i32.add - local.get 3 - i32.and - br_if 0 (;@2;) - local.get 2 - local.set 0 - br 1 (;@1;) - end - local.get 3 - i32.const -4 - i32.add - local.tee 4 - i32.load - local.tee 5 - i32.const -8 - i32.and - local.get 3 - local.get 0 - i32.add - i32.const -1 - i32.add - i32.const 0 - local.get 0 - i32.sub - i32.and - i32.const -8 - i32.add - local.tee 3 - i32.const 0 - local.get 0 - local.get 3 - local.get 2 - i32.sub - i32.const 15 - i32.gt_u - select - i32.add - local.tee 0 - local.get 2 - i32.sub - local.tee 3 - i32.sub - local.set 6 - block ;; label = @2 - local.get 5 - i32.const 3 - i32.and - br_if 0 (;@2;) - local.get 0 - local.get 6 - i32.store offset=4 - local.get 0 - local.get 2 - i32.load - local.get 3 - i32.add - i32.store - br 1 (;@1;) - end - local.get 0 - local.get 6 - local.get 0 - i32.load offset=4 - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store offset=4 - local.get 0 - local.get 6 - i32.add - local.tee 6 - local.get 6 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 4 - local.get 3 - local.get 4 - i32.load - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store - local.get 2 - local.get 3 - i32.add - local.tee 6 - local.get 6 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 2 - local.get 3 - call $dispose_chunk - end - block ;; label = @1 - local.get 0 - i32.load offset=4 - local.tee 3 - i32.const 3 - i32.and - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.const -8 - i32.and - local.tee 2 - local.get 1 - i32.const 16 - i32.add - i32.le_u - br_if 0 (;@1;) - local.get 0 - local.get 1 - local.get 3 - i32.const 1 - i32.and - i32.or - i32.const 2 - i32.or - i32.store offset=4 - local.get 0 - local.get 1 - i32.add - local.tee 3 - local.get 2 - local.get 1 - i32.sub - local.tee 1 - i32.const 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 2 - i32.add - local.tee 2 - local.get 2 - i32.load offset=4 - i32.const 1 - i32.or - i32.store offset=4 - local.get 3 - local.get 1 - call $dispose_chunk - end - local.get 0 - i32.const 8 - i32.add - ) - (func $aligned_alloc (;15;) (type 1) (param i32 i32) (result i32) - block ;; label = @1 - local.get 0 - i32.const 16 - i32.gt_u - br_if 0 (;@1;) - local.get 1 - call $dlmalloc - return - end - local.get 0 - local.get 1 - call $internal_memalign - ) - (func $abort (;16;) (type 0) - unreachable - unreachable - ) - (func $sbrk (;17;) (type 3) (param i32) (result i32) - block ;; label = @1 - local.get 0 - br_if 0 (;@1;) - memory.size - i32.const 16 - i32.shl - return - end - block ;; label = @1 - local.get 0 - i32.const 65535 - i32.and - br_if 0 (;@1;) - local.get 0 - i32.const -1 - i32.le_s - br_if 0 (;@1;) - block ;; label = @2 - local.get 0 - i32.const 16 - i32.shr_u - memory.grow - local.tee 0 - i32.const -1 - i32.ne - br_if 0 (;@2;) - i32.const 0 - i32.const 48 - i32.store offset=1049076 - i32.const -1 - return - end - local.get 0 - i32.const 16 - i32.shl - return - end - call $abort - unreachable - ) - (func $memcpy (;18;) (type 6) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 2 - i32.const 32 - i32.gt_u - br_if 0 (;@3;) - local.get 1 - i32.const 3 - i32.and - i32.eqz - br_if 1 (;@2;) - local.get 2 - i32.eqz - br_if 1 (;@2;) - local.get 0 - local.get 1 - i32.load8_u - i32.store8 - local.get 2 - i32.const -1 - i32.add - local.set 3 - local.get 0 - i32.const 1 - i32.add - local.set 4 - local.get 1 - i32.const 1 - i32.add - local.tee 5 - i32.const 3 - i32.and - i32.eqz - br_if 2 (;@1;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - local.get 0 - local.get 1 - i32.load8_u offset=1 - i32.store8 offset=1 - local.get 2 - i32.const -2 - i32.add - local.set 3 - local.get 0 - i32.const 2 - i32.add - local.set 4 - local.get 1 - i32.const 2 - i32.add - local.tee 5 - i32.const 3 - i32.and - i32.eqz - br_if 2 (;@1;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - local.get 0 - local.get 1 - i32.load8_u offset=2 - i32.store8 offset=2 - local.get 2 - i32.const -3 - i32.add - local.set 3 - local.get 0 - i32.const 3 - i32.add - local.set 4 - local.get 1 - i32.const 3 - i32.add - local.tee 5 - i32.const 3 - i32.and - i32.eqz - br_if 2 (;@1;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - local.get 0 - local.get 1 - i32.load8_u offset=3 - i32.store8 offset=3 - local.get 2 - i32.const -4 - i32.add - local.set 3 - local.get 0 - i32.const 4 - i32.add - local.set 4 - local.get 1 - i32.const 4 - i32.add - local.set 5 - br 2 (;@1;) - end - local.get 0 - local.get 1 - local.get 2 - memory.copy - local.get 0 - return - end - local.get 2 - local.set 3 - local.get 0 - local.set 4 - local.get 1 - local.set 5 - end - block ;; label = @1 - block ;; label = @2 - local.get 4 - i32.const 3 - i32.and - local.tee 2 - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 3 - i32.const 16 - i32.ge_u - br_if 0 (;@4;) - local.get 3 - local.set 2 - br 1 (;@3;) - end - block ;; label = @4 - local.get 3 - i32.const -16 - i32.add - local.tee 2 - i32.const 16 - i32.and - br_if 0 (;@4;) - local.get 4 - local.get 5 - i64.load align=4 - i64.store align=4 - local.get 4 - local.get 5 - i64.load offset=8 align=4 - i64.store offset=8 align=4 - local.get 4 - i32.const 16 - i32.add - local.set 4 - local.get 5 - i32.const 16 - i32.add - local.set 5 - local.get 2 - local.set 3 - end - local.get 2 - i32.const 16 - i32.lt_u - br_if 0 (;@3;) - local.get 3 - local.set 2 - loop ;; label = @4 - local.get 4 - local.get 5 - i64.load align=4 - i64.store align=4 - local.get 4 - local.get 5 - i64.load offset=8 align=4 - i64.store offset=8 align=4 - local.get 4 - local.get 5 - i64.load offset=16 align=4 - i64.store offset=16 align=4 - local.get 4 - local.get 5 - i64.load offset=24 align=4 - i64.store offset=24 align=4 - local.get 4 - i32.const 32 - i32.add - local.set 4 - local.get 5 - i32.const 32 - i32.add - local.set 5 - local.get 2 - i32.const -32 - i32.add - local.tee 2 - i32.const 15 - i32.gt_u - br_if 0 (;@4;) - end - end - block ;; label = @3 - local.get 2 - i32.const 8 - i32.lt_u - br_if 0 (;@3;) - local.get 4 - local.get 5 - i64.load align=4 - i64.store align=4 - local.get 5 - i32.const 8 - i32.add - local.set 5 - local.get 4 - i32.const 8 - i32.add - local.set 4 - end - block ;; label = @3 - local.get 2 - i32.const 4 - i32.and - i32.eqz - br_if 0 (;@3;) - local.get 4 - local.get 5 - i32.load - i32.store - local.get 5 - i32.const 4 - i32.add - local.set 5 - local.get 4 - i32.const 4 - i32.add - local.set 4 - end - block ;; label = @3 - local.get 2 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@3;) - local.get 4 - local.get 5 - i32.load16_u align=1 - i32.store16 align=1 - local.get 4 - i32.const 2 - i32.add - local.set 4 - local.get 5 - i32.const 2 - i32.add - local.set 5 - end - local.get 2 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@1;) - local.get 4 - local.get 5 - i32.load8_u - i32.store8 - local.get 0 - return - end - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - block ;; label = @6 - local.get 3 - i32.const 32 - i32.lt_u - br_if 0 (;@6;) - block ;; label = @7 - block ;; label = @8 - local.get 2 - i32.const -1 - i32.add - br_table 3 (;@5;) 0 (;@8;) 1 (;@7;) 7 (;@1;) - end - local.get 4 - local.get 5 - i32.load - i32.store16 align=1 - local.get 4 - local.get 5 - i32.const 2 - i32.add - i32.load align=2 - i32.store offset=2 - local.get 4 - local.get 5 - i32.const 6 - i32.add - i64.load align=2 - i64.store offset=6 align=4 - local.get 4 - i32.const 18 - i32.add - local.set 2 - local.get 5 - i32.const 18 - i32.add - local.set 1 - i32.const 14 - local.set 6 - local.get 5 - i32.const 14 - i32.add - i32.load align=2 - local.set 5 - i32.const 14 - local.set 3 - br 3 (;@4;) - end - local.get 4 - local.get 5 - i32.load - i32.store8 - local.get 4 - local.get 5 - i32.const 1 - i32.add - i32.load align=1 - i32.store offset=1 - local.get 4 - local.get 5 - i32.const 5 - i32.add - i64.load align=1 - i64.store offset=5 align=4 - local.get 4 - i32.const 17 - i32.add - local.set 2 - local.get 5 - i32.const 17 - i32.add - local.set 1 - i32.const 13 - local.set 6 - local.get 5 - i32.const 13 - i32.add - i32.load align=1 - local.set 5 - i32.const 15 - local.set 3 - br 2 (;@4;) - end - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 16 - i32.ge_u - br_if 0 (;@7;) - local.get 4 - local.set 2 - local.get 5 - local.set 1 - br 1 (;@6;) - end - local.get 4 - local.get 5 - i32.load8_u - i32.store8 - local.get 4 - local.get 5 - i32.load offset=1 align=1 - i32.store offset=1 align=1 - local.get 4 - local.get 5 - i64.load offset=5 align=1 - i64.store offset=5 align=1 - local.get 4 - local.get 5 - i32.load16_u offset=13 align=1 - i32.store16 offset=13 align=1 - local.get 4 - local.get 5 - i32.load8_u offset=15 - i32.store8 offset=15 - local.get 4 - i32.const 16 - i32.add - local.set 2 - local.get 5 - i32.const 16 - i32.add - local.set 1 - end - local.get 3 - i32.const 8 - i32.and - br_if 2 (;@3;) - br 3 (;@2;) - end - local.get 4 - local.get 5 - i32.load - local.tee 2 - i32.store8 - local.get 4 - local.get 2 - i32.const 16 - i32.shr_u - i32.store8 offset=2 - local.get 4 - local.get 2 - i32.const 8 - i32.shr_u - i32.store8 offset=1 - local.get 4 - local.get 5 - i32.const 3 - i32.add - i32.load align=1 - i32.store offset=3 - local.get 4 - local.get 5 - i32.const 7 - i32.add - i64.load align=1 - i64.store offset=7 align=4 - local.get 4 - i32.const 19 - i32.add - local.set 2 - local.get 5 - i32.const 19 - i32.add - local.set 1 - i32.const 15 - local.set 6 - local.get 5 - i32.const 15 - i32.add - i32.load align=1 - local.set 5 - i32.const 13 - local.set 3 - end - local.get 4 - local.get 6 - i32.add - local.get 5 - i32.store - end - local.get 2 - local.get 1 - i64.load align=1 - i64.store align=1 - local.get 2 - i32.const 8 - i32.add - local.set 2 - local.get 1 - i32.const 8 - i32.add - local.set 1 - end - block ;; label = @2 - local.get 3 - i32.const 4 - i32.and - i32.eqz - br_if 0 (;@2;) - local.get 2 - local.get 1 - i32.load align=1 - i32.store align=1 - local.get 2 - i32.const 4 - i32.add - local.set 2 - local.get 1 - i32.const 4 - i32.add - local.set 1 - end - block ;; label = @2 - local.get 3 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@2;) - local.get 2 - local.get 1 - i32.load16_u align=1 - i32.store16 align=1 - local.get 2 - i32.const 2 - i32.add - local.set 2 - local.get 1 - i32.const 2 - i32.add - local.set 1 - end - local.get 3 - i32.const 1 - i32.and - i32.eqz - br_if 0 (;@1;) - local.get 2 - local.get 1 - i32.load8_u - i32.store8 - end - local.get 0 - ) - (table (;0;) 1 1 funcref) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "add" (func $add)) - (export "cabi_realloc" (func $cabi_realloc)) - ) - (core instance (;0;) (instantiate 0)) - (alias core export 0 "memory" (core memory (;0;))) - (alias core export 0 "cabi_realloc" (core func (;0;))) - (type (;0;) (func (param "a" s32) (param "b" s32) (result s32))) - (alias core export 0 "add" (core func (;1;))) - (func (;0;) (type 0) (canon lift (core func 1))) - (export (;1;) "add" (func 0)) -) \ No newline at end of file diff --git a/tests/integration/expected/components/inc_wasm_component.hir b/tests/integration/expected/components/inc_wasm_component.hir deleted file mode 100644 index 4eb1ecd61..000000000 --- a/tests/integration/expected/components/inc_wasm_component.hir +++ /dev/null @@ -1,1099 +0,0 @@ -(component - ;; Component Imports - (lower (("miden:add-package/add-interface@1.0.0" #add) (type (func (abi wasm) (param u32) (param u32) (result u32)))) (#miden:add-package/add-interface@1.0.0 #add) - - ;; Modules - (module #inc_wasm_component - ;; Data Segments - (data (mut) (offset 1048576) 0x0100000002000000) - - ;; Constants - (const (id 0) 0x00100000) - - ;; Global Variables - (global (export #__stack_pointer) (id 0) (type i32) (const 0)) - - ;; Functions - (func (export #__wasm_call_ctors) - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #inc_wasm_component::bindings::__link_custom_section_describing_imports) - - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #__rust_alloc) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048584)) - (let (v4 i32) (call #::alloc v3 v1 v0)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #__rust_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048584)) - (let (v7 i32) (call #::alloc v6 v2 v3)) - (let (v8 i1) (eq v7 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2 v7) (block 3))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v23 i32) - (br (block 1 v23))) - - (block 3 - (let (v11 u32) (bitcast v1)) - (let (v12 u32) (bitcast v3)) - (let (v13 i1) (lt v11 v12)) - (let (v14 i32) (sext v13)) - (let (v15 i1) (neq v14 0)) - (let (v16 i32) (select v15 v1 v3)) - (let (v17 u32) (bitcast v16)) - (let (v18 u32) (bitcast v7)) - (let (v19 (ptr u8)) (inttoptr v18)) - (let (v20 u32) (bitcast v0)) - (let (v21 (ptr u8)) (inttoptr v20)) - (memcpy v21 v19 v17) - (let (v22 i32) (const.i32 1048584)) - (call #::dealloc v22 v0 v2 v1) - (br (block 2 v7))) - ) - - (func (export #inc) (param i32) (result i32) - (block 0 (param v0 i32) - (call #wit_bindgen_rt::run_ctors_once) - (let (v2 i32) (const.i32 1)) - (let (v3 i32) (call (#miden:add-package/add-interface@1.0.0 #add) v0 v2)) - (br (block 1 v3))) - - (block 1 (param v1 i32) - (ret v1)) - ) - - (func (export #wit_bindgen_rt::cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v19 i32) - (br (block 1 v19))) - - (block 3 (param v17 i32) - (let (v18 i1) (neq v17 0)) - (condbr v18 (block 2 v17) (block 7))) - - (block 4 - (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 3 v16))) - - (block 5 - (let (v6 i1) (eq v3 0)) - (let (v7 i32) (zext v6)) - (let (v8 i1) (neq v7 0)) - (condbr v8 (block 2 v2) (block 6))) - - (block 6 - (let (v9 i32) (const.i32 0)) - (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048588)) - (let (v12 (ptr u8)) (inttoptr v11)) - (let (v13 u8) (load v12)) - (let (v14 i32) (zext v13)) - (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 3 v15))) - - (block 7 - (unreachable)) - ) - - (func (export #wit_bindgen_rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048589)) - (let (v3 (ptr u8)) (inttoptr v2)) - (let (v4 u8) (load v3)) - (let (v5 i32) (zext v4)) - (let (v6 i1) (neq v5 0)) - (condbr v6 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (call #__wasm_call_ctors) - (let (v7 i32) (const.i32 0)) - (let (v8 i32) (const.i32 1)) - (let (v9 u32) (bitcast v8)) - (let (v10 u8) (trunc v9)) - (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048589)) - (let (v13 (ptr u8)) (inttoptr v12)) - (store v13 v10) - (br (block 2))) - ) - - (func (export #wee_alloc::alloc_first_fit) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 u32) (bitcast v2)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 i1) (neq v8 0)) - (condbr v9 (block 2) (block 3))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 - (let (v11 i32) (const.i32 -1)) - (let (v12 i32) (add.wrapping v1 v11)) - (let (v13 i32) (const.i32 0)) - (let (v14 i32) (sub.wrapping v13 v1)) - (let (v15 i32) (const.i32 2)) - (let (v16 u32) (bitcast v15)) - (let (v17 i32) (shl.wrapping v0 v16)) - (br (block 4 v8 v2 v17 v14 v12))) - - (block 3 - (let (v10 i32) (const.i32 0)) - (ret v10)) - - (block 4 - (param v18 i32) - (param v169 i32) - (param v182 i32) - (param v197 i32) - (param v210 i32) - (let (v19 u32) (bitcast v18)) - (let (v20 u32) (add.checked v19 8)) - (let (v21 u32) (mod.unchecked v20 4)) - (assertz 250 v21) - (let (v22 (ptr i32)) (inttoptr v20)) - (let (v23 i32) (load v22)) - (let (v24 i32) (const.i32 1)) - (let (v25 i32) (band v23 v24)) - (let (v26 i1) (neq v25 0)) - (condbr v26 (block 7) (block 8))) - - (block 5 - (let (v344 i32) (const.i32 0)) - (br (block 1 v344))) - - (block 6 - (param v172 i32) - (param v179 i32) - (param v181 i32) - (param v196 i32) - (param v209 i32) - (param v218 i32) - (param v219 i32) - (let (v173 u32) (bitcast v172)) - (let (v174 u32) (mod.unchecked v173 4)) - (assertz 250 v174) - (let (v175 (ptr i32)) (inttoptr v173)) - (let (v176 i32) (load v175)) - (let (v177 i32) (const.i32 -4)) - (let (v178 i32) (band v176 v177)) - (let (v180 i32) (sub.wrapping v178 v179)) - (let (v188 u32) (bitcast v180)) - (let (v189 u32) (bitcast v181)) - (let (v190 i1) (lt v188 v189)) - (let (v191 i32) (sext v190)) - (let (v192 i1) (neq v191 0)) - (condbr v192 (block 22 v218 v219 v181 v196 v209) (block 23))) - - (block 7 - (br (block 9 v18 v23 v169 v182 v197 v210))) - - (block 8 - (let (v27 i32) (const.i32 8)) - (let (v28 i32) (add.wrapping v18 v27)) - (br (block 6 v18 v28 v182 v197 v210 v169 v23))) - - (block 9 - (param v29 i32) - (param v30 i32) - (param v156 i32) - (param v187 i32) - (param v202 i32) - (param v215 i32) - (let (v31 i32) (const.i32 -2)) - (let (v32 i32) (band v30 v31)) - (let (v33 u32) (bitcast v29)) - (let (v34 u32) (add.checked v33 8)) - (let (v35 u32) (mod.unchecked v34 4)) - (assertz 250 v35) - (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v32) - (let (v37 u32) (bitcast v29)) - (let (v38 u32) (add.checked v37 4)) - (let (v39 u32) (mod.unchecked v38 4)) - (assertz 250 v39) - (let (v40 (ptr i32)) (inttoptr v38)) - (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 -4)) - (let (v43 i32) (band v41 v42)) - (let (v44 i1) (neq v43 0)) - (condbr v44 (block 12) (block 13))) - - (block 10 - (let (v170 i32) (const.i32 8)) - (let (v171 i32) (add.wrapping v157 v170)) - (br (block 6 v157 v171 v183 v198 v211 v152 v165))) - - (block 11 - (param v55 i32) - (param v75 i32) - (param v122 i32) - (param v142 i32) - (param v155 i32) - (param v186 i32) - (param v201 i32) - (param v214 i32) - (let (v56 u32) (bitcast v55)) - (let (v57 u32) (mod.unchecked v56 4)) - (assertz 250 v57) - (let (v58 (ptr i32)) (inttoptr v56)) - (let (v59 i32) (load v58)) - (let (v60 i32) (const.i32 -4)) - (let (v61 i32) (band v59 v60)) - (let (v62 i1) (eq v61 0)) - (let (v63 i32) (zext v62)) - (let (v64 i1) (neq v63 0)) - (condbr v64 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 15))) - - (block 12 - (let (v46 i32) (const.i32 0)) - (let (v47 u32) (bitcast v43)) - (let (v48 (ptr u8)) (inttoptr v47)) - (let (v49 u8) (load v48)) - (let (v50 i32) (zext v49)) - (let (v51 i32) (const.i32 1)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (neq v52 0)) - (let (v54 i32) (select v53 v46 v43)) - (br (block 11 v29 v43 v41 v54 v156 v187 v202 v215))) - - (block 13 - (let (v45 i32) (const.i32 0)) - (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) - - (block 14 - (param v92 i32) - (param v102 i32) - (param v109 i32) - (param v121 i32) - (param v141 i32) - (param v154 i32) - (param v185 i32) - (param v200 i32) - (param v213 i32) - (let (v93 i1) (eq v92 0)) - (let (v94 i32) (zext v93)) - (let (v95 i1) (neq v94 0)) - (condbr v95 (block 17 v109 v121 v102 v141 v154 v185 v200 v213) (block 18))) - - (block 15 - (let (v65 i32) (const.i32 2)) - (let (v66 i32) (band v59 v65)) - (let (v67 i1) (neq v66 0)) - (condbr v67 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 16))) - - (block 16 - (let (v68 u32) (bitcast v61)) - (let (v69 u32) (add.checked v68 4)) - (let (v70 u32) (mod.unchecked v69 4)) - (assertz 250 v70) - (let (v71 (ptr i32)) (inttoptr v69)) - (let (v72 i32) (load v71)) - (let (v73 i32) (const.i32 3)) - (let (v74 i32) (band v72 v73)) - (let (v76 i32) (bor v74 v75)) - (let (v77 u32) (bitcast v61)) - (let (v78 u32) (add.checked v77 4)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v76) - (let (v81 u32) (bitcast v55)) - (let (v82 u32) (add.checked v81 4)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (let (v85 i32) (load v84)) - (let (v86 i32) (const.i32 -4)) - (let (v87 i32) (band v85 v86)) - (let (v88 u32) (bitcast v55)) - (let (v89 u32) (mod.unchecked v88 4)) - (assertz 250 v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (let (v91 i32) (load v90)) - (br (block 14 v87 v91 v55 v85 v142 v155 v186 v201 v214))) - - (block 17 - (param v119 i32) - (param v120 i32) - (param v129 i32) - (param v140 i32) - (param v153 i32) - (param v184 i32) - (param v199 i32) - (param v212 i32) - (let (v123 i32) (const.i32 3)) - (let (v124 i32) (band v120 v123)) - (let (v125 u32) (bitcast v119)) - (let (v126 u32) (add.checked v125 4)) - (let (v127 u32) (mod.unchecked v126 4)) - (assertz 250 v127) - (let (v128 (ptr i32)) (inttoptr v126)) - (store v128 v124) - (let (v130 i32) (const.i32 3)) - (let (v131 i32) (band v129 v130)) - (let (v132 u32) (bitcast v119)) - (let (v133 u32) (mod.unchecked v132 4)) - (assertz 250 v133) - (let (v134 (ptr i32)) (inttoptr v132)) - (store v134 v131) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v129 v135)) - (let (v137 i1) (eq v136 0)) - (let (v138 i32) (zext v137)) - (let (v139 i1) (neq v138 0)) - (condbr v139 (block 19 v153 v140 v184 v199 v212) (block 20))) - - (block 18 - (let (v96 u32) (bitcast v92)) - (let (v97 u32) (mod.unchecked v96 4)) - (assertz 250 v97) - (let (v98 (ptr i32)) (inttoptr v96)) - (let (v99 i32) (load v98)) - (let (v100 i32) (const.i32 3)) - (let (v101 i32) (band v99 v100)) - (let (v103 i32) (const.i32 -4)) - (let (v104 i32) (band v102 v103)) - (let (v105 i32) (bor v101 v104)) - (let (v106 u32) (bitcast v92)) - (let (v107 u32) (mod.unchecked v106 4)) - (assertz 250 v107) - (let (v108 (ptr i32)) (inttoptr v106)) - (store v108 v105) - (let (v110 u32) (bitcast v109)) - (let (v111 u32) (add.checked v110 4)) - (let (v112 u32) (mod.unchecked v111 4)) - (assertz 250 v112) - (let (v113 (ptr i32)) (inttoptr v111)) - (let (v114 i32) (load v113)) - (let (v115 u32) (bitcast v109)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (let (v118 i32) (load v117)) - (br (block 17 v109 v114 v118 v141 v154 v185 v200 v213))) - - (block 19 - (param v152 i32) - (param v157 i32) - (param v183 i32) - (param v198 i32) - (param v211 i32) - (let (v158 u32) (bitcast v152)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v161 u32) (bitcast v157)) - (let (v162 u32) (add.checked v161 8)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (band v165 v166)) - (let (v168 i1) (neq v167 0)) - (condbr v168 (block 9 v157 v165 v152 v183 v198 v211) (block 21))) - - (block 20 - (let (v143 u32) (bitcast v140)) - (let (v144 u32) (mod.unchecked v143 4)) - (assertz 250 v144) - (let (v145 (ptr i32)) (inttoptr v143)) - (let (v146 i32) (load v145)) - (let (v147 i32) (const.i32 2)) - (let (v148 i32) (bor v146 v147)) - (let (v149 u32) (bitcast v140)) - (let (v150 u32) (mod.unchecked v149 4)) - (assertz 250 v150) - (let (v151 (ptr i32)) (inttoptr v149)) - (store v151 v148) - (br (block 19 v153 v140 v184 v199 v212))) - - (block 21 - (br (block 10))) - - (block 22 - (param v335 i32) - (param v336 i32) - (param v341 i32) - (param v342 i32) - (param v343 i32) - (let (v337 u32) (bitcast v335)) - (let (v338 u32) (mod.unchecked v337 4)) - (assertz 250 v338) - (let (v339 (ptr i32)) (inttoptr v337)) - (store v339 v336) - (let (v340 i1) (neq v336 0)) - (condbr v340 (block 4 v336 v335 v341 v342 v343) (block 33))) - - (block 23 - (let (v193 i32) (const.i32 72)) - (let (v194 i32) (add.wrapping v179 v193)) - (let (v195 i32) (sub.wrapping v178 v181)) - (let (v203 i32) (band v195 v196)) - (let (v204 u32) (bitcast v194)) - (let (v205 u32) (bitcast v203)) - (let (v206 i1) (lte v204 v205)) - (let (v207 i32) (sext v206)) - (let (v208 i1) (neq v207 0)) - (condbr v208 (block 25) (block 26))) - - (block 24 (param v326 i32) (param v327 i32) - (let (v328 i32) (const.i32 1)) - (let (v329 i32) (bor v327 v328)) - (let (v330 u32) (bitcast v326)) - (let (v331 u32) (mod.unchecked v330 4)) - (assertz 250 v331) - (let (v332 (ptr i32)) (inttoptr v330)) - (store v332 v329) - (let (v333 i32) (const.i32 8)) - (let (v334 i32) (add.wrapping v326 v333)) - (ret v334)) - - (block 25 - (let (v229 i32) (const.i32 0)) - (let (v230 i32) (const.i32 0)) - (let (v231 u32) (bitcast v203)) - (let (v232 u32) (mod.unchecked v231 4)) - (assertz 250 v232) - (let (v233 (ptr i32)) (inttoptr v231)) - (store v233 v230) - (let (v234 i32) (const.i32 -8)) - (let (v235 i32) (add.wrapping v203 v234)) - (let (v236 i64) (const.i64 0)) - (let (v237 u32) (bitcast v235)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i64)) (inttoptr v237)) - (store v239 v236) - (let (v240 u32) (bitcast v172)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (let (v244 i32) (const.i32 -4)) - (let (v245 i32) (band v243 v244)) - (let (v246 u32) (bitcast v235)) - (let (v247 u32) (mod.unchecked v246 4)) - (assertz 250 v247) - (let (v248 (ptr i32)) (inttoptr v246)) - (store v248 v245) - (let (v249 u32) (bitcast v172)) - (let (v250 u32) (mod.unchecked v249 4)) - (assertz 250 v250) - (let (v251 (ptr i32)) (inttoptr v249)) - (let (v252 i32) (load v251)) - (let (v253 i32) (const.i32 -4)) - (let (v254 i32) (band v252 v253)) - (let (v255 i1) (eq v254 0)) - (let (v256 i32) (zext v255)) - (let (v257 i1) (neq v256 0)) - (condbr v257 (block 28 v235 v229 v172 v179) (block 29))) - - (block 26 - (let (v216 i32) (band v209 v179)) - (let (v217 i1) (neq v216 0)) - (condbr v217 (block 22 v218 v219 v181 v196 v209) (block 27))) - - (block 27 - (let (v220 i32) (const.i32 -4)) - (let (v221 i32) (band v219 v220)) - (let (v222 u32) (bitcast v218)) - (let (v223 u32) (mod.unchecked v222 4)) - (assertz 250 v223) - (let (v224 (ptr i32)) (inttoptr v222)) - (store v224 v221) - (let (v225 u32) (bitcast v172)) - (let (v226 u32) (mod.unchecked v225 4)) - (assertz 250 v226) - (let (v227 (ptr i32)) (inttoptr v225)) - (let (v228 i32) (load v227)) - (br (block 24 v172 v228))) - - (block 28 - (param v280 i32) - (param v281 i32) - (param v282 i32) - (param v288 i32) - (let (v283 i32) (bor v281 v282)) - (let (v284 u32) (bitcast v280)) - (let (v285 u32) (add.checked v284 4)) - (let (v286 u32) (mod.unchecked v285 4)) - (assertz 250 v286) - (let (v287 (ptr i32)) (inttoptr v285)) - (store v287 v283) - (let (v289 u32) (bitcast v288)) - (let (v290 u32) (mod.unchecked v289 4)) - (assertz 250 v290) - (let (v291 (ptr i32)) (inttoptr v289)) - (let (v292 i32) (load v291)) - (let (v293 i32) (const.i32 -2)) - (let (v294 i32) (band v292 v293)) - (let (v295 u32) (bitcast v288)) - (let (v296 u32) (mod.unchecked v295 4)) - (assertz 250 v296) - (let (v297 (ptr i32)) (inttoptr v295)) - (store v297 v294) - (let (v298 u32) (bitcast v282)) - (let (v299 u32) (mod.unchecked v298 4)) - (assertz 250 v299) - (let (v300 (ptr i32)) (inttoptr v298)) - (let (v301 i32) (load v300)) - (let (v302 i32) (const.i32 3)) - (let (v303 i32) (band v301 v302)) - (let (v304 i32) (bor v303 v280)) - (let (v305 u32) (bitcast v282)) - (let (v306 u32) (mod.unchecked v305 4)) - (assertz 250 v306) - (let (v307 (ptr i32)) (inttoptr v305)) - (store v307 v304) - (let (v308 i32) (const.i32 2)) - (let (v309 i32) (band v301 v308)) - (let (v310 i1) (neq v309 0)) - (condbr v310 (block 31) (block 32))) - - (block 29 - (let (v258 i32) (const.i32 2)) - (let (v259 i32) (band v252 v258)) - (let (v260 i1) (neq v259 0)) - (condbr v260 (block 28 v235 v229 v172 v179) (block 30))) - - (block 30 - (let (v261 u32) (bitcast v254)) - (let (v262 u32) (add.checked v261 4)) - (let (v263 u32) (mod.unchecked v262 4)) - (assertz 250 v263) - (let (v264 (ptr i32)) (inttoptr v262)) - (let (v265 i32) (load v264)) - (let (v266 i32) (const.i32 3)) - (let (v267 i32) (band v265 v266)) - (let (v268 i32) (bor v267 v235)) - (let (v269 u32) (bitcast v254)) - (let (v270 u32) (add.checked v269 4)) - (let (v271 u32) (mod.unchecked v270 4)) - (assertz 250 v271) - (let (v272 (ptr i32)) (inttoptr v270)) - (store v272 v268) - (let (v273 u32) (bitcast v235)) - (let (v274 u32) (add.checked v273 4)) - (let (v275 u32) (mod.unchecked v274 4)) - (assertz 250 v275) - (let (v276 (ptr i32)) (inttoptr v274)) - (let (v277 i32) (load v276)) - (let (v278 i32) (const.i32 3)) - (let (v279 i32) (band v277 v278)) - (br (block 28 v235 v279 v172 v179))) - - (block 31 - (let (v315 i32) (const.i32 -3)) - (let (v316 i32) (band v304 v315)) - (let (v317 u32) (bitcast v282)) - (let (v318 u32) (mod.unchecked v317 4)) - (assertz 250 v318) - (let (v319 (ptr i32)) (inttoptr v317)) - (store v319 v316) - (let (v320 u32) (bitcast v280)) - (let (v321 u32) (mod.unchecked v320 4)) - (assertz 250 v321) - (let (v322 (ptr i32)) (inttoptr v320)) - (let (v323 i32) (load v322)) - (let (v324 i32) (const.i32 2)) - (let (v325 i32) (bor v323 v324)) - (br (block 24 v280 v325))) - - (block 32 - (let (v311 u32) (bitcast v280)) - (let (v312 u32) (mod.unchecked v311 4)) - (assertz 250 v312) - (let (v313 (ptr i32)) (inttoptr v311)) - (let (v314 i32) (load v313)) - (br (block 24 v280 v314))) - - (block 33 - (br (block 5))) - ) - - (func (export #::alloc) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 16)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 i1) (neq v2 0)) - (condbr v9 (block 3) (block 4))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 (param v98 i32) (param v102 i32) - (let (v99 i32) (const.i32 16)) - (let (v100 i32) (add.wrapping v98 v99)) - (let (v101 (ptr i32)) (global.symbol #__stack_pointer)) - (store v101 v100) - (br (block 1 v102))) - - (block 3 - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (let (v13 i32) (load v12)) - (let (v14 u32) (bitcast v7)) - (let (v15 u32) (add.checked v14 12)) - (let (v16 u32) (mod.unchecked v15 4)) - (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (store v17 v13) - (let (v18 i32) (const.i32 3)) - (let (v19 i32) (add.wrapping v2 v18)) - (let (v20 i32) (const.i32 2)) - (let (v21 u32) (bitcast v19)) - (let (v22 u32) (bitcast v20)) - (let (v23 u32) (shr.wrapping v21 v22)) - (let (v24 i32) (bitcast v23)) - (let (v25 i32) (const.i32 12)) - (let (v26 i32) (add.wrapping v7 v25)) - (let (v27 i32) (call #wee_alloc::alloc_first_fit v24 v1 v26)) - (let (v28 i1) (neq v27 0)) - (condbr v28 (block 5 v0 v7 v27) (block 6))) - - (block 4 - (br (block 2 v7 v1))) - - (block 5 (param v88 i32) (param v89 i32) (param v103 i32) - (let (v90 u32) (bitcast v89)) - (let (v91 u32) (add.checked v90 12)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (let (v94 i32) (load v93)) - (let (v95 u32) (bitcast v88)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (store v97 v94) - (br (block 2 v89 v103))) - - (block 6 - (let (v29 i32) (const.i32 -4)) - (let (v30 i32) (band v19 v29)) - (let (v31 i32) (const.i32 3)) - (let (v32 u32) (bitcast v31)) - (let (v33 i32) (shl.wrapping v1 v32)) - (let (v34 i32) (const.i32 512)) - (let (v35 i32) (add.wrapping v33 v34)) - (let (v36 u32) (bitcast v30)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (gt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (let (v41 i32) (select v40 v30 v35)) - (let (v42 i32) (const.i32 65543)) - (let (v43 i32) (add.wrapping v41 v42)) - (let (v44 i32) (const.i32 16)) - (let (v45 u32) (bitcast v43)) - (let (v46 u32) (bitcast v44)) - (let (v47 u32) (shr.wrapping v45 v46)) - (let (v48 i32) (bitcast v47)) - (let (v49 u32) (bitcast v48)) - (let (v50 i32) (memory.grow v49)) - (let (v51 i32) (const.i32 -1)) - (let (v52 i1) (neq v50 v51)) - (let (v53 i32) (zext v52)) - (let (v54 i1) (neq v53 0)) - (condbr v54 (block 7) (block 8))) - - (block 7 - (let (v56 i32) (const.i32 16)) - (let (v57 u32) (bitcast v56)) - (let (v58 i32) (shl.wrapping v50 v57)) - (let (v59 i32) (const.i32 0)) - (let (v60 u32) (bitcast v58)) - (let (v61 u32) (add.checked v60 4)) - (let (v62 u32) (mod.unchecked v61 4)) - (assertz 250 v62) - (let (v63 (ptr i32)) (inttoptr v61)) - (store v63 v59) - (let (v64 u32) (bitcast v7)) - (let (v65 u32) (add.checked v64 12)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v58)) - (let (v70 u32) (add.checked v69 8)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 i32) (const.i32 -65536)) - (let (v74 i32) (band v43 v73)) - (let (v75 i32) (add.wrapping v58 v74)) - (let (v76 i32) (const.i32 2)) - (let (v77 i32) (bor v75 v76)) - (let (v78 u32) (bitcast v58)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v77) - (let (v81 u32) (bitcast v7)) - (let (v82 u32) (add.checked v81 12)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (store v84 v58) - (let (v85 i32) (const.i32 12)) - (let (v86 i32) (add.wrapping v7 v85)) - (let (v87 i32) (call #wee_alloc::alloc_first_fit v24 v1 v86)) - (br (block 5 v0 v7 v87))) - - (block 8 - (let (v55 i32) (const.i32 0)) - (br (block 5 v0 v7 v55))) - ) - - (func (export #::dealloc) - (param i32) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i1) (eq v1 0)) - (let (v6 i32) (zext v5)) - (let (v7 i1) (neq v6 0)) - (condbr v7 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (let (v8 i1) (eq v3 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2) (block 4))) - - (block 4 - (let (v11 u32) (bitcast v0)) - (let (v12 u32) (mod.unchecked v11 4)) - (assertz 250 v12) - (let (v13 (ptr i32)) (inttoptr v11)) - (let (v14 i32) (load v13)) - (let (v15 i32) (const.i32 0)) - (let (v16 u32) (bitcast v1)) - (let (v17 u32) (mod.unchecked v16 4)) - (assertz 250 v17) - (let (v18 (ptr i32)) (inttoptr v16)) - (store v18 v15) - (let (v19 i32) (const.i32 -8)) - (let (v20 i32) (add.wrapping v1 v19)) - (let (v21 u32) (bitcast v20)) - (let (v22 u32) (mod.unchecked v21 4)) - (assertz 250 v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i32) (const.i32 -2)) - (let (v26 i32) (band v24 v25)) - (let (v27 u32) (bitcast v20)) - (let (v28 u32) (mod.unchecked v27 4)) - (assertz 250 v28) - (let (v29 (ptr i32)) (inttoptr v27)) - (store v29 v26) - (let (v30 i32) (const.i32 -4)) - (let (v31 i32) (add.wrapping v1 v30)) - (let (v32 u32) (bitcast v31)) - (let (v33 u32) (mod.unchecked v32 4)) - (assertz 250 v33) - (let (v34 (ptr i32)) (inttoptr v32)) - (let (v35 i32) (load v34)) - (let (v36 i32) (const.i32 -4)) - (let (v37 i32) (band v35 v36)) - (let (v38 i1) (eq v37 0)) - (let (v39 i32) (zext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) - - (block 5 (param v177 i32) (param v183 i32) - (let (v185 u32) (bitcast v177)) - (let (v186 u32) (mod.unchecked v185 4)) - (assertz 250 v186) - (let (v187 (ptr i32)) (inttoptr v185)) - (store v187 v183) - (br (block 2))) - - (block 6 - (param v172 i32) - (param v173 i32) - (param v182 i32) - (param v184 i32) - (let (v174 u32) (bitcast v172)) - (let (v175 u32) (mod.unchecked v174 4)) - (assertz 250 v175) - (let (v176 (ptr i32)) (inttoptr v174)) - (store v176 v173) - (br (block 5 v182 v184))) - - (block 7 (param v168 i32) (param v178 i32) - (br (block 5 v178 v168))) - - (block 8 - (param v134 i32) - (param v150 i32) - (param v161 i32) - (param v171 i32) - (param v181 i32) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v134 v135)) - (let (v137 i1) (neq v136 0)) - (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) - - (block 9 - (let (v41 u32) (bitcast v37)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (let (v44 i32) (load v43)) - (let (v45 i32) (const.i32 1)) - (let (v46 i32) (band v44 v45)) - (let (v47 i1) (neq v46 0)) - (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) - - (block 10 - (let (v48 i32) (const.i32 -4)) - (let (v49 i32) (band v24 v48)) - (let (v50 i1) (neq v49 0)) - (condbr v50 (block 13) (block 14))) - - (block 11 - (param v104 i32) - (param v105 i32) - (param v111 i32) - (param v112 i32) - (param v123 i32) - (param v169 i32) - (param v179 i32) - (let (v106 i32) (const.i32 3)) - (let (v107 i32) (band v105 v106)) - (let (v108 u32) (bitcast v104)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (store v110 v107) - (let (v113 i32) (const.i32 3)) - (let (v114 i32) (band v112 v113)) - (let (v115 u32) (bitcast v111)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (store v117 v114) - (let (v118 i32) (const.i32 2)) - (let (v119 i32) (band v112 v118)) - (let (v120 i1) (eq v119 0)) - (let (v121 i32) (zext v120)) - (let (v122 i1) (neq v121 0)) - (condbr v122 (block 7 v169 v179) (block 17))) - - (block 12 - (param v83 i32) - (param v84 i32) - (param v87 i32) - (param v94 i32) - (param v99 i32) - (param v124 i32) - (param v170 i32) - (param v180 i32) - (let (v85 i32) (const.i32 -4)) - (let (v86 i32) (band v84 v85)) - (let (v88 i32) (const.i32 3)) - (let (v89 i32) (band v87 v88)) - (let (v90 i32) (bor v86 v89)) - (let (v91 u32) (bitcast v83)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (store v93 v90) - (let (v95 u32) (bitcast v94)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (let (v98 i32) (load v97)) - (let (v100 u32) (bitcast v99)) - (let (v101 u32) (mod.unchecked v100 4)) - (assertz 250 v101) - (let (v102 (ptr i32)) (inttoptr v100)) - (let (v103 i32) (load v102)) - (br (block 11 v94 v98 v99 v103 v124 v170 v180))) - - (block 13 - (let (v51 i32) (const.i32 2)) - (let (v52 i32) (band v24 v51)) - (let (v53 i1) (neq v52 0)) - (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) - - (block 14 - (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) - - (block 15 - (let (v54 u32) (bitcast v49)) - (let (v55 u32) (add.checked v54 4)) - (let (v56 u32) (mod.unchecked v55 4)) - (assertz 250 v56) - (let (v57 (ptr i32)) (inttoptr v55)) - (let (v58 i32) (load v57)) - (let (v59 i32) (const.i32 3)) - (let (v60 i32) (band v58 v59)) - (let (v61 i32) (bor v60 v37)) - (let (v62 u32) (bitcast v49)) - (let (v63 u32) (add.checked v62 4)) - (let (v64 u32) (mod.unchecked v63 4)) - (assertz 250 v64) - (let (v65 (ptr i32)) (inttoptr v63)) - (store v65 v61) - (let (v66 u32) (bitcast v20)) - (let (v67 u32) (mod.unchecked v66 4)) - (assertz 250 v67) - (let (v68 (ptr i32)) (inttoptr v66)) - (let (v69 i32) (load v68)) - (let (v70 u32) (bitcast v31)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (let (v74 i32) (const.i32 -4)) - (let (v75 i32) (band v73 v74)) - (let (v76 i1) (eq v75 0)) - (let (v77 i32) (zext v76)) - (let (v78 i1) (neq v77 0)) - (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) - - (block 16 - (let (v79 u32) (bitcast v75)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) - - (block 17 - (let (v125 u32) (bitcast v123)) - (let (v126 u32) (mod.unchecked v125 4)) - (assertz 250 v126) - (let (v127 (ptr i32)) (inttoptr v125)) - (let (v128 i32) (load v127)) - (let (v129 i32) (const.i32 2)) - (let (v130 i32) (bor v128 v129)) - (let (v131 u32) (bitcast v123)) - (let (v132 u32) (mod.unchecked v131 4)) - (assertz 250 v132) - (let (v133 (ptr i32)) (inttoptr v131)) - (store v133 v130) - (br (block 7 v169 v179))) - - (block 18 - (let (v138 i32) (const.i32 -4)) - (let (v139 i32) (band v134 v138)) - (let (v140 i1) (eq v139 0)) - (let (v141 i32) (zext v140)) - (let (v142 i1) (neq v141 0)) - (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) - - (block 19 - (let (v143 u32) (bitcast v139)) - (let (v144 (ptr u8)) (inttoptr v143)) - (let (v145 u8) (load v144)) - (let (v146 i32) (zext v145)) - (let (v147 i32) (const.i32 1)) - (let (v148 i32) (band v146 v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) - - (block 20 - (let (v151 u32) (bitcast v139)) - (let (v152 u32) (add.checked v151 8)) - (let (v153 u32) (mod.unchecked v152 4)) - (assertz 250 v153) - (let (v154 (ptr i32)) (inttoptr v152)) - (let (v155 i32) (load v154)) - (let (v156 i32) (const.i32 -4)) - (let (v157 i32) (band v155 v156)) - (let (v158 u32) (bitcast v150)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v162 i32) (const.i32 1)) - (let (v163 i32) (bor v161 v162)) - (let (v164 u32) (bitcast v139)) - (let (v165 u32) (add.checked v164 8)) - (let (v166 u32) (mod.unchecked v165 4)) - (assertz 250 v166) - (let (v167 (ptr i32)) (inttoptr v165)) - (store v167 v163) - (br (block 7 v171 v181))) - ) - - (func (export #cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) - (br (block 1 v5))) - - (block 1 (param v4 i32) - (ret v4)) - ) - - ;; Imports - (func (import #miden:add-package/add-interface@1.0.0 #add) - (param i32) (param i32) (result i32)) - ) - -) diff --git a/tests/integration/expected/components/inc_wasm_component.wat b/tests/integration/expected/components/inc_wasm_component.wat deleted file mode 100644 index 1e52129d8..000000000 --- a/tests/integration/expected/components/inc_wasm_component.wat +++ /dev/null @@ -1,707 +0,0 @@ -(component - (type (;0;) - (instance - (type (;0;) (func (param "a" u32) (param "b" u32) (result u32))) - (export (;0;) "add" (func (type 0))) - ) - ) - (import "miden:add-package/add-interface@1.0.0" (instance (;0;) (type 0))) - (core module (;0;) - (type (;0;) (func (param i32 i32) (result i32))) - (type (;1;) (func)) - (type (;2;) (func (param i32 i32 i32 i32) (result i32))) - (type (;3;) (func (param i32) (result i32))) - (type (;4;) (func (param i32 i32 i32) (result i32))) - (type (;5;) (func (param i32 i32 i32 i32))) - (import "miden:add-package/add-interface@1.0.0" "add" (func $inc_wasm_component::bindings::miden::add_package::add_interface::add::wit_import (;0;) (type 0))) - (func $__wasm_call_ctors (;1;) (type 1)) - (func $inc_wasm_component::bindings::__link_custom_section_describing_imports (;2;) (type 1)) - (func $__rust_alloc (;3;) (type 0) (param i32 i32) (result i32) - i32.const 1048584 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;4;) (type 2) (param i32 i32 i32 i32) (result i32) - (local i32) - block ;; label = @1 - i32.const 1048584 - local.get 2 - local.get 3 - call $::alloc - local.tee 4 - i32.eqz - br_if 0 (;@1;) - local.get 4 - local.get 0 - local.get 1 - local.get 3 - local.get 1 - local.get 3 - i32.lt_u - select - memory.copy - i32.const 1048584 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc - end - local.get 4 - ) - (func $inc (;5;) (type 3) (param i32) (result i32) - call $wit_bindgen_rt::run_ctors_once - local.get 0 - i32.const 1 - call $inc_wasm_component::bindings::miden::add_package::add_interface::add::wit_import - ) - (func $wit_bindgen_rt::cabi_realloc (;6;) (type 2) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 1 - br_if 0 (;@3;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - i32.const 0 - i32.load8_u offset=1048588 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@2;) - end - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rust_realloc - local.set 2 - end - local.get 2 - br_if 0 (;@1;) - unreachable - end - local.get 2 - ) - (func $wit_bindgen_rt::run_ctors_once (;7;) (type 1) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048589 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048589 - end - ) - (func $wee_alloc::alloc_first_fit (;8;) (type 4) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 2 - i32.load - local.tee 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 1 - i32.const -1 - i32.add - local.set 4 - i32.const 0 - local.get 1 - i32.sub - local.set 5 - local.get 0 - i32.const 2 - i32.shl - local.set 6 - loop ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - local.get 3 - i32.const 8 - i32.add - local.set 0 - br 1 (;@2;) - end - loop ;; label = @3 - local.get 3 - local.get 1 - i32.const -2 - i32.and - i32.store offset=8 - block ;; label = @4 - block ;; label = @5 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@5;) - i32.const 0 - local.set 8 - br 1 (;@4;) - end - i32.const 0 - local.get 0 - local.get 0 - i32.load8_u - i32.const 1 - i32.and - select - local.set 8 - end - block ;; label = @4 - local.get 3 - i32.load - local.tee 1 - i32.const -4 - i32.and - local.tee 9 - i32.eqz - br_if 0 (;@4;) - local.get 1 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 9 - local.get 9 - i32.load offset=4 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.set 0 - local.get 3 - i32.load - local.set 1 - end - block ;; label = @4 - local.get 0 - i32.eqz - br_if 0 (;@4;) - local.get 0 - local.get 0 - i32.load - i32.const 3 - i32.and - local.get 1 - i32.const -4 - i32.and - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 1 - end - local.get 3 - local.get 7 - i32.const 3 - i32.and - i32.store offset=4 - local.get 3 - local.get 1 - i32.const 3 - i32.and - i32.store - block ;; label = @4 - local.get 1 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 - local.get 8 - i32.store - local.get 8 - local.set 3 - local.get 8 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - end - local.get 8 - i32.const 8 - i32.add - local.set 0 - local.get 8 - local.set 3 - end - block ;; label = @2 - local.get 3 - i32.load - i32.const -4 - i32.and - local.tee 8 - local.get 0 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.const 72 - i32.add - local.get 8 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 8 - i32.le_u - br_if 0 (;@4;) - local.get 4 - local.get 0 - i32.and - br_if 2 (;@2;) - local.get 2 - local.get 1 - i32.const -4 - i32.and - i32.store - local.get 3 - i32.load - local.set 0 - local.get 3 - local.set 1 - br 1 (;@3;) - end - i32.const 0 - local.set 7 - local.get 8 - i32.const 0 - i32.store - local.get 8 - i32.const -8 - i32.add - local.tee 1 - i64.const 0 - i64.store align=4 - local.get 1 - local.get 3 - i32.load - i32.const -4 - i32.and - i32.store - block ;; label = @4 - local.get 3 - i32.load - local.tee 9 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@4;) - local.get 9 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 1 - i32.load offset=4 - i32.const 3 - i32.and - local.set 7 - end - local.get 1 - local.get 7 - local.get 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 0 - i32.load - i32.const -2 - i32.and - i32.store - local.get 3 - local.get 3 - i32.load - local.tee 0 - i32.const 3 - i32.and - local.get 1 - i32.or - local.tee 8 - i32.store - block ;; label = @4 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 1 - i32.load - local.set 0 - br 1 (;@3;) - end - local.get 3 - local.get 8 - i32.const -3 - i32.and - i32.store - local.get 1 - i32.load - i32.const 2 - i32.or - local.set 0 - end - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store - local.get 1 - i32.const 8 - i32.add - return - end - local.get 2 - local.get 1 - i32.store - local.get 1 - local.set 3 - local.get 1 - br_if 0 (;@1;) - end - i32.const 0 - ) - (func $::alloc (;9;) (type 4) (param i32 i32 i32) (result i32) - (local i32 i32 i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 3 - global.set $__stack_pointer - block ;; label = @1 - block ;; label = @2 - local.get 2 - br_if 0 (;@2;) - local.get 1 - local.set 2 - br 1 (;@1;) - end - local.get 3 - local.get 0 - i32.load - i32.store offset=12 - block ;; label = @2 - local.get 2 - i32.const 3 - i32.add - local.tee 4 - i32.const 2 - i32.shr_u - local.tee 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.tee 2 - br_if 0 (;@2;) - block ;; label = @3 - local.get 4 - i32.const -4 - i32.and - local.tee 2 - local.get 1 - i32.const 3 - i32.shl - i32.const 512 - i32.add - local.tee 4 - local.get 2 - local.get 4 - i32.gt_u - select - i32.const 65543 - i32.add - local.tee 4 - i32.const 16 - i32.shr_u - memory.grow - local.tee 2 - i32.const -1 - i32.ne - br_if 0 (;@3;) - i32.const 0 - local.set 2 - br 1 (;@2;) - end - local.get 2 - i32.const 16 - i32.shl - local.tee 2 - i32.const 0 - i32.store offset=4 - local.get 2 - local.get 3 - i32.load offset=12 - i32.store offset=8 - local.get 2 - local.get 2 - local.get 4 - i32.const -65536 - i32.and - i32.add - i32.const 2 - i32.or - i32.store - local.get 3 - local.get 2 - i32.store offset=12 - local.get 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.set 2 - end - local.get 0 - local.get 3 - i32.load offset=12 - i32.store - end - local.get 3 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 2 - ) - (func $::dealloc (;10;) (type 5) (param i32 i32 i32 i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 1 - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.eqz - br_if 0 (;@1;) - local.get 0 - i32.load - local.set 4 - local.get 1 - i32.const 0 - i32.store - local.get 1 - i32.const -8 - i32.add - local.tee 3 - local.get 3 - i32.load - local.tee 5 - i32.const -2 - i32.and - local.tee 6 - i32.store - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - local.get 1 - i32.const -4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - br_if 0 (;@5;) - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 5 - i32.const -4 - i32.and - local.tee 10 - br_if 0 (;@8;) - local.get 8 - local.set 1 - br 1 (;@7;) - end - local.get 8 - local.set 1 - local.get 5 - i32.const 2 - i32.and - br_if 0 (;@7;) - local.get 10 - local.get 10 - i32.load offset=4 - i32.const 3 - i32.and - local.get 8 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 6 - local.get 7 - i32.load - local.tee 5 - i32.const -4 - i32.and - local.tee 1 - i32.eqz - br_if 1 (;@6;) - local.get 1 - i32.load - local.set 9 - end - local.get 1 - local.get 6 - i32.const -4 - i32.and - local.get 9 - i32.const 3 - i32.and - i32.or - i32.store - local.get 7 - i32.load - local.set 5 - local.get 3 - i32.load - local.set 6 - end - local.get 7 - local.get 5 - i32.const 3 - i32.and - i32.store - local.get 3 - local.get 6 - i32.const 3 - i32.and - i32.store - local.get 6 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - br 1 (;@4;) - end - local.get 5 - i32.const 2 - i32.and - br_if 1 (;@3;) - local.get 5 - i32.const -4 - i32.and - local.tee 5 - i32.eqz - br_if 1 (;@3;) - local.get 5 - i32.load8_u - i32.const 1 - i32.and - br_if 1 (;@3;) - local.get 1 - local.get 5 - i32.load offset=8 - i32.const -4 - i32.and - i32.store - local.get 5 - local.get 3 - i32.const 1 - i32.or - i32.store offset=8 - end - local.get 4 - local.set 3 - br 1 (;@2;) - end - local.get 1 - local.get 4 - i32.store - end - local.get 0 - local.get 3 - i32.store - end - ) - (func $cabi_realloc (;11;) (type 2) (param i32 i32 i32 i32) (result i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $wit_bindgen_rt::cabi_realloc - ) - (table (;0;) 3 3 funcref) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "inc" (func $inc)) - (export "cabi_realloc" (func $cabi_realloc)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $inc_wasm_component::bindings::__link_custom_section_describing_imports $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\02\00\00\00") - ) - (alias export 0 "add" (func (;0;))) - (core func (;0;) (canon lower (func 0))) - (core instance (;0;) - (export "add" (func 0)) - ) - (core instance (;1;) (instantiate 0 - (with "miden:add-package/add-interface@1.0.0" (instance 0)) - ) - ) - (alias core export 1 "memory" (core memory (;0;))) - (alias core export 1 "cabi_realloc" (core func (;1;))) - (type (;1;) (func (param "a" u32) (result u32))) - (alias core export 1 "inc" (core func (;2;))) - (func (;1;) (type 1) (canon lift (core func 2))) - (export (;2;) "inc" (func 1)) -) \ No newline at end of file diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir deleted file mode 100644 index a1e883b3e..000000000 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir +++ /dev/null @@ -1,1206 +0,0 @@ -(component - ;; Component Imports - (lower (("miden:base/account@1.0.0" #add-asset) (type (func (abi wasm) (param (struct (struct (struct u64) (struct u64) (struct u64) (struct u64)))) (result (struct (struct (struct u64) (struct u64) (struct u64) (struct u64))))))) (# #0) - (lower (("miden:base/account@1.0.0" #remove-asset) (type (func (abi wasm) (param (struct (struct (struct u64) (struct u64) (struct u64) (struct u64)))) (result (struct (struct (struct u64) (struct u64) (struct u64) (struct u64))))))) (# #1) - (lower (("miden:base/tx@1.0.0" #create-note) (type (func (abi wasm) (param (struct (struct (struct u64) (struct u64) (struct u64) (struct u64)))) (param (struct (struct u64))) (param (struct (struct (struct u64) (struct u64) (struct u64) (struct u64)))) (result (struct (struct u64)))))) (#miden:base/tx@1.0.0 #create_note) - - ;; Modules - (module #wit-component:shim - ;; Functions - (func (export #indirect-miden:base/account@1.0.0-add-asset) - (param i64) (param i64) (param i64) (param i64) (param i32) - (block 0 - (param v0 i64) - (param v1 i64) - (param v2 i64) - (param v3 i64) - (param v4 i32) - (let (v5 i32) (const.i32 0)) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #indirect-miden:base/account@1.0.0-remove-asset) - (param i64) (param i64) (param i64) (param i64) (param i32) - (block 0 - (param v0 i64) - (param v1 i64) - (param v2 i64) - (param v3 i64) - (param v4 i32) - (let (v5 i32) (const.i32 1)) - (br (block 1))) - - (block 1 - (ret)) - ) - ) - - (module #basic_wallet - ;; Data Segments - (data (mut) (offset 1048576) 0x0100000001000000010000000100000002000000) - - ;; Constants - (const (id 0) 0x00100000) - - ;; Global Variables - (global (export #__stack_pointer) (id 0) (type i32) (const 0)) - - ;; Functions - (func (export #__wasm_call_ctors) - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #basic_wallet::bindings::__link_custom_section_describing_imports) - - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #__rust_alloc) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048596)) - (let (v4 i32) (call #::alloc v3 v1 v0)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #__rust_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048596)) - (let (v7 i32) (call #::alloc v6 v2 v3)) - (let (v8 i1) (eq v7 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2 v7) (block 3))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v23 i32) - (br (block 1 v23))) - - (block 3 - (let (v11 u32) (bitcast v1)) - (let (v12 u32) (bitcast v3)) - (let (v13 i1) (lt v11 v12)) - (let (v14 i32) (sext v13)) - (let (v15 i1) (neq v14 0)) - (let (v16 i32) (select v15 v1 v3)) - (let (v17 u32) (bitcast v16)) - (let (v18 u32) (bitcast v7)) - (let (v19 (ptr u8)) (inttoptr v18)) - (let (v20 u32) (bitcast v0)) - (let (v21 (ptr u8)) (inttoptr v20)) - (memcpy v21 v19 v17) - (let (v22 i32) (const.i32 1048596)) - (call #::dealloc v22 v0 v2 v1) - (br (block 2 v7))) - ) - - (func (export #miden:basic-wallet/basic-wallet@1.0.0#receive-asset) - (param i64) (param i64) (param i64) (param i64) - (block 0 (param v0 i64) (param v1 i64) (param v2 i64) (param v3 i64) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 32)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (call #wit_bindgen_rt::run_ctors_once) - (call (#wit-component:shim #indirect-miden:base/account@1.0.0-add-asset) v0 v1 v2 v3 v7) - (let (v9 i32) (const.i32 32)) - (let (v10 i32) (add.wrapping v7 v9)) - (let (v11 (ptr i32)) (global.symbol #__stack_pointer)) - (store v11 v10) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #miden:basic-wallet/basic-wallet@1.0.0#send-asset) - (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) - (block 0 - (param v0 i64) - (param v1 i64) - (param v2 i64) - (param v3 i64) - (param v4 i64) - (param v5 i64) - (param v6 i64) - (param v7 i64) - (param v8 i64) - (let (v9 i32) (const.i32 0)) - (let (v10 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v11 i32) (const.i32 32)) - (let (v12 i32) (sub.wrapping v10 v11)) - (let (v13 (ptr i32)) (global.symbol #__stack_pointer)) - (store v13 v12) - (call #wit_bindgen_rt::run_ctors_once) - (call (#wit-component:shim #indirect-miden:base/account@1.0.0-remove-asset) v0 v1 v2 v3 v12) - (let (v14 u32) (bitcast v12)) - (let (v15 u32) (mod.unchecked v14 8)) - (assertz 250 v15) - (let (v16 (ptr i64)) (inttoptr v14)) - (let (v17 i64) (load v16)) - (let (v18 u32) (bitcast v12)) - (let (v19 u32) (add.checked v18 8)) - (let (v20 u32) (mod.unchecked v19 8)) - (assertz 250 v20) - (let (v21 (ptr i64)) (inttoptr v19)) - (let (v22 i64) (load v21)) - (let (v23 u32) (bitcast v12)) - (let (v24 u32) (add.checked v23 16)) - (let (v25 u32) (mod.unchecked v24 8)) - (assertz 250 v25) - (let (v26 (ptr i64)) (inttoptr v24)) - (let (v27 i64) (load v26)) - (let (v28 u32) (bitcast v12)) - (let (v29 u32) (add.checked v28 24)) - (let (v30 u32) (mod.unchecked v29 8)) - (assertz 250 v30) - (let (v31 (ptr i64)) (inttoptr v29)) - (let (v32 i64) (load v31)) - (let (v33 i64) (call (#miden:base/tx@1.0.0 #create_note) v17 v22 v27 v32 v4 v5 v6 v7 v8)) - (let (v34 i32) (const.i32 32)) - (let (v35 i32) (add.wrapping v12 v34)) - (let (v36 (ptr i32)) (global.symbol #__stack_pointer)) - (store v36 v35) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #wit_bindgen_rt::cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v19 i32) - (br (block 1 v19))) - - (block 3 (param v17 i32) - (let (v18 i1) (neq v17 0)) - (condbr v18 (block 2 v17) (block 7))) - - (block 4 - (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 3 v16))) - - (block 5 - (let (v6 i1) (eq v3 0)) - (let (v7 i32) (zext v6)) - (let (v8 i1) (neq v7 0)) - (condbr v8 (block 2 v2) (block 6))) - - (block 6 - (let (v9 i32) (const.i32 0)) - (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048600)) - (let (v12 (ptr u8)) (inttoptr v11)) - (let (v13 u8) (load v12)) - (let (v14 i32) (zext v13)) - (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 3 v15))) - - (block 7 - (unreachable)) - ) - - (func (export #wit_bindgen_rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048601)) - (let (v3 (ptr u8)) (inttoptr v2)) - (let (v4 u8) (load v3)) - (let (v5 i32) (zext v4)) - (let (v6 i1) (neq v5 0)) - (condbr v6 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (call #__wasm_call_ctors) - (let (v7 i32) (const.i32 0)) - (let (v8 i32) (const.i32 1)) - (let (v9 u32) (bitcast v8)) - (let (v10 u8) (trunc v9)) - (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048601)) - (let (v13 (ptr u8)) (inttoptr v12)) - (store v13 v10) - (br (block 2))) - ) - - (func (export #wee_alloc::alloc_first_fit) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 u32) (bitcast v2)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 i1) (neq v8 0)) - (condbr v9 (block 2) (block 3))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 - (let (v11 i32) (const.i32 -1)) - (let (v12 i32) (add.wrapping v1 v11)) - (let (v13 i32) (const.i32 0)) - (let (v14 i32) (sub.wrapping v13 v1)) - (let (v15 i32) (const.i32 2)) - (let (v16 u32) (bitcast v15)) - (let (v17 i32) (shl.wrapping v0 v16)) - (br (block 4 v8 v2 v17 v14 v12))) - - (block 3 - (let (v10 i32) (const.i32 0)) - (ret v10)) - - (block 4 - (param v18 i32) - (param v169 i32) - (param v182 i32) - (param v197 i32) - (param v210 i32) - (let (v19 u32) (bitcast v18)) - (let (v20 u32) (add.checked v19 8)) - (let (v21 u32) (mod.unchecked v20 4)) - (assertz 250 v21) - (let (v22 (ptr i32)) (inttoptr v20)) - (let (v23 i32) (load v22)) - (let (v24 i32) (const.i32 1)) - (let (v25 i32) (band v23 v24)) - (let (v26 i1) (neq v25 0)) - (condbr v26 (block 7) (block 8))) - - (block 5 - (let (v344 i32) (const.i32 0)) - (br (block 1 v344))) - - (block 6 - (param v172 i32) - (param v179 i32) - (param v181 i32) - (param v196 i32) - (param v209 i32) - (param v218 i32) - (param v219 i32) - (let (v173 u32) (bitcast v172)) - (let (v174 u32) (mod.unchecked v173 4)) - (assertz 250 v174) - (let (v175 (ptr i32)) (inttoptr v173)) - (let (v176 i32) (load v175)) - (let (v177 i32) (const.i32 -4)) - (let (v178 i32) (band v176 v177)) - (let (v180 i32) (sub.wrapping v178 v179)) - (let (v188 u32) (bitcast v180)) - (let (v189 u32) (bitcast v181)) - (let (v190 i1) (lt v188 v189)) - (let (v191 i32) (sext v190)) - (let (v192 i1) (neq v191 0)) - (condbr v192 (block 22 v218 v219 v181 v196 v209) (block 23))) - - (block 7 - (br (block 9 v18 v23 v169 v182 v197 v210))) - - (block 8 - (let (v27 i32) (const.i32 8)) - (let (v28 i32) (add.wrapping v18 v27)) - (br (block 6 v18 v28 v182 v197 v210 v169 v23))) - - (block 9 - (param v29 i32) - (param v30 i32) - (param v156 i32) - (param v187 i32) - (param v202 i32) - (param v215 i32) - (let (v31 i32) (const.i32 -2)) - (let (v32 i32) (band v30 v31)) - (let (v33 u32) (bitcast v29)) - (let (v34 u32) (add.checked v33 8)) - (let (v35 u32) (mod.unchecked v34 4)) - (assertz 250 v35) - (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v32) - (let (v37 u32) (bitcast v29)) - (let (v38 u32) (add.checked v37 4)) - (let (v39 u32) (mod.unchecked v38 4)) - (assertz 250 v39) - (let (v40 (ptr i32)) (inttoptr v38)) - (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 -4)) - (let (v43 i32) (band v41 v42)) - (let (v44 i1) (neq v43 0)) - (condbr v44 (block 12) (block 13))) - - (block 10 - (let (v170 i32) (const.i32 8)) - (let (v171 i32) (add.wrapping v157 v170)) - (br (block 6 v157 v171 v183 v198 v211 v152 v165))) - - (block 11 - (param v55 i32) - (param v75 i32) - (param v122 i32) - (param v142 i32) - (param v155 i32) - (param v186 i32) - (param v201 i32) - (param v214 i32) - (let (v56 u32) (bitcast v55)) - (let (v57 u32) (mod.unchecked v56 4)) - (assertz 250 v57) - (let (v58 (ptr i32)) (inttoptr v56)) - (let (v59 i32) (load v58)) - (let (v60 i32) (const.i32 -4)) - (let (v61 i32) (band v59 v60)) - (let (v62 i1) (eq v61 0)) - (let (v63 i32) (zext v62)) - (let (v64 i1) (neq v63 0)) - (condbr v64 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 15))) - - (block 12 - (let (v46 i32) (const.i32 0)) - (let (v47 u32) (bitcast v43)) - (let (v48 (ptr u8)) (inttoptr v47)) - (let (v49 u8) (load v48)) - (let (v50 i32) (zext v49)) - (let (v51 i32) (const.i32 1)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (neq v52 0)) - (let (v54 i32) (select v53 v46 v43)) - (br (block 11 v29 v43 v41 v54 v156 v187 v202 v215))) - - (block 13 - (let (v45 i32) (const.i32 0)) - (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) - - (block 14 - (param v92 i32) - (param v102 i32) - (param v109 i32) - (param v121 i32) - (param v141 i32) - (param v154 i32) - (param v185 i32) - (param v200 i32) - (param v213 i32) - (let (v93 i1) (eq v92 0)) - (let (v94 i32) (zext v93)) - (let (v95 i1) (neq v94 0)) - (condbr v95 (block 17 v109 v121 v102 v141 v154 v185 v200 v213) (block 18))) - - (block 15 - (let (v65 i32) (const.i32 2)) - (let (v66 i32) (band v59 v65)) - (let (v67 i1) (neq v66 0)) - (condbr v67 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 16))) - - (block 16 - (let (v68 u32) (bitcast v61)) - (let (v69 u32) (add.checked v68 4)) - (let (v70 u32) (mod.unchecked v69 4)) - (assertz 250 v70) - (let (v71 (ptr i32)) (inttoptr v69)) - (let (v72 i32) (load v71)) - (let (v73 i32) (const.i32 3)) - (let (v74 i32) (band v72 v73)) - (let (v76 i32) (bor v74 v75)) - (let (v77 u32) (bitcast v61)) - (let (v78 u32) (add.checked v77 4)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v76) - (let (v81 u32) (bitcast v55)) - (let (v82 u32) (add.checked v81 4)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (let (v85 i32) (load v84)) - (let (v86 i32) (const.i32 -4)) - (let (v87 i32) (band v85 v86)) - (let (v88 u32) (bitcast v55)) - (let (v89 u32) (mod.unchecked v88 4)) - (assertz 250 v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (let (v91 i32) (load v90)) - (br (block 14 v87 v91 v55 v85 v142 v155 v186 v201 v214))) - - (block 17 - (param v119 i32) - (param v120 i32) - (param v129 i32) - (param v140 i32) - (param v153 i32) - (param v184 i32) - (param v199 i32) - (param v212 i32) - (let (v123 i32) (const.i32 3)) - (let (v124 i32) (band v120 v123)) - (let (v125 u32) (bitcast v119)) - (let (v126 u32) (add.checked v125 4)) - (let (v127 u32) (mod.unchecked v126 4)) - (assertz 250 v127) - (let (v128 (ptr i32)) (inttoptr v126)) - (store v128 v124) - (let (v130 i32) (const.i32 3)) - (let (v131 i32) (band v129 v130)) - (let (v132 u32) (bitcast v119)) - (let (v133 u32) (mod.unchecked v132 4)) - (assertz 250 v133) - (let (v134 (ptr i32)) (inttoptr v132)) - (store v134 v131) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v129 v135)) - (let (v137 i1) (eq v136 0)) - (let (v138 i32) (zext v137)) - (let (v139 i1) (neq v138 0)) - (condbr v139 (block 19 v153 v140 v184 v199 v212) (block 20))) - - (block 18 - (let (v96 u32) (bitcast v92)) - (let (v97 u32) (mod.unchecked v96 4)) - (assertz 250 v97) - (let (v98 (ptr i32)) (inttoptr v96)) - (let (v99 i32) (load v98)) - (let (v100 i32) (const.i32 3)) - (let (v101 i32) (band v99 v100)) - (let (v103 i32) (const.i32 -4)) - (let (v104 i32) (band v102 v103)) - (let (v105 i32) (bor v101 v104)) - (let (v106 u32) (bitcast v92)) - (let (v107 u32) (mod.unchecked v106 4)) - (assertz 250 v107) - (let (v108 (ptr i32)) (inttoptr v106)) - (store v108 v105) - (let (v110 u32) (bitcast v109)) - (let (v111 u32) (add.checked v110 4)) - (let (v112 u32) (mod.unchecked v111 4)) - (assertz 250 v112) - (let (v113 (ptr i32)) (inttoptr v111)) - (let (v114 i32) (load v113)) - (let (v115 u32) (bitcast v109)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (let (v118 i32) (load v117)) - (br (block 17 v109 v114 v118 v141 v154 v185 v200 v213))) - - (block 19 - (param v152 i32) - (param v157 i32) - (param v183 i32) - (param v198 i32) - (param v211 i32) - (let (v158 u32) (bitcast v152)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v161 u32) (bitcast v157)) - (let (v162 u32) (add.checked v161 8)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (band v165 v166)) - (let (v168 i1) (neq v167 0)) - (condbr v168 (block 9 v157 v165 v152 v183 v198 v211) (block 21))) - - (block 20 - (let (v143 u32) (bitcast v140)) - (let (v144 u32) (mod.unchecked v143 4)) - (assertz 250 v144) - (let (v145 (ptr i32)) (inttoptr v143)) - (let (v146 i32) (load v145)) - (let (v147 i32) (const.i32 2)) - (let (v148 i32) (bor v146 v147)) - (let (v149 u32) (bitcast v140)) - (let (v150 u32) (mod.unchecked v149 4)) - (assertz 250 v150) - (let (v151 (ptr i32)) (inttoptr v149)) - (store v151 v148) - (br (block 19 v153 v140 v184 v199 v212))) - - (block 21 - (br (block 10))) - - (block 22 - (param v335 i32) - (param v336 i32) - (param v341 i32) - (param v342 i32) - (param v343 i32) - (let (v337 u32) (bitcast v335)) - (let (v338 u32) (mod.unchecked v337 4)) - (assertz 250 v338) - (let (v339 (ptr i32)) (inttoptr v337)) - (store v339 v336) - (let (v340 i1) (neq v336 0)) - (condbr v340 (block 4 v336 v335 v341 v342 v343) (block 33))) - - (block 23 - (let (v193 i32) (const.i32 72)) - (let (v194 i32) (add.wrapping v179 v193)) - (let (v195 i32) (sub.wrapping v178 v181)) - (let (v203 i32) (band v195 v196)) - (let (v204 u32) (bitcast v194)) - (let (v205 u32) (bitcast v203)) - (let (v206 i1) (lte v204 v205)) - (let (v207 i32) (sext v206)) - (let (v208 i1) (neq v207 0)) - (condbr v208 (block 25) (block 26))) - - (block 24 (param v326 i32) (param v327 i32) - (let (v328 i32) (const.i32 1)) - (let (v329 i32) (bor v327 v328)) - (let (v330 u32) (bitcast v326)) - (let (v331 u32) (mod.unchecked v330 4)) - (assertz 250 v331) - (let (v332 (ptr i32)) (inttoptr v330)) - (store v332 v329) - (let (v333 i32) (const.i32 8)) - (let (v334 i32) (add.wrapping v326 v333)) - (ret v334)) - - (block 25 - (let (v229 i32) (const.i32 0)) - (let (v230 i32) (const.i32 0)) - (let (v231 u32) (bitcast v203)) - (let (v232 u32) (mod.unchecked v231 4)) - (assertz 250 v232) - (let (v233 (ptr i32)) (inttoptr v231)) - (store v233 v230) - (let (v234 i32) (const.i32 -8)) - (let (v235 i32) (add.wrapping v203 v234)) - (let (v236 i64) (const.i64 0)) - (let (v237 u32) (bitcast v235)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i64)) (inttoptr v237)) - (store v239 v236) - (let (v240 u32) (bitcast v172)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (let (v244 i32) (const.i32 -4)) - (let (v245 i32) (band v243 v244)) - (let (v246 u32) (bitcast v235)) - (let (v247 u32) (mod.unchecked v246 4)) - (assertz 250 v247) - (let (v248 (ptr i32)) (inttoptr v246)) - (store v248 v245) - (let (v249 u32) (bitcast v172)) - (let (v250 u32) (mod.unchecked v249 4)) - (assertz 250 v250) - (let (v251 (ptr i32)) (inttoptr v249)) - (let (v252 i32) (load v251)) - (let (v253 i32) (const.i32 -4)) - (let (v254 i32) (band v252 v253)) - (let (v255 i1) (eq v254 0)) - (let (v256 i32) (zext v255)) - (let (v257 i1) (neq v256 0)) - (condbr v257 (block 28 v235 v229 v172 v179) (block 29))) - - (block 26 - (let (v216 i32) (band v209 v179)) - (let (v217 i1) (neq v216 0)) - (condbr v217 (block 22 v218 v219 v181 v196 v209) (block 27))) - - (block 27 - (let (v220 i32) (const.i32 -4)) - (let (v221 i32) (band v219 v220)) - (let (v222 u32) (bitcast v218)) - (let (v223 u32) (mod.unchecked v222 4)) - (assertz 250 v223) - (let (v224 (ptr i32)) (inttoptr v222)) - (store v224 v221) - (let (v225 u32) (bitcast v172)) - (let (v226 u32) (mod.unchecked v225 4)) - (assertz 250 v226) - (let (v227 (ptr i32)) (inttoptr v225)) - (let (v228 i32) (load v227)) - (br (block 24 v172 v228))) - - (block 28 - (param v280 i32) - (param v281 i32) - (param v282 i32) - (param v288 i32) - (let (v283 i32) (bor v281 v282)) - (let (v284 u32) (bitcast v280)) - (let (v285 u32) (add.checked v284 4)) - (let (v286 u32) (mod.unchecked v285 4)) - (assertz 250 v286) - (let (v287 (ptr i32)) (inttoptr v285)) - (store v287 v283) - (let (v289 u32) (bitcast v288)) - (let (v290 u32) (mod.unchecked v289 4)) - (assertz 250 v290) - (let (v291 (ptr i32)) (inttoptr v289)) - (let (v292 i32) (load v291)) - (let (v293 i32) (const.i32 -2)) - (let (v294 i32) (band v292 v293)) - (let (v295 u32) (bitcast v288)) - (let (v296 u32) (mod.unchecked v295 4)) - (assertz 250 v296) - (let (v297 (ptr i32)) (inttoptr v295)) - (store v297 v294) - (let (v298 u32) (bitcast v282)) - (let (v299 u32) (mod.unchecked v298 4)) - (assertz 250 v299) - (let (v300 (ptr i32)) (inttoptr v298)) - (let (v301 i32) (load v300)) - (let (v302 i32) (const.i32 3)) - (let (v303 i32) (band v301 v302)) - (let (v304 i32) (bor v303 v280)) - (let (v305 u32) (bitcast v282)) - (let (v306 u32) (mod.unchecked v305 4)) - (assertz 250 v306) - (let (v307 (ptr i32)) (inttoptr v305)) - (store v307 v304) - (let (v308 i32) (const.i32 2)) - (let (v309 i32) (band v301 v308)) - (let (v310 i1) (neq v309 0)) - (condbr v310 (block 31) (block 32))) - - (block 29 - (let (v258 i32) (const.i32 2)) - (let (v259 i32) (band v252 v258)) - (let (v260 i1) (neq v259 0)) - (condbr v260 (block 28 v235 v229 v172 v179) (block 30))) - - (block 30 - (let (v261 u32) (bitcast v254)) - (let (v262 u32) (add.checked v261 4)) - (let (v263 u32) (mod.unchecked v262 4)) - (assertz 250 v263) - (let (v264 (ptr i32)) (inttoptr v262)) - (let (v265 i32) (load v264)) - (let (v266 i32) (const.i32 3)) - (let (v267 i32) (band v265 v266)) - (let (v268 i32) (bor v267 v235)) - (let (v269 u32) (bitcast v254)) - (let (v270 u32) (add.checked v269 4)) - (let (v271 u32) (mod.unchecked v270 4)) - (assertz 250 v271) - (let (v272 (ptr i32)) (inttoptr v270)) - (store v272 v268) - (let (v273 u32) (bitcast v235)) - (let (v274 u32) (add.checked v273 4)) - (let (v275 u32) (mod.unchecked v274 4)) - (assertz 250 v275) - (let (v276 (ptr i32)) (inttoptr v274)) - (let (v277 i32) (load v276)) - (let (v278 i32) (const.i32 3)) - (let (v279 i32) (band v277 v278)) - (br (block 28 v235 v279 v172 v179))) - - (block 31 - (let (v315 i32) (const.i32 -3)) - (let (v316 i32) (band v304 v315)) - (let (v317 u32) (bitcast v282)) - (let (v318 u32) (mod.unchecked v317 4)) - (assertz 250 v318) - (let (v319 (ptr i32)) (inttoptr v317)) - (store v319 v316) - (let (v320 u32) (bitcast v280)) - (let (v321 u32) (mod.unchecked v320 4)) - (assertz 250 v321) - (let (v322 (ptr i32)) (inttoptr v320)) - (let (v323 i32) (load v322)) - (let (v324 i32) (const.i32 2)) - (let (v325 i32) (bor v323 v324)) - (br (block 24 v280 v325))) - - (block 32 - (let (v311 u32) (bitcast v280)) - (let (v312 u32) (mod.unchecked v311 4)) - (assertz 250 v312) - (let (v313 (ptr i32)) (inttoptr v311)) - (let (v314 i32) (load v313)) - (br (block 24 v280 v314))) - - (block 33 - (br (block 5))) - ) - - (func (export #::alloc) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 16)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 i1) (neq v2 0)) - (condbr v9 (block 3) (block 4))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 (param v98 i32) (param v102 i32) - (let (v99 i32) (const.i32 16)) - (let (v100 i32) (add.wrapping v98 v99)) - (let (v101 (ptr i32)) (global.symbol #__stack_pointer)) - (store v101 v100) - (br (block 1 v102))) - - (block 3 - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (let (v13 i32) (load v12)) - (let (v14 u32) (bitcast v7)) - (let (v15 u32) (add.checked v14 12)) - (let (v16 u32) (mod.unchecked v15 4)) - (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (store v17 v13) - (let (v18 i32) (const.i32 3)) - (let (v19 i32) (add.wrapping v2 v18)) - (let (v20 i32) (const.i32 2)) - (let (v21 u32) (bitcast v19)) - (let (v22 u32) (bitcast v20)) - (let (v23 u32) (shr.wrapping v21 v22)) - (let (v24 i32) (bitcast v23)) - (let (v25 i32) (const.i32 12)) - (let (v26 i32) (add.wrapping v7 v25)) - (let (v27 i32) (call #wee_alloc::alloc_first_fit v24 v1 v26)) - (let (v28 i1) (neq v27 0)) - (condbr v28 (block 5 v0 v7 v27) (block 6))) - - (block 4 - (br (block 2 v7 v1))) - - (block 5 (param v88 i32) (param v89 i32) (param v103 i32) - (let (v90 u32) (bitcast v89)) - (let (v91 u32) (add.checked v90 12)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (let (v94 i32) (load v93)) - (let (v95 u32) (bitcast v88)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (store v97 v94) - (br (block 2 v89 v103))) - - (block 6 - (let (v29 i32) (const.i32 -4)) - (let (v30 i32) (band v19 v29)) - (let (v31 i32) (const.i32 3)) - (let (v32 u32) (bitcast v31)) - (let (v33 i32) (shl.wrapping v1 v32)) - (let (v34 i32) (const.i32 512)) - (let (v35 i32) (add.wrapping v33 v34)) - (let (v36 u32) (bitcast v30)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (gt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (let (v41 i32) (select v40 v30 v35)) - (let (v42 i32) (const.i32 65543)) - (let (v43 i32) (add.wrapping v41 v42)) - (let (v44 i32) (const.i32 16)) - (let (v45 u32) (bitcast v43)) - (let (v46 u32) (bitcast v44)) - (let (v47 u32) (shr.wrapping v45 v46)) - (let (v48 i32) (bitcast v47)) - (let (v49 u32) (bitcast v48)) - (let (v50 i32) (memory.grow v49)) - (let (v51 i32) (const.i32 -1)) - (let (v52 i1) (neq v50 v51)) - (let (v53 i32) (zext v52)) - (let (v54 i1) (neq v53 0)) - (condbr v54 (block 7) (block 8))) - - (block 7 - (let (v56 i32) (const.i32 16)) - (let (v57 u32) (bitcast v56)) - (let (v58 i32) (shl.wrapping v50 v57)) - (let (v59 i32) (const.i32 0)) - (let (v60 u32) (bitcast v58)) - (let (v61 u32) (add.checked v60 4)) - (let (v62 u32) (mod.unchecked v61 4)) - (assertz 250 v62) - (let (v63 (ptr i32)) (inttoptr v61)) - (store v63 v59) - (let (v64 u32) (bitcast v7)) - (let (v65 u32) (add.checked v64 12)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v58)) - (let (v70 u32) (add.checked v69 8)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 i32) (const.i32 -65536)) - (let (v74 i32) (band v43 v73)) - (let (v75 i32) (add.wrapping v58 v74)) - (let (v76 i32) (const.i32 2)) - (let (v77 i32) (bor v75 v76)) - (let (v78 u32) (bitcast v58)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v77) - (let (v81 u32) (bitcast v7)) - (let (v82 u32) (add.checked v81 12)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (store v84 v58) - (let (v85 i32) (const.i32 12)) - (let (v86 i32) (add.wrapping v7 v85)) - (let (v87 i32) (call #wee_alloc::alloc_first_fit v24 v1 v86)) - (br (block 5 v0 v7 v87))) - - (block 8 - (let (v55 i32) (const.i32 0)) - (br (block 5 v0 v7 v55))) - ) - - (func (export #::dealloc) - (param i32) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i1) (eq v1 0)) - (let (v6 i32) (zext v5)) - (let (v7 i1) (neq v6 0)) - (condbr v7 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (let (v8 i1) (eq v3 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2) (block 4))) - - (block 4 - (let (v11 u32) (bitcast v0)) - (let (v12 u32) (mod.unchecked v11 4)) - (assertz 250 v12) - (let (v13 (ptr i32)) (inttoptr v11)) - (let (v14 i32) (load v13)) - (let (v15 i32) (const.i32 0)) - (let (v16 u32) (bitcast v1)) - (let (v17 u32) (mod.unchecked v16 4)) - (assertz 250 v17) - (let (v18 (ptr i32)) (inttoptr v16)) - (store v18 v15) - (let (v19 i32) (const.i32 -8)) - (let (v20 i32) (add.wrapping v1 v19)) - (let (v21 u32) (bitcast v20)) - (let (v22 u32) (mod.unchecked v21 4)) - (assertz 250 v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i32) (const.i32 -2)) - (let (v26 i32) (band v24 v25)) - (let (v27 u32) (bitcast v20)) - (let (v28 u32) (mod.unchecked v27 4)) - (assertz 250 v28) - (let (v29 (ptr i32)) (inttoptr v27)) - (store v29 v26) - (let (v30 i32) (const.i32 -4)) - (let (v31 i32) (add.wrapping v1 v30)) - (let (v32 u32) (bitcast v31)) - (let (v33 u32) (mod.unchecked v32 4)) - (assertz 250 v33) - (let (v34 (ptr i32)) (inttoptr v32)) - (let (v35 i32) (load v34)) - (let (v36 i32) (const.i32 -4)) - (let (v37 i32) (band v35 v36)) - (let (v38 i1) (eq v37 0)) - (let (v39 i32) (zext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) - - (block 5 (param v177 i32) (param v183 i32) - (let (v185 u32) (bitcast v177)) - (let (v186 u32) (mod.unchecked v185 4)) - (assertz 250 v186) - (let (v187 (ptr i32)) (inttoptr v185)) - (store v187 v183) - (br (block 2))) - - (block 6 - (param v172 i32) - (param v173 i32) - (param v182 i32) - (param v184 i32) - (let (v174 u32) (bitcast v172)) - (let (v175 u32) (mod.unchecked v174 4)) - (assertz 250 v175) - (let (v176 (ptr i32)) (inttoptr v174)) - (store v176 v173) - (br (block 5 v182 v184))) - - (block 7 (param v168 i32) (param v178 i32) - (br (block 5 v178 v168))) - - (block 8 - (param v134 i32) - (param v150 i32) - (param v161 i32) - (param v171 i32) - (param v181 i32) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v134 v135)) - (let (v137 i1) (neq v136 0)) - (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) - - (block 9 - (let (v41 u32) (bitcast v37)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (let (v44 i32) (load v43)) - (let (v45 i32) (const.i32 1)) - (let (v46 i32) (band v44 v45)) - (let (v47 i1) (neq v46 0)) - (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) - - (block 10 - (let (v48 i32) (const.i32 -4)) - (let (v49 i32) (band v24 v48)) - (let (v50 i1) (neq v49 0)) - (condbr v50 (block 13) (block 14))) - - (block 11 - (param v104 i32) - (param v105 i32) - (param v111 i32) - (param v112 i32) - (param v123 i32) - (param v169 i32) - (param v179 i32) - (let (v106 i32) (const.i32 3)) - (let (v107 i32) (band v105 v106)) - (let (v108 u32) (bitcast v104)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (store v110 v107) - (let (v113 i32) (const.i32 3)) - (let (v114 i32) (band v112 v113)) - (let (v115 u32) (bitcast v111)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (store v117 v114) - (let (v118 i32) (const.i32 2)) - (let (v119 i32) (band v112 v118)) - (let (v120 i1) (eq v119 0)) - (let (v121 i32) (zext v120)) - (let (v122 i1) (neq v121 0)) - (condbr v122 (block 7 v169 v179) (block 17))) - - (block 12 - (param v83 i32) - (param v84 i32) - (param v87 i32) - (param v94 i32) - (param v99 i32) - (param v124 i32) - (param v170 i32) - (param v180 i32) - (let (v85 i32) (const.i32 -4)) - (let (v86 i32) (band v84 v85)) - (let (v88 i32) (const.i32 3)) - (let (v89 i32) (band v87 v88)) - (let (v90 i32) (bor v86 v89)) - (let (v91 u32) (bitcast v83)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (store v93 v90) - (let (v95 u32) (bitcast v94)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (let (v98 i32) (load v97)) - (let (v100 u32) (bitcast v99)) - (let (v101 u32) (mod.unchecked v100 4)) - (assertz 250 v101) - (let (v102 (ptr i32)) (inttoptr v100)) - (let (v103 i32) (load v102)) - (br (block 11 v94 v98 v99 v103 v124 v170 v180))) - - (block 13 - (let (v51 i32) (const.i32 2)) - (let (v52 i32) (band v24 v51)) - (let (v53 i1) (neq v52 0)) - (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) - - (block 14 - (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) - - (block 15 - (let (v54 u32) (bitcast v49)) - (let (v55 u32) (add.checked v54 4)) - (let (v56 u32) (mod.unchecked v55 4)) - (assertz 250 v56) - (let (v57 (ptr i32)) (inttoptr v55)) - (let (v58 i32) (load v57)) - (let (v59 i32) (const.i32 3)) - (let (v60 i32) (band v58 v59)) - (let (v61 i32) (bor v60 v37)) - (let (v62 u32) (bitcast v49)) - (let (v63 u32) (add.checked v62 4)) - (let (v64 u32) (mod.unchecked v63 4)) - (assertz 250 v64) - (let (v65 (ptr i32)) (inttoptr v63)) - (store v65 v61) - (let (v66 u32) (bitcast v20)) - (let (v67 u32) (mod.unchecked v66 4)) - (assertz 250 v67) - (let (v68 (ptr i32)) (inttoptr v66)) - (let (v69 i32) (load v68)) - (let (v70 u32) (bitcast v31)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (let (v74 i32) (const.i32 -4)) - (let (v75 i32) (band v73 v74)) - (let (v76 i1) (eq v75 0)) - (let (v77 i32) (zext v76)) - (let (v78 i1) (neq v77 0)) - (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) - - (block 16 - (let (v79 u32) (bitcast v75)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) - - (block 17 - (let (v125 u32) (bitcast v123)) - (let (v126 u32) (mod.unchecked v125 4)) - (assertz 250 v126) - (let (v127 (ptr i32)) (inttoptr v125)) - (let (v128 i32) (load v127)) - (let (v129 i32) (const.i32 2)) - (let (v130 i32) (bor v128 v129)) - (let (v131 u32) (bitcast v123)) - (let (v132 u32) (mod.unchecked v131 4)) - (assertz 250 v132) - (let (v133 (ptr i32)) (inttoptr v131)) - (store v133 v130) - (br (block 7 v169 v179))) - - (block 18 - (let (v138 i32) (const.i32 -4)) - (let (v139 i32) (band v134 v138)) - (let (v140 i1) (eq v139 0)) - (let (v141 i32) (zext v140)) - (let (v142 i1) (neq v141 0)) - (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) - - (block 19 - (let (v143 u32) (bitcast v139)) - (let (v144 (ptr u8)) (inttoptr v143)) - (let (v145 u8) (load v144)) - (let (v146 i32) (zext v145)) - (let (v147 i32) (const.i32 1)) - (let (v148 i32) (band v146 v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) - - (block 20 - (let (v151 u32) (bitcast v139)) - (let (v152 u32) (add.checked v151 8)) - (let (v153 u32) (mod.unchecked v152 4)) - (assertz 250 v153) - (let (v154 (ptr i32)) (inttoptr v152)) - (let (v155 i32) (load v154)) - (let (v156 i32) (const.i32 -4)) - (let (v157 i32) (band v155 v156)) - (let (v158 u32) (bitcast v150)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v162 i32) (const.i32 1)) - (let (v163 i32) (bor v161 v162)) - (let (v164 u32) (bitcast v139)) - (let (v165 u32) (add.checked v164 8)) - (let (v166 u32) (mod.unchecked v165 4)) - (assertz 250 v166) - (let (v167 (ptr i32)) (inttoptr v165)) - (store v167 v163) - (br (block 7 v171 v181))) - ) - - (func (export #cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) - (br (block 1 v5))) - - (block 1 (param v4 i32) - (ret v4)) - ) - - ;; Imports - (func (import #miden:base/tx@1.0.0 #create_note) - (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (param i64) (result i64)) - (func (import #wit-component:shim #indirect-miden:base/account@1.0.0-add-asset) - (param i64) (param i64) (param i64) (param i64) (param i32)) - (func (import #wit-component:shim #indirect-miden:base/account@1.0.0-remove-asset) - (param i64) (param i64) (param i64) (param i64) (param i32)) - ) - - (module #wit-component:fixups - - ) - -) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat deleted file mode 100644 index b15c11285..000000000 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat +++ /dev/null @@ -1,904 +0,0 @@ -(component - (type (;0;) - (instance - (type (;0;) (record (field "inner" u64))) - (export (;1;) "felt" (type (eq 0))) - (type (;2;) (tuple 1 1 1 1)) - (export (;3;) "word" (type (eq 2))) - (type (;4;) (record (field "inner" 3))) - (export (;5;) "core-asset" (type (eq 4))) - (type (;6;) (record (field "inner" 1))) - (export (;7;) "tag" (type (eq 6))) - (type (;8;) (record (field "inner" 3))) - (export (;9;) "recipient" (type (eq 8))) - (type (;10;) (record (field "inner" 1))) - (export (;11;) "note-id" (type (eq 10))) - ) - ) - (import "miden:base/core-types@1.0.0" (instance (;0;) (type 0))) - (alias export 0 "core-asset" (type (;1;))) - (type (;2;) - (instance - (alias outer 1 1 (type (;0;))) - (export (;1;) "core-asset" (type (eq 0))) - (type (;2;) (func (param "asset" 1) (result 1))) - (export (;0;) "add-asset" (func (type 2))) - (export (;1;) "remove-asset" (func (type 2))) - ) - ) - (import "miden:base/account@1.0.0" (instance (;1;) (type 2))) - (alias export 0 "core-asset" (type (;3;))) - (alias export 0 "tag" (type (;4;))) - (alias export 0 "recipient" (type (;5;))) - (alias export 0 "note-id" (type (;6;))) - (type (;7;) - (instance - (alias outer 1 3 (type (;0;))) - (export (;1;) "core-asset" (type (eq 0))) - (alias outer 1 4 (type (;2;))) - (export (;3;) "tag" (type (eq 2))) - (alias outer 1 5 (type (;4;))) - (export (;5;) "recipient" (type (eq 4))) - (alias outer 1 6 (type (;6;))) - (export (;7;) "note-id" (type (eq 6))) - (type (;8;) (func (param "asset" 1) (param "tag" 3) (param "recipient" 5) (result 7))) - (export (;0;) "create-note" (func (type 8))) - ) - ) - (import "miden:base/tx@1.0.0" (instance (;2;) (type 7))) - (core module (;0;) - (type (;0;) (func (param i64 i64 i64 i64 i32))) - (type (;1;) (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64) (result i64))) - (type (;2;) (func)) - (type (;3;) (func (param i32 i32) (result i32))) - (type (;4;) (func (param i32 i32 i32 i32) (result i32))) - (type (;5;) (func (param i64 i64 i64 i64))) - (type (;6;) (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64))) - (type (;7;) (func (param i32 i32 i32) (result i32))) - (type (;8;) (func (param i32 i32 i32 i32))) - (import "miden:base/account@1.0.0" "add-asset" (func $basic_wallet::bindings::miden::base::account::add_asset::wit_import (;0;) (type 0))) - (import "miden:base/account@1.0.0" "remove-asset" (func $basic_wallet::bindings::miden::base::account::remove_asset::wit_import (;1;) (type 0))) - (import "miden:base/tx@1.0.0" "create-note" (func $basic_wallet::bindings::miden::base::tx::create_note::wit_import (;2;) (type 1))) - (func $__wasm_call_ctors (;3;) (type 2)) - (func $basic_wallet::bindings::__link_custom_section_describing_imports (;4;) (type 2)) - (func $__rust_alloc (;5;) (type 3) (param i32 i32) (result i32) - i32.const 1048596 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;6;) (type 4) (param i32 i32 i32 i32) (result i32) - (local i32) - block ;; label = @1 - i32.const 1048596 - local.get 2 - local.get 3 - call $::alloc - local.tee 4 - i32.eqz - br_if 0 (;@1;) - local.get 4 - local.get 0 - local.get 1 - local.get 3 - local.get 1 - local.get 3 - i32.lt_u - select - memory.copy - i32.const 1048596 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc - end - local.get 4 - ) - (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset (;7;) (type 5) (param i64 i64 i64 i64) - (local i32) - global.get $__stack_pointer - i32.const 32 - i32.sub - local.tee 4 - global.set $__stack_pointer - call $wit_bindgen_rt::run_ctors_once - local.get 0 - local.get 1 - local.get 2 - local.get 3 - local.get 4 - call $basic_wallet::bindings::miden::base::account::add_asset::wit_import - local.get 4 - i32.const 32 - i32.add - global.set $__stack_pointer - ) - (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;8;) (type 6) (param i64 i64 i64 i64 i64 i64 i64 i64 i64) - (local i32) - global.get $__stack_pointer - i32.const 32 - i32.sub - local.tee 9 - global.set $__stack_pointer - call $wit_bindgen_rt::run_ctors_once - local.get 0 - local.get 1 - local.get 2 - local.get 3 - local.get 9 - call $basic_wallet::bindings::miden::base::account::remove_asset::wit_import - local.get 9 - i64.load - local.get 9 - i64.load offset=8 - local.get 9 - i64.load offset=16 - local.get 9 - i64.load offset=24 - local.get 4 - local.get 5 - local.get 6 - local.get 7 - local.get 8 - call $basic_wallet::bindings::miden::base::tx::create_note::wit_import - drop - local.get 9 - i32.const 32 - i32.add - global.set $__stack_pointer - ) - (func $wit_bindgen_rt::cabi_realloc (;9;) (type 4) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 1 - br_if 0 (;@3;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - i32.const 0 - i32.load8_u offset=1048600 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@2;) - end - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rust_realloc - local.set 2 - end - local.get 2 - br_if 0 (;@1;) - unreachable - end - local.get 2 - ) - (func $wit_bindgen_rt::run_ctors_once (;10;) (type 2) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048601 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048601 - end - ) - (func $wee_alloc::alloc_first_fit (;11;) (type 7) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 2 - i32.load - local.tee 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 1 - i32.const -1 - i32.add - local.set 4 - i32.const 0 - local.get 1 - i32.sub - local.set 5 - local.get 0 - i32.const 2 - i32.shl - local.set 6 - loop ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - local.get 3 - i32.const 8 - i32.add - local.set 0 - br 1 (;@2;) - end - loop ;; label = @3 - local.get 3 - local.get 1 - i32.const -2 - i32.and - i32.store offset=8 - block ;; label = @4 - block ;; label = @5 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@5;) - i32.const 0 - local.set 8 - br 1 (;@4;) - end - i32.const 0 - local.get 0 - local.get 0 - i32.load8_u - i32.const 1 - i32.and - select - local.set 8 - end - block ;; label = @4 - local.get 3 - i32.load - local.tee 1 - i32.const -4 - i32.and - local.tee 9 - i32.eqz - br_if 0 (;@4;) - local.get 1 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 9 - local.get 9 - i32.load offset=4 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.set 0 - local.get 3 - i32.load - local.set 1 - end - block ;; label = @4 - local.get 0 - i32.eqz - br_if 0 (;@4;) - local.get 0 - local.get 0 - i32.load - i32.const 3 - i32.and - local.get 1 - i32.const -4 - i32.and - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 1 - end - local.get 3 - local.get 7 - i32.const 3 - i32.and - i32.store offset=4 - local.get 3 - local.get 1 - i32.const 3 - i32.and - i32.store - block ;; label = @4 - local.get 1 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 - local.get 8 - i32.store - local.get 8 - local.set 3 - local.get 8 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - end - local.get 8 - i32.const 8 - i32.add - local.set 0 - local.get 8 - local.set 3 - end - block ;; label = @2 - local.get 3 - i32.load - i32.const -4 - i32.and - local.tee 8 - local.get 0 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.const 72 - i32.add - local.get 8 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 8 - i32.le_u - br_if 0 (;@4;) - local.get 4 - local.get 0 - i32.and - br_if 2 (;@2;) - local.get 2 - local.get 1 - i32.const -4 - i32.and - i32.store - local.get 3 - i32.load - local.set 0 - local.get 3 - local.set 1 - br 1 (;@3;) - end - i32.const 0 - local.set 7 - local.get 8 - i32.const 0 - i32.store - local.get 8 - i32.const -8 - i32.add - local.tee 1 - i64.const 0 - i64.store align=4 - local.get 1 - local.get 3 - i32.load - i32.const -4 - i32.and - i32.store - block ;; label = @4 - local.get 3 - i32.load - local.tee 9 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@4;) - local.get 9 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 1 - i32.load offset=4 - i32.const 3 - i32.and - local.set 7 - end - local.get 1 - local.get 7 - local.get 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 0 - i32.load - i32.const -2 - i32.and - i32.store - local.get 3 - local.get 3 - i32.load - local.tee 0 - i32.const 3 - i32.and - local.get 1 - i32.or - local.tee 8 - i32.store - block ;; label = @4 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 1 - i32.load - local.set 0 - br 1 (;@3;) - end - local.get 3 - local.get 8 - i32.const -3 - i32.and - i32.store - local.get 1 - i32.load - i32.const 2 - i32.or - local.set 0 - end - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store - local.get 1 - i32.const 8 - i32.add - return - end - local.get 2 - local.get 1 - i32.store - local.get 1 - local.set 3 - local.get 1 - br_if 0 (;@1;) - end - i32.const 0 - ) - (func $::alloc (;12;) (type 7) (param i32 i32 i32) (result i32) - (local i32 i32 i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 3 - global.set $__stack_pointer - block ;; label = @1 - block ;; label = @2 - local.get 2 - br_if 0 (;@2;) - local.get 1 - local.set 2 - br 1 (;@1;) - end - local.get 3 - local.get 0 - i32.load - i32.store offset=12 - block ;; label = @2 - local.get 2 - i32.const 3 - i32.add - local.tee 4 - i32.const 2 - i32.shr_u - local.tee 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.tee 2 - br_if 0 (;@2;) - block ;; label = @3 - local.get 4 - i32.const -4 - i32.and - local.tee 2 - local.get 1 - i32.const 3 - i32.shl - i32.const 512 - i32.add - local.tee 4 - local.get 2 - local.get 4 - i32.gt_u - select - i32.const 65543 - i32.add - local.tee 4 - i32.const 16 - i32.shr_u - memory.grow - local.tee 2 - i32.const -1 - i32.ne - br_if 0 (;@3;) - i32.const 0 - local.set 2 - br 1 (;@2;) - end - local.get 2 - i32.const 16 - i32.shl - local.tee 2 - i32.const 0 - i32.store offset=4 - local.get 2 - local.get 3 - i32.load offset=12 - i32.store offset=8 - local.get 2 - local.get 2 - local.get 4 - i32.const -65536 - i32.and - i32.add - i32.const 2 - i32.or - i32.store - local.get 3 - local.get 2 - i32.store offset=12 - local.get 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.set 2 - end - local.get 0 - local.get 3 - i32.load offset=12 - i32.store - end - local.get 3 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 2 - ) - (func $::dealloc (;13;) (type 8) (param i32 i32 i32 i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 1 - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.eqz - br_if 0 (;@1;) - local.get 0 - i32.load - local.set 4 - local.get 1 - i32.const 0 - i32.store - local.get 1 - i32.const -8 - i32.add - local.tee 3 - local.get 3 - i32.load - local.tee 5 - i32.const -2 - i32.and - local.tee 6 - i32.store - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - local.get 1 - i32.const -4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - br_if 0 (;@5;) - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 5 - i32.const -4 - i32.and - local.tee 10 - br_if 0 (;@8;) - local.get 8 - local.set 1 - br 1 (;@7;) - end - local.get 8 - local.set 1 - local.get 5 - i32.const 2 - i32.and - br_if 0 (;@7;) - local.get 10 - local.get 10 - i32.load offset=4 - i32.const 3 - i32.and - local.get 8 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 6 - local.get 7 - i32.load - local.tee 5 - i32.const -4 - i32.and - local.tee 1 - i32.eqz - br_if 1 (;@6;) - local.get 1 - i32.load - local.set 9 - end - local.get 1 - local.get 6 - i32.const -4 - i32.and - local.get 9 - i32.const 3 - i32.and - i32.or - i32.store - local.get 7 - i32.load - local.set 5 - local.get 3 - i32.load - local.set 6 - end - local.get 7 - local.get 5 - i32.const 3 - i32.and - i32.store - local.get 3 - local.get 6 - i32.const 3 - i32.and - i32.store - local.get 6 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - br 1 (;@4;) - end - local.get 5 - i32.const 2 - i32.and - br_if 1 (;@3;) - local.get 5 - i32.const -4 - i32.and - local.tee 5 - i32.eqz - br_if 1 (;@3;) - local.get 5 - i32.load8_u - i32.const 1 - i32.and - br_if 1 (;@3;) - local.get 1 - local.get 5 - i32.load offset=8 - i32.const -4 - i32.and - i32.store - local.get 5 - local.get 3 - i32.const 1 - i32.or - i32.store offset=8 - end - local.get 4 - local.set 3 - br 1 (;@2;) - end - local.get 1 - local.get 4 - i32.store - end - local.get 0 - local.get 3 - i32.store - end - ) - (func $cabi_realloc (;14;) (type 4) (param i32 i32 i32 i32) (result i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $wit_bindgen_rt::cabi_realloc - ) - (table (;0;) 3 3 funcref) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "miden:basic-wallet/basic-wallet@1.0.0#receive-asset" (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset)) - (export "miden:basic-wallet/basic-wallet@1.0.0#send-asset" (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset)) - (export "cabi_realloc" (func $cabi_realloc)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $basic_wallet::bindings::__link_custom_section_describing_imports $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00") - ) - (core module (;1;) - (type (;0;) (func (param i64 i64 i64 i64 i32))) - (func $indirect-miden:base/account@1.0.0-add-asset (;0;) (type 0) (param i64 i64 i64 i64 i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - local.get 4 - i32.const 0 - call_indirect (type 0) - ) - (func $indirect-miden:base/account@1.0.0-remove-asset (;1;) (type 0) (param i64 i64 i64 i64 i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - local.get 4 - i32.const 1 - call_indirect (type 0) - ) - (table (;0;) 2 2 funcref) - (export "0" (func $indirect-miden:base/account@1.0.0-add-asset)) - (export "1" (func $indirect-miden:base/account@1.0.0-remove-asset)) - (export "$imports" (table 0)) - ) - (core module (;2;) - (type (;0;) (func (param i64 i64 i64 i64 i32))) - (import "" "0" (func (;0;) (type 0))) - (import "" "1" (func (;1;) (type 0))) - (import "" "$imports" (table (;0;) 2 2 funcref)) - (elem (;0;) (i32.const 0) func 0 1) - ) - (core instance (;0;) (instantiate 1)) - (alias core export 0 "0" (core func (;0;))) - (alias core export 0 "1" (core func (;1;))) - (core instance (;1;) - (export "add-asset" (func 0)) - (export "remove-asset" (func 1)) - ) - (alias export 2 "create-note" (func (;0;))) - (core func (;2;) (canon lower (func 0))) - (core instance (;2;) - (export "create-note" (func 2)) - ) - (core instance (;3;) (instantiate 0 - (with "miden:base/account@1.0.0" (instance 1)) - (with "miden:base/tx@1.0.0" (instance 2)) - ) - ) - (alias core export 3 "memory" (core memory (;0;))) - (alias core export 3 "cabi_realloc" (core func (;3;))) - (alias core export 0 "$imports" (core table (;0;))) - (alias export 1 "add-asset" (func (;1;))) - (core func (;4;) (canon lower (func 1) (memory 0))) - (alias export 1 "remove-asset" (func (;2;))) - (core func (;5;) (canon lower (func 2) (memory 0))) - (core instance (;4;) - (export "$imports" (table 0)) - (export "0" (func 4)) - (export "1" (func 5)) - ) - (core instance (;5;) (instantiate 2 - (with "" (instance 4)) - ) - ) - (alias export 0 "core-asset" (type (;8;))) - (type (;9;) (func (param "core-asset" 8))) - (alias core export 3 "miden:basic-wallet/basic-wallet@1.0.0#receive-asset" (core func (;6;))) - (func (;3;) (type 9) (canon lift (core func 6))) - (alias export 0 "tag" (type (;10;))) - (alias export 0 "recipient" (type (;11;))) - (type (;12;) (func (param "core-asset" 8) (param "tag" 10) (param "recipient" 11))) - (alias core export 3 "miden:basic-wallet/basic-wallet@1.0.0#send-asset" (core func (;7;))) - (func (;4;) (type 12) (canon lift (core func 7))) - (alias export 0 "felt" (type (;13;))) - (alias export 0 "word" (type (;14;))) - (alias export 0 "core-asset" (type (;15;))) - (alias export 0 "tag" (type (;16;))) - (alias export 0 "recipient" (type (;17;))) - (component (;0;) - (type (;0;) (record (field "inner" u64))) - (import "import-type-felt" (type (;1;) (eq 0))) - (type (;2;) (tuple 1 1 1 1)) - (import "import-type-word" (type (;3;) (eq 2))) - (type (;4;) (record (field "inner" 3))) - (import "import-type-core-asset" (type (;5;) (eq 4))) - (type (;6;) (record (field "inner" 1))) - (import "import-type-tag" (type (;7;) (eq 6))) - (type (;8;) (record (field "inner" 3))) - (import "import-type-recipient" (type (;9;) (eq 8))) - (import "import-type-core-asset0" (type (;10;) (eq 5))) - (type (;11;) (func (param "core-asset" 10))) - (import "import-func-receive-asset" (func (;0;) (type 11))) - (import "import-type-tag0" (type (;12;) (eq 7))) - (import "import-type-recipient0" (type (;13;) (eq 9))) - (type (;14;) (func (param "core-asset" 10) (param "tag" 12) (param "recipient" 13))) - (import "import-func-send-asset" (func (;1;) (type 14))) - (export (;15;) "core-asset" (type 5)) - (export (;16;) "tag" (type 7)) - (export (;17;) "recipient" (type 9)) - (type (;18;) (func (param "core-asset" 15))) - (export (;2;) "receive-asset" (func 0) (func (type 18))) - (type (;19;) (func (param "core-asset" 15) (param "tag" 16) (param "recipient" 17))) - (export (;3;) "send-asset" (func 1) (func (type 19))) - ) - (instance (;3;) (instantiate 0 - (with "import-func-receive-asset" (func 3)) - (with "import-func-send-asset" (func 4)) - (with "import-type-felt" (type 13)) - (with "import-type-word" (type 14)) - (with "import-type-core-asset" (type 15)) - (with "import-type-tag" (type 16)) - (with "import-type-recipient" (type 17)) - (with "import-type-core-asset0" (type 8)) - (with "import-type-tag0" (type 10)) - (with "import-type-recipient0" (type 11)) - ) - ) - (export (;4;) "miden:basic-wallet/basic-wallet@1.0.0" (instance 3)) -) \ No newline at end of file diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir deleted file mode 100644 index 14b86027a..000000000 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.hir +++ /dev/null @@ -1,6316 +0,0 @@ -(component - ;; Component Imports - (lower (("miden:base/note@1.0.0" #get-inputs) (type (func (abi wasm) (result (list (struct u64)))))) (# #0) - (lower (("miden:base/note@1.0.0" #get-assets) (type (func (abi wasm) (result (list (struct (struct (struct u64) (struct u64) (struct u64) (struct u64)))))))) (# #1) - (lower (("miden:base/account@1.0.0" #get-id) (type (func (abi wasm) (result (struct (struct u64)))))) (#miden:base/account@1.0.0 #get_id) - (lower (("miden:base/core-types@1.0.0" #account-id-from-felt) (type (func (abi wasm) (param (struct u64)) (result (struct (struct u64)))))) (#miden:base/core-types@1.0.0 #account_id_from_felt) - (lower (("miden:basic-wallet/basic-wallet@1.0.0" #receive-asset) (type (func (abi wasm) (param (struct (struct (struct u64) (struct u64) (struct u64) (struct u64))))))) (#miden:basic-wallet/basic-wallet@1.0.0 #receive_asset) - - ;; Modules - (module #wit-component:shim - ;; Functions - (func (export #indirect-miden:base/note@1.0.0-get-inputs) (param i32) - (block 0 (param v0 i32) - (let (v1 i32) (const.i32 0)) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #indirect-miden:base/note@1.0.0-get-assets) (param i32) - (block 0 (param v0 i32) - (let (v1 i32) (const.i32 1)) - (br (block 1))) - - (block 1 - (ret)) - ) - ) - - (module #basic_wallet_p2id_note - ;; Data Segments - (data (mut) (offset 1048576) 0x000000000400000004000000010000000200000046656c7400000000080000000800000003000000696e6e65724163636f756e74496400000000000008000000080000000400000002000000020000000200000002000000020000007372632f6c69622e727300005c0010000a000000210000002c0000005c0010000a000000240000000900000005000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000008c00100020000000ac001000120000003d3d213d6d617463686573617373657274696f6e20606c6566742020726967687460206661696c65640a20206c6566743a200a2072696768743a2000db00100010000000eb00100017000000020110000900000020726967687460206661696c65643a200a20206c6566743a20000000db001000100000002401100010000000340110000900000002011000090000003a200000000000000c000000040000000a0000000b0000000c00000020202020207b202c20207b0a2c0a7d207d636f72652f7372632f666d742f6e756d2e72738d0110001300000066000000170000003078303030313032303330343035303630373038303931303131313231333134313531363137313831393230323132323233323432353236323732383239333033313332333333343335333633373338333934303431343234333434343534363437343834393530353135323533353435353536353735383539363036313632363336343635363636373638363937303731373237333734373537363737373837393830383138323833383438353836383738383839393039313932393339343935393639373938393972616e676520737461727420696e64657820206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682000007a021000120000008c02100022000000) - - ;; Constants - (const (id 0) 0x00100000) - - ;; Global Variables - (global (export #__stack_pointer) (id 0) (type i32) (const 0)) - - ;; Functions - (func (export #__wasm_call_ctors) - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #<&T as core::fmt::Debug>::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v5 i32) (const.i32 16)) - (let (v6 i32) (sub.wrapping v4 v5)) - (let (v7 (ptr i32)) (global.symbol #__stack_pointer)) - (store v7 v6) - (let (v8 u32) (bitcast v0)) - (let (v9 u32) (mod.unchecked v8 4)) - (assertz 250 v9) - (let (v10 (ptr i32)) (inttoptr v8)) - (let (v11 i32) (load v10)) - (let (v12 i32) (const.i32 8)) - (let (v13 i32) (add.wrapping v6 v12)) - (let (v14 i32) (const.i32 1048621)) - (let (v15 i32) (const.i32 9)) - (call #core::fmt::Formatter::debug_struct v13 v1 v14 v15) - (let (v16 i32) (const.i32 8)) - (let (v17 i32) (add.wrapping v6 v16)) - (let (v18 i32) (const.i32 1048616)) - (let (v19 i32) (const.i32 5)) - (let (v20 i32) (const.i32 1048632)) - (let (v21 i32) (call #core::fmt::builders::DebugStruct::field v17 v18 v19 v11 v20)) - (let (v22 i32) (call #core::fmt::builders::DebugStruct::finish v21)) - (let (v23 i32) (const.i32 16)) - (let (v24 i32) (add.wrapping v6 v23)) - (let (v25 (ptr i32)) (global.symbol #__stack_pointer)) - (store v25 v24) - (br (block 1 v22))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #core::fmt::num::::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 u32) (bitcast v1)) - (let (v5 u32) (add.checked v4 28)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 i32) (const.i32 16)) - (let (v10 i32) (band v8 v9)) - (let (v11 i1) (neq v10 0)) - (condbr v11 (block 2) (block 3))) - - (block 1 (param v2 i32) - (ret v2)) - - (block 2 - (let (v17 i32) (call #core::fmt::num::::fmt v0 v1)) - (br (block 1 v17))) - - (block 3 - (let (v12 i32) (const.i32 32)) - (let (v13 i32) (band v8 v12)) - (let (v14 i1) (neq v13 0)) - (condbr v14 (block 4) (block 5))) - - (block 4 - (let (v16 i32) (call #core::fmt::num::::fmt v0 v1)) - (ret v16)) - - (block 5 - (let (v15 i32) (call #core::fmt::num::imp::::fmt v0 v1)) - (ret v15)) - ) - - (func (export #core::panicking::assert_failed) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v5 i32) (const.i32 16)) - (let (v6 i32) (sub.wrapping v4 v5)) - (let (v7 (ptr i32)) (global.symbol #__stack_pointer)) - (store v7 v6) - (let (v8 u32) (bitcast v6)) - (let (v9 u32) (add.checked v8 12)) - (let (v10 u32) (mod.unchecked v9 4)) - (assertz 250 v10) - (let (v11 (ptr i32)) (inttoptr v9)) - (store v11 v1) - (let (v12 u32) (bitcast v6)) - (let (v13 u32) (add.checked v12 8)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v0) - (let (v16 i32) (const.i32 0)) - (let (v17 i32) (const.i32 8)) - (let (v18 i32) (add.wrapping v6 v17)) - (let (v19 i32) (const.i32 1048576)) - (let (v20 i32) (const.i32 12)) - (let (v21 i32) (add.wrapping v6 v20)) - (let (v22 i32) (const.i32 1048576)) - (let (v23 i32) (const.i32 1048696)) - (call #core::panicking::assert_failed_inner v16 v18 v19 v21 v22 v2 v23) - (unreachable)) - - (block 1) - ) - - (func (export #rust_begin_unwind) (param i32) - (block 0 (param v0 i32) - (br (block 2))) - - (block 1) - - (block 2 - (br (block 2))) - - (block 3) - ) - - (func (export #::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v5 i32) (const.i32 16)) - (let (v6 i32) (sub.wrapping v4 v5)) - (let (v7 (ptr i32)) (global.symbol #__stack_pointer)) - (store v7 v6) - (let (v8 i32) (const.i32 8)) - (let (v9 i32) (add.wrapping v6 v8)) - (let (v10 i32) (const.i32 1048596)) - (let (v11 i32) (const.i32 4)) - (call #core::fmt::Formatter::debug_struct v9 v1 v10 v11) - (let (v12 i32) (const.i32 8)) - (let (v13 i32) (add.wrapping v6 v12)) - (let (v14 i32) (const.i32 1048616)) - (let (v15 i32) (const.i32 5)) - (let (v16 i32) (const.i32 1048600)) - (let (v17 i32) (call #core::fmt::builders::DebugStruct::field v13 v14 v15 v0 v16)) - (let (v18 i32) (call #core::fmt::builders::DebugStruct::finish v17)) - (let (v19 i32) (const.i32 16)) - (let (v20 i32) (add.wrapping v6 v19)) - (let (v21 (ptr i32)) (global.symbol #__stack_pointer)) - (store v21 v20) - (br (block 1 v18))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports) - - (block 0 - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #__rust_alloc) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1049280)) - (let (v4 i32) (call #::alloc v3 v1 v0)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #__rust_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1049280)) - (let (v7 i32) (call #::alloc v6 v2 v3)) - (let (v8 i1) (eq v7 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2 v7) (block 3))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v23 i32) - (br (block 1 v23))) - - (block 3 - (let (v11 u32) (bitcast v1)) - (let (v12 u32) (bitcast v3)) - (let (v13 i1) (lt v11 v12)) - (let (v14 i32) (sext v13)) - (let (v15 i1) (neq v14 0)) - (let (v16 i32) (select v15 v1 v3)) - (let (v17 u32) (bitcast v16)) - (let (v18 u32) (bitcast v7)) - (let (v19 (ptr u8)) (inttoptr v18)) - (let (v20 u32) (bitcast v0)) - (let (v21 (ptr u8)) (inttoptr v20)) - (memcpy v21 v19 v17) - (let (v22 i32) (const.i32 1049280)) - (call #::dealloc v22 v0 v2 v1) - (br (block 2 v7))) - ) - - (func (export #miden:base/note-script@1.0.0#note-script) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 i64) (const.i64 0)) - (let (v2 i32) (const.i32 0)) - (let (v3 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v4 i32) (const.i32 48)) - (let (v5 i32) (sub.wrapping v3 v4)) - (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) - (store v6 v5) - (call #wit_bindgen_rt::run_ctors_once) - (let (v7 i64) (const.i64 0)) - (let (v8 u32) (bitcast v5)) - (let (v9 u32) (add.checked v8 24)) - (let (v10 u32) (mod.unchecked v9 8)) - (assertz 250 v10) - (let (v11 (ptr i64)) (inttoptr v9)) - (store v11 v7) - (let (v12 i32) (const.i32 24)) - (let (v13 i32) (add.wrapping v5 v12)) - (call (#wit-component:shim #indirect-miden:base/note@1.0.0-get-inputs) v13) - (let (v14 u32) (bitcast v5)) - (let (v15 u32) (add.checked v14 28)) - (let (v16 u32) (mod.unchecked v15 4)) - (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (let (v18 i32) (load v17)) - (let (v19 i1) (eq v18 0)) - (let (v20 i32) (zext v19)) - (let (v21 i1) (neq v20 0)) - (condbr v21 (block 3) (block 4))) - - (block 1) - - (block 2 - (let (v118 i32) (const.i32 0)) - (let (v119 u32) (bitcast v5)) - (let (v120 u32) (add.checked v119 24)) - (let (v121 u32) (mod.unchecked v120 4)) - (assertz 250 v121) - (let (v122 (ptr i32)) (inttoptr v120)) - (store v122 v118) - (let (v123 i32) (const.i32 16)) - (let (v124 i32) (add.wrapping v5 v123)) - (let (v125 i32) (const.i32 8)) - (let (v126 i32) (add.wrapping v5 v125)) - (let (v127 i32) (const.i32 24)) - (let (v128 i32) (add.wrapping v5 v127)) - (call #core::panicking::assert_failed v124 v126 v128) - (unreachable)) - - (block 3 - (let (v115 i32) (const.i32 0)) - (let (v116 i32) (const.i32 0)) - (let (v117 i32) (const.i32 1048680)) - (call #core::panicking::panic_bounds_check v115 v116 v117) - (unreachable)) - - (block 4 - (let (v22 u32) (bitcast v5)) - (let (v23 u32) (add.checked v22 24)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 u32) (bitcast v26)) - (let (v28 u32) (mod.unchecked v27 8)) - (assertz 250 v28) - (let (v29 (ptr i64)) (inttoptr v27)) - (let (v30 i64) (load v29)) - (let (v31 i64) (call (#miden:base/core-types@1.0.0 #account_id_from_felt) v30)) - (let (v32 u32) (bitcast v5)) - (let (v33 u32) (add.checked v32 8)) - (let (v34 u32) (mod.unchecked v33 8)) - (assertz 250 v34) - (let (v35 (ptr i64)) (inttoptr v33)) - (store v35 v31) - (let (v36 i64) (call (#miden:base/account@1.0.0 #get_id))) - (let (v37 u32) (bitcast v5)) - (let (v38 u32) (add.checked v37 16)) - (let (v39 u32) (mod.unchecked v38 8)) - (assertz 250 v39) - (let (v40 (ptr i64)) (inttoptr v38)) - (store v40 v36) - (let (v41 i1) (neq v36 v31)) - (let (v42 i32) (zext v41)) - (let (v43 i1) (neq v42 0)) - (condbr v43 (block 2) (block 5))) - - (block 5 - (let (v44 i64) (const.i64 0)) - (let (v45 u32) (bitcast v5)) - (let (v46 u32) (add.checked v45 24)) - (let (v47 u32) (mod.unchecked v46 8)) - (assertz 250 v47) - (let (v48 (ptr i64)) (inttoptr v46)) - (store v48 v44) - (let (v49 i32) (const.i32 24)) - (let (v50 i32) (add.wrapping v5 v49)) - (call (#wit-component:shim #indirect-miden:base/note@1.0.0-get-assets) v50) - (let (v51 u32) (bitcast v5)) - (let (v52 u32) (add.checked v51 28)) - (let (v53 u32) (mod.unchecked v52 4)) - (assertz 250 v53) - (let (v54 (ptr i32)) (inttoptr v52)) - (let (v55 i32) (load v54)) - (let (v56 i1) (eq v55 0)) - (let (v57 i32) (zext v56)) - (let (v58 i1) (neq v57 0)) - (condbr v58 (block 6 v26 v18 v5) (block 7))) - - (block 6 (param v102 i32) (param v105 i32) (param v110 i32) - (let (v101 i32) (const.i32 1049280)) - (let (v104 i32) (const.i32 8)) - (let (v107 i32) (const.i32 3)) - (let (v108 u32) (bitcast v107)) - (let (v109 i32) (shl.wrapping v105 v108)) - (call #::dealloc v101 v102 v104 v109) - (let (v112 i32) (const.i32 48)) - (let (v113 i32) (add.wrapping v110 v112)) - (let (v114 (ptr i32)) (global.symbol #__stack_pointer)) - (store v114 v113) - (ret)) - - (block 7 - (let (v59 u32) (bitcast v5)) - (let (v60 u32) (add.checked v59 24)) - (let (v61 u32) (mod.unchecked v60 4)) - (assertz 250 v61) - (let (v62 (ptr i32)) (inttoptr v60)) - (let (v63 i32) (load v62)) - (let (v64 i32) (const.i32 5)) - (let (v65 u32) (bitcast v64)) - (let (v66 i32) (shl.wrapping v55 v65)) - (let (v67 i32) (add.wrapping v63 v66)) - (br (block 8 v63 v67 v63 v55 v26 v18 v5))) - - (block 8 - (param v68 i32) - (param v90 i32) - (param v95 i32) - (param v97 i32) - (param v103 i32) - (param v106 i32) - (param v111 i32) - (let (v69 u32) (bitcast v68)) - (let (v70 u32) (mod.unchecked v69 8)) - (assertz 250 v70) - (let (v71 (ptr i64)) (inttoptr v69)) - (let (v72 i64) (load v71)) - (let (v73 u32) (bitcast v68)) - (let (v74 u32) (add.checked v73 8)) - (let (v75 u32) (mod.unchecked v74 8)) - (assertz 250 v75) - (let (v76 (ptr i64)) (inttoptr v74)) - (let (v77 i64) (load v76)) - (let (v78 u32) (bitcast v68)) - (let (v79 u32) (add.checked v78 16)) - (let (v80 u32) (mod.unchecked v79 8)) - (assertz 250 v80) - (let (v81 (ptr i64)) (inttoptr v79)) - (let (v82 i64) (load v81)) - (let (v83 u32) (bitcast v68)) - (let (v84 u32) (add.checked v83 24)) - (let (v85 u32) (mod.unchecked v84 8)) - (assertz 250 v85) - (let (v86 (ptr i64)) (inttoptr v84)) - (let (v87 i64) (load v86)) - (call (#miden:basic-wallet/basic-wallet@1.0.0 #receive_asset) v72 v77 v82 v87) - (let (v88 i32) (const.i32 32)) - (let (v89 i32) (add.wrapping v68 v88)) - (let (v91 i1) (neq v89 v90)) - (let (v92 i32) (zext v91)) - (let (v93 i1) (neq v92 0)) - (condbr v93 (block 8 v89 v90 v95 v97 v103 v106 v111) (block 10))) - - (block 9 - (let (v94 i32) (const.i32 1049280)) - (let (v96 i32) (const.i32 8)) - (let (v98 i32) (const.i32 5)) - (let (v99 u32) (bitcast v98)) - (let (v100 i32) (shl.wrapping v97 v99)) - (call #::dealloc v94 v95 v96 v100) - (br (block 6 v103 v106 v111))) - - (block 10 - (br (block 9))) - ) - - (func (export #wit_bindgen_rt::cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) - - (block 1 (param v4 i32) - (ret v4)) - - (block 2 (param v19 i32) - (br (block 1 v19))) - - (block 3 (param v17 i32) - (let (v18 i1) (neq v17 0)) - (condbr v18 (block 2 v17) (block 7))) - - (block 4 - (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 3 v16))) - - (block 5 - (let (v6 i1) (eq v3 0)) - (let (v7 i32) (zext v6)) - (let (v8 i1) (neq v7 0)) - (condbr v8 (block 2 v2) (block 6))) - - (block 6 - (let (v9 i32) (const.i32 0)) - (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1049284)) - (let (v12 (ptr u8)) (inttoptr v11)) - (let (v13 u8) (load v12)) - (let (v14 i32) (zext v13)) - (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 3 v15))) - - (block 7 - (unreachable)) - ) - - (func (export #wit_bindgen_rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1049285)) - (let (v3 (ptr u8)) (inttoptr v2)) - (let (v4 u8) (load v3)) - (let (v5 i32) (zext v4)) - (let (v6 i1) (neq v5 0)) - (condbr v6 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (call #__wasm_call_ctors) - (let (v7 i32) (const.i32 0)) - (let (v8 i32) (const.i32 1)) - (let (v9 u32) (bitcast v8)) - (let (v10 u8) (trunc v9)) - (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1049285)) - (let (v13 (ptr u8)) (inttoptr v12)) - (store v13 v10) - (br (block 2))) - ) - - (func (export #wee_alloc::alloc_first_fit) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 u32) (bitcast v2)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 i1) (neq v8 0)) - (condbr v9 (block 2) (block 3))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 - (let (v11 i32) (const.i32 -1)) - (let (v12 i32) (add.wrapping v1 v11)) - (let (v13 i32) (const.i32 0)) - (let (v14 i32) (sub.wrapping v13 v1)) - (let (v15 i32) (const.i32 2)) - (let (v16 u32) (bitcast v15)) - (let (v17 i32) (shl.wrapping v0 v16)) - (br (block 4 v8 v2 v17 v14 v12))) - - (block 3 - (let (v10 i32) (const.i32 0)) - (ret v10)) - - (block 4 - (param v18 i32) - (param v169 i32) - (param v182 i32) - (param v197 i32) - (param v210 i32) - (let (v19 u32) (bitcast v18)) - (let (v20 u32) (add.checked v19 8)) - (let (v21 u32) (mod.unchecked v20 4)) - (assertz 250 v21) - (let (v22 (ptr i32)) (inttoptr v20)) - (let (v23 i32) (load v22)) - (let (v24 i32) (const.i32 1)) - (let (v25 i32) (band v23 v24)) - (let (v26 i1) (neq v25 0)) - (condbr v26 (block 7) (block 8))) - - (block 5 - (let (v344 i32) (const.i32 0)) - (br (block 1 v344))) - - (block 6 - (param v172 i32) - (param v179 i32) - (param v181 i32) - (param v196 i32) - (param v209 i32) - (param v218 i32) - (param v219 i32) - (let (v173 u32) (bitcast v172)) - (let (v174 u32) (mod.unchecked v173 4)) - (assertz 250 v174) - (let (v175 (ptr i32)) (inttoptr v173)) - (let (v176 i32) (load v175)) - (let (v177 i32) (const.i32 -4)) - (let (v178 i32) (band v176 v177)) - (let (v180 i32) (sub.wrapping v178 v179)) - (let (v188 u32) (bitcast v180)) - (let (v189 u32) (bitcast v181)) - (let (v190 i1) (lt v188 v189)) - (let (v191 i32) (sext v190)) - (let (v192 i1) (neq v191 0)) - (condbr v192 (block 22 v218 v219 v181 v196 v209) (block 23))) - - (block 7 - (br (block 9 v18 v23 v169 v182 v197 v210))) - - (block 8 - (let (v27 i32) (const.i32 8)) - (let (v28 i32) (add.wrapping v18 v27)) - (br (block 6 v18 v28 v182 v197 v210 v169 v23))) - - (block 9 - (param v29 i32) - (param v30 i32) - (param v156 i32) - (param v187 i32) - (param v202 i32) - (param v215 i32) - (let (v31 i32) (const.i32 -2)) - (let (v32 i32) (band v30 v31)) - (let (v33 u32) (bitcast v29)) - (let (v34 u32) (add.checked v33 8)) - (let (v35 u32) (mod.unchecked v34 4)) - (assertz 250 v35) - (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v32) - (let (v37 u32) (bitcast v29)) - (let (v38 u32) (add.checked v37 4)) - (let (v39 u32) (mod.unchecked v38 4)) - (assertz 250 v39) - (let (v40 (ptr i32)) (inttoptr v38)) - (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 -4)) - (let (v43 i32) (band v41 v42)) - (let (v44 i1) (neq v43 0)) - (condbr v44 (block 12) (block 13))) - - (block 10 - (let (v170 i32) (const.i32 8)) - (let (v171 i32) (add.wrapping v157 v170)) - (br (block 6 v157 v171 v183 v198 v211 v152 v165))) - - (block 11 - (param v55 i32) - (param v75 i32) - (param v122 i32) - (param v142 i32) - (param v155 i32) - (param v186 i32) - (param v201 i32) - (param v214 i32) - (let (v56 u32) (bitcast v55)) - (let (v57 u32) (mod.unchecked v56 4)) - (assertz 250 v57) - (let (v58 (ptr i32)) (inttoptr v56)) - (let (v59 i32) (load v58)) - (let (v60 i32) (const.i32 -4)) - (let (v61 i32) (band v59 v60)) - (let (v62 i1) (eq v61 0)) - (let (v63 i32) (zext v62)) - (let (v64 i1) (neq v63 0)) - (condbr v64 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 15))) - - (block 12 - (let (v46 i32) (const.i32 0)) - (let (v47 u32) (bitcast v43)) - (let (v48 (ptr u8)) (inttoptr v47)) - (let (v49 u8) (load v48)) - (let (v50 i32) (zext v49)) - (let (v51 i32) (const.i32 1)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (neq v52 0)) - (let (v54 i32) (select v53 v46 v43)) - (br (block 11 v29 v43 v41 v54 v156 v187 v202 v215))) - - (block 13 - (let (v45 i32) (const.i32 0)) - (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) - - (block 14 - (param v92 i32) - (param v102 i32) - (param v109 i32) - (param v121 i32) - (param v141 i32) - (param v154 i32) - (param v185 i32) - (param v200 i32) - (param v213 i32) - (let (v93 i1) (eq v92 0)) - (let (v94 i32) (zext v93)) - (let (v95 i1) (neq v94 0)) - (condbr v95 (block 17 v109 v121 v102 v141 v154 v185 v200 v213) (block 18))) - - (block 15 - (let (v65 i32) (const.i32 2)) - (let (v66 i32) (band v59 v65)) - (let (v67 i1) (neq v66 0)) - (condbr v67 (block 14 v75 v59 v55 v122 v142 v155 v186 v201 v214) (block 16))) - - (block 16 - (let (v68 u32) (bitcast v61)) - (let (v69 u32) (add.checked v68 4)) - (let (v70 u32) (mod.unchecked v69 4)) - (assertz 250 v70) - (let (v71 (ptr i32)) (inttoptr v69)) - (let (v72 i32) (load v71)) - (let (v73 i32) (const.i32 3)) - (let (v74 i32) (band v72 v73)) - (let (v76 i32) (bor v74 v75)) - (let (v77 u32) (bitcast v61)) - (let (v78 u32) (add.checked v77 4)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v76) - (let (v81 u32) (bitcast v55)) - (let (v82 u32) (add.checked v81 4)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (let (v85 i32) (load v84)) - (let (v86 i32) (const.i32 -4)) - (let (v87 i32) (band v85 v86)) - (let (v88 u32) (bitcast v55)) - (let (v89 u32) (mod.unchecked v88 4)) - (assertz 250 v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (let (v91 i32) (load v90)) - (br (block 14 v87 v91 v55 v85 v142 v155 v186 v201 v214))) - - (block 17 - (param v119 i32) - (param v120 i32) - (param v129 i32) - (param v140 i32) - (param v153 i32) - (param v184 i32) - (param v199 i32) - (param v212 i32) - (let (v123 i32) (const.i32 3)) - (let (v124 i32) (band v120 v123)) - (let (v125 u32) (bitcast v119)) - (let (v126 u32) (add.checked v125 4)) - (let (v127 u32) (mod.unchecked v126 4)) - (assertz 250 v127) - (let (v128 (ptr i32)) (inttoptr v126)) - (store v128 v124) - (let (v130 i32) (const.i32 3)) - (let (v131 i32) (band v129 v130)) - (let (v132 u32) (bitcast v119)) - (let (v133 u32) (mod.unchecked v132 4)) - (assertz 250 v133) - (let (v134 (ptr i32)) (inttoptr v132)) - (store v134 v131) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v129 v135)) - (let (v137 i1) (eq v136 0)) - (let (v138 i32) (zext v137)) - (let (v139 i1) (neq v138 0)) - (condbr v139 (block 19 v153 v140 v184 v199 v212) (block 20))) - - (block 18 - (let (v96 u32) (bitcast v92)) - (let (v97 u32) (mod.unchecked v96 4)) - (assertz 250 v97) - (let (v98 (ptr i32)) (inttoptr v96)) - (let (v99 i32) (load v98)) - (let (v100 i32) (const.i32 3)) - (let (v101 i32) (band v99 v100)) - (let (v103 i32) (const.i32 -4)) - (let (v104 i32) (band v102 v103)) - (let (v105 i32) (bor v101 v104)) - (let (v106 u32) (bitcast v92)) - (let (v107 u32) (mod.unchecked v106 4)) - (assertz 250 v107) - (let (v108 (ptr i32)) (inttoptr v106)) - (store v108 v105) - (let (v110 u32) (bitcast v109)) - (let (v111 u32) (add.checked v110 4)) - (let (v112 u32) (mod.unchecked v111 4)) - (assertz 250 v112) - (let (v113 (ptr i32)) (inttoptr v111)) - (let (v114 i32) (load v113)) - (let (v115 u32) (bitcast v109)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (let (v118 i32) (load v117)) - (br (block 17 v109 v114 v118 v141 v154 v185 v200 v213))) - - (block 19 - (param v152 i32) - (param v157 i32) - (param v183 i32) - (param v198 i32) - (param v211 i32) - (let (v158 u32) (bitcast v152)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v161 u32) (bitcast v157)) - (let (v162 u32) (add.checked v161 8)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (band v165 v166)) - (let (v168 i1) (neq v167 0)) - (condbr v168 (block 9 v157 v165 v152 v183 v198 v211) (block 21))) - - (block 20 - (let (v143 u32) (bitcast v140)) - (let (v144 u32) (mod.unchecked v143 4)) - (assertz 250 v144) - (let (v145 (ptr i32)) (inttoptr v143)) - (let (v146 i32) (load v145)) - (let (v147 i32) (const.i32 2)) - (let (v148 i32) (bor v146 v147)) - (let (v149 u32) (bitcast v140)) - (let (v150 u32) (mod.unchecked v149 4)) - (assertz 250 v150) - (let (v151 (ptr i32)) (inttoptr v149)) - (store v151 v148) - (br (block 19 v153 v140 v184 v199 v212))) - - (block 21 - (br (block 10))) - - (block 22 - (param v335 i32) - (param v336 i32) - (param v341 i32) - (param v342 i32) - (param v343 i32) - (let (v337 u32) (bitcast v335)) - (let (v338 u32) (mod.unchecked v337 4)) - (assertz 250 v338) - (let (v339 (ptr i32)) (inttoptr v337)) - (store v339 v336) - (let (v340 i1) (neq v336 0)) - (condbr v340 (block 4 v336 v335 v341 v342 v343) (block 33))) - - (block 23 - (let (v193 i32) (const.i32 72)) - (let (v194 i32) (add.wrapping v179 v193)) - (let (v195 i32) (sub.wrapping v178 v181)) - (let (v203 i32) (band v195 v196)) - (let (v204 u32) (bitcast v194)) - (let (v205 u32) (bitcast v203)) - (let (v206 i1) (lte v204 v205)) - (let (v207 i32) (sext v206)) - (let (v208 i1) (neq v207 0)) - (condbr v208 (block 25) (block 26))) - - (block 24 (param v326 i32) (param v327 i32) - (let (v328 i32) (const.i32 1)) - (let (v329 i32) (bor v327 v328)) - (let (v330 u32) (bitcast v326)) - (let (v331 u32) (mod.unchecked v330 4)) - (assertz 250 v331) - (let (v332 (ptr i32)) (inttoptr v330)) - (store v332 v329) - (let (v333 i32) (const.i32 8)) - (let (v334 i32) (add.wrapping v326 v333)) - (ret v334)) - - (block 25 - (let (v229 i32) (const.i32 0)) - (let (v230 i32) (const.i32 0)) - (let (v231 u32) (bitcast v203)) - (let (v232 u32) (mod.unchecked v231 4)) - (assertz 250 v232) - (let (v233 (ptr i32)) (inttoptr v231)) - (store v233 v230) - (let (v234 i32) (const.i32 -8)) - (let (v235 i32) (add.wrapping v203 v234)) - (let (v236 i64) (const.i64 0)) - (let (v237 u32) (bitcast v235)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i64)) (inttoptr v237)) - (store v239 v236) - (let (v240 u32) (bitcast v172)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (let (v244 i32) (const.i32 -4)) - (let (v245 i32) (band v243 v244)) - (let (v246 u32) (bitcast v235)) - (let (v247 u32) (mod.unchecked v246 4)) - (assertz 250 v247) - (let (v248 (ptr i32)) (inttoptr v246)) - (store v248 v245) - (let (v249 u32) (bitcast v172)) - (let (v250 u32) (mod.unchecked v249 4)) - (assertz 250 v250) - (let (v251 (ptr i32)) (inttoptr v249)) - (let (v252 i32) (load v251)) - (let (v253 i32) (const.i32 -4)) - (let (v254 i32) (band v252 v253)) - (let (v255 i1) (eq v254 0)) - (let (v256 i32) (zext v255)) - (let (v257 i1) (neq v256 0)) - (condbr v257 (block 28 v235 v229 v172 v179) (block 29))) - - (block 26 - (let (v216 i32) (band v209 v179)) - (let (v217 i1) (neq v216 0)) - (condbr v217 (block 22 v218 v219 v181 v196 v209) (block 27))) - - (block 27 - (let (v220 i32) (const.i32 -4)) - (let (v221 i32) (band v219 v220)) - (let (v222 u32) (bitcast v218)) - (let (v223 u32) (mod.unchecked v222 4)) - (assertz 250 v223) - (let (v224 (ptr i32)) (inttoptr v222)) - (store v224 v221) - (let (v225 u32) (bitcast v172)) - (let (v226 u32) (mod.unchecked v225 4)) - (assertz 250 v226) - (let (v227 (ptr i32)) (inttoptr v225)) - (let (v228 i32) (load v227)) - (br (block 24 v172 v228))) - - (block 28 - (param v280 i32) - (param v281 i32) - (param v282 i32) - (param v288 i32) - (let (v283 i32) (bor v281 v282)) - (let (v284 u32) (bitcast v280)) - (let (v285 u32) (add.checked v284 4)) - (let (v286 u32) (mod.unchecked v285 4)) - (assertz 250 v286) - (let (v287 (ptr i32)) (inttoptr v285)) - (store v287 v283) - (let (v289 u32) (bitcast v288)) - (let (v290 u32) (mod.unchecked v289 4)) - (assertz 250 v290) - (let (v291 (ptr i32)) (inttoptr v289)) - (let (v292 i32) (load v291)) - (let (v293 i32) (const.i32 -2)) - (let (v294 i32) (band v292 v293)) - (let (v295 u32) (bitcast v288)) - (let (v296 u32) (mod.unchecked v295 4)) - (assertz 250 v296) - (let (v297 (ptr i32)) (inttoptr v295)) - (store v297 v294) - (let (v298 u32) (bitcast v282)) - (let (v299 u32) (mod.unchecked v298 4)) - (assertz 250 v299) - (let (v300 (ptr i32)) (inttoptr v298)) - (let (v301 i32) (load v300)) - (let (v302 i32) (const.i32 3)) - (let (v303 i32) (band v301 v302)) - (let (v304 i32) (bor v303 v280)) - (let (v305 u32) (bitcast v282)) - (let (v306 u32) (mod.unchecked v305 4)) - (assertz 250 v306) - (let (v307 (ptr i32)) (inttoptr v305)) - (store v307 v304) - (let (v308 i32) (const.i32 2)) - (let (v309 i32) (band v301 v308)) - (let (v310 i1) (neq v309 0)) - (condbr v310 (block 31) (block 32))) - - (block 29 - (let (v258 i32) (const.i32 2)) - (let (v259 i32) (band v252 v258)) - (let (v260 i1) (neq v259 0)) - (condbr v260 (block 28 v235 v229 v172 v179) (block 30))) - - (block 30 - (let (v261 u32) (bitcast v254)) - (let (v262 u32) (add.checked v261 4)) - (let (v263 u32) (mod.unchecked v262 4)) - (assertz 250 v263) - (let (v264 (ptr i32)) (inttoptr v262)) - (let (v265 i32) (load v264)) - (let (v266 i32) (const.i32 3)) - (let (v267 i32) (band v265 v266)) - (let (v268 i32) (bor v267 v235)) - (let (v269 u32) (bitcast v254)) - (let (v270 u32) (add.checked v269 4)) - (let (v271 u32) (mod.unchecked v270 4)) - (assertz 250 v271) - (let (v272 (ptr i32)) (inttoptr v270)) - (store v272 v268) - (let (v273 u32) (bitcast v235)) - (let (v274 u32) (add.checked v273 4)) - (let (v275 u32) (mod.unchecked v274 4)) - (assertz 250 v275) - (let (v276 (ptr i32)) (inttoptr v274)) - (let (v277 i32) (load v276)) - (let (v278 i32) (const.i32 3)) - (let (v279 i32) (band v277 v278)) - (br (block 28 v235 v279 v172 v179))) - - (block 31 - (let (v315 i32) (const.i32 -3)) - (let (v316 i32) (band v304 v315)) - (let (v317 u32) (bitcast v282)) - (let (v318 u32) (mod.unchecked v317 4)) - (assertz 250 v318) - (let (v319 (ptr i32)) (inttoptr v317)) - (store v319 v316) - (let (v320 u32) (bitcast v280)) - (let (v321 u32) (mod.unchecked v320 4)) - (assertz 250 v321) - (let (v322 (ptr i32)) (inttoptr v320)) - (let (v323 i32) (load v322)) - (let (v324 i32) (const.i32 2)) - (let (v325 i32) (bor v323 v324)) - (br (block 24 v280 v325))) - - (block 32 - (let (v311 u32) (bitcast v280)) - (let (v312 u32) (mod.unchecked v311 4)) - (assertz 250 v312) - (let (v313 (ptr i32)) (inttoptr v311)) - (let (v314 i32) (load v313)) - (br (block 24 v280 v314))) - - (block 33 - (br (block 5))) - ) - - (func (export #::alloc) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 16)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 i1) (neq v2 0)) - (condbr v9 (block 3) (block 4))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 (param v98 i32) (param v102 i32) - (let (v99 i32) (const.i32 16)) - (let (v100 i32) (add.wrapping v98 v99)) - (let (v101 (ptr i32)) (global.symbol #__stack_pointer)) - (store v101 v100) - (br (block 1 v102))) - - (block 3 - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (let (v13 i32) (load v12)) - (let (v14 u32) (bitcast v7)) - (let (v15 u32) (add.checked v14 12)) - (let (v16 u32) (mod.unchecked v15 4)) - (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (store v17 v13) - (let (v18 i32) (const.i32 3)) - (let (v19 i32) (add.wrapping v2 v18)) - (let (v20 i32) (const.i32 2)) - (let (v21 u32) (bitcast v19)) - (let (v22 u32) (bitcast v20)) - (let (v23 u32) (shr.wrapping v21 v22)) - (let (v24 i32) (bitcast v23)) - (let (v25 i32) (const.i32 12)) - (let (v26 i32) (add.wrapping v7 v25)) - (let (v27 i32) (call #wee_alloc::alloc_first_fit v24 v1 v26)) - (let (v28 i1) (neq v27 0)) - (condbr v28 (block 5 v0 v7 v27) (block 6))) - - (block 4 - (br (block 2 v7 v1))) - - (block 5 (param v88 i32) (param v89 i32) (param v103 i32) - (let (v90 u32) (bitcast v89)) - (let (v91 u32) (add.checked v90 12)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (let (v94 i32) (load v93)) - (let (v95 u32) (bitcast v88)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (store v97 v94) - (br (block 2 v89 v103))) - - (block 6 - (let (v29 i32) (const.i32 -4)) - (let (v30 i32) (band v19 v29)) - (let (v31 i32) (const.i32 3)) - (let (v32 u32) (bitcast v31)) - (let (v33 i32) (shl.wrapping v1 v32)) - (let (v34 i32) (const.i32 512)) - (let (v35 i32) (add.wrapping v33 v34)) - (let (v36 u32) (bitcast v30)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (gt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (let (v41 i32) (select v40 v30 v35)) - (let (v42 i32) (const.i32 65543)) - (let (v43 i32) (add.wrapping v41 v42)) - (let (v44 i32) (const.i32 16)) - (let (v45 u32) (bitcast v43)) - (let (v46 u32) (bitcast v44)) - (let (v47 u32) (shr.wrapping v45 v46)) - (let (v48 i32) (bitcast v47)) - (let (v49 u32) (bitcast v48)) - (let (v50 i32) (memory.grow v49)) - (let (v51 i32) (const.i32 -1)) - (let (v52 i1) (neq v50 v51)) - (let (v53 i32) (zext v52)) - (let (v54 i1) (neq v53 0)) - (condbr v54 (block 7) (block 8))) - - (block 7 - (let (v56 i32) (const.i32 16)) - (let (v57 u32) (bitcast v56)) - (let (v58 i32) (shl.wrapping v50 v57)) - (let (v59 i32) (const.i32 0)) - (let (v60 u32) (bitcast v58)) - (let (v61 u32) (add.checked v60 4)) - (let (v62 u32) (mod.unchecked v61 4)) - (assertz 250 v62) - (let (v63 (ptr i32)) (inttoptr v61)) - (store v63 v59) - (let (v64 u32) (bitcast v7)) - (let (v65 u32) (add.checked v64 12)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v58)) - (let (v70 u32) (add.checked v69 8)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 i32) (const.i32 -65536)) - (let (v74 i32) (band v43 v73)) - (let (v75 i32) (add.wrapping v58 v74)) - (let (v76 i32) (const.i32 2)) - (let (v77 i32) (bor v75 v76)) - (let (v78 u32) (bitcast v58)) - (let (v79 u32) (mod.unchecked v78 4)) - (assertz 250 v79) - (let (v80 (ptr i32)) (inttoptr v78)) - (store v80 v77) - (let (v81 u32) (bitcast v7)) - (let (v82 u32) (add.checked v81 12)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (store v84 v58) - (let (v85 i32) (const.i32 12)) - (let (v86 i32) (add.wrapping v7 v85)) - (let (v87 i32) (call #wee_alloc::alloc_first_fit v24 v1 v86)) - (br (block 5 v0 v7 v87))) - - (block 8 - (let (v55 i32) (const.i32 0)) - (br (block 5 v0 v7 v55))) - ) - - (func (export #::dealloc) - (param i32) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i1) (eq v1 0)) - (let (v6 i32) (zext v5)) - (let (v7 i1) (neq v6 0)) - (condbr v7 (block 2) (block 3))) - - (block 1 - (ret)) - - (block 2 - (br (block 1))) - - (block 3 - (let (v8 i1) (eq v3 0)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 2) (block 4))) - - (block 4 - (let (v11 u32) (bitcast v0)) - (let (v12 u32) (mod.unchecked v11 4)) - (assertz 250 v12) - (let (v13 (ptr i32)) (inttoptr v11)) - (let (v14 i32) (load v13)) - (let (v15 i32) (const.i32 0)) - (let (v16 u32) (bitcast v1)) - (let (v17 u32) (mod.unchecked v16 4)) - (assertz 250 v17) - (let (v18 (ptr i32)) (inttoptr v16)) - (store v18 v15) - (let (v19 i32) (const.i32 -8)) - (let (v20 i32) (add.wrapping v1 v19)) - (let (v21 u32) (bitcast v20)) - (let (v22 u32) (mod.unchecked v21 4)) - (assertz 250 v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i32) (const.i32 -2)) - (let (v26 i32) (band v24 v25)) - (let (v27 u32) (bitcast v20)) - (let (v28 u32) (mod.unchecked v27 4)) - (assertz 250 v28) - (let (v29 (ptr i32)) (inttoptr v27)) - (store v29 v26) - (let (v30 i32) (const.i32 -4)) - (let (v31 i32) (add.wrapping v1 v30)) - (let (v32 u32) (bitcast v31)) - (let (v33 u32) (mod.unchecked v32 4)) - (assertz 250 v33) - (let (v34 (ptr i32)) (inttoptr v32)) - (let (v35 i32) (load v34)) - (let (v36 i32) (const.i32 -4)) - (let (v37 i32) (band v35 v36)) - (let (v38 i1) (eq v37 0)) - (let (v39 i32) (zext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) - - (block 5 (param v177 i32) (param v183 i32) - (let (v185 u32) (bitcast v177)) - (let (v186 u32) (mod.unchecked v185 4)) - (assertz 250 v186) - (let (v187 (ptr i32)) (inttoptr v185)) - (store v187 v183) - (br (block 2))) - - (block 6 - (param v172 i32) - (param v173 i32) - (param v182 i32) - (param v184 i32) - (let (v174 u32) (bitcast v172)) - (let (v175 u32) (mod.unchecked v174 4)) - (assertz 250 v175) - (let (v176 (ptr i32)) (inttoptr v174)) - (store v176 v173) - (br (block 5 v182 v184))) - - (block 7 (param v168 i32) (param v178 i32) - (br (block 5 v178 v168))) - - (block 8 - (param v134 i32) - (param v150 i32) - (param v161 i32) - (param v171 i32) - (param v181 i32) - (let (v135 i32) (const.i32 2)) - (let (v136 i32) (band v134 v135)) - (let (v137 i1) (neq v136 0)) - (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) - - (block 9 - (let (v41 u32) (bitcast v37)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (let (v44 i32) (load v43)) - (let (v45 i32) (const.i32 1)) - (let (v46 i32) (band v44 v45)) - (let (v47 i1) (neq v46 0)) - (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) - - (block 10 - (let (v48 i32) (const.i32 -4)) - (let (v49 i32) (band v24 v48)) - (let (v50 i1) (neq v49 0)) - (condbr v50 (block 13) (block 14))) - - (block 11 - (param v104 i32) - (param v105 i32) - (param v111 i32) - (param v112 i32) - (param v123 i32) - (param v169 i32) - (param v179 i32) - (let (v106 i32) (const.i32 3)) - (let (v107 i32) (band v105 v106)) - (let (v108 u32) (bitcast v104)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (store v110 v107) - (let (v113 i32) (const.i32 3)) - (let (v114 i32) (band v112 v113)) - (let (v115 u32) (bitcast v111)) - (let (v116 u32) (mod.unchecked v115 4)) - (assertz 250 v116) - (let (v117 (ptr i32)) (inttoptr v115)) - (store v117 v114) - (let (v118 i32) (const.i32 2)) - (let (v119 i32) (band v112 v118)) - (let (v120 i1) (eq v119 0)) - (let (v121 i32) (zext v120)) - (let (v122 i1) (neq v121 0)) - (condbr v122 (block 7 v169 v179) (block 17))) - - (block 12 - (param v83 i32) - (param v84 i32) - (param v87 i32) - (param v94 i32) - (param v99 i32) - (param v124 i32) - (param v170 i32) - (param v180 i32) - (let (v85 i32) (const.i32 -4)) - (let (v86 i32) (band v84 v85)) - (let (v88 i32) (const.i32 3)) - (let (v89 i32) (band v87 v88)) - (let (v90 i32) (bor v86 v89)) - (let (v91 u32) (bitcast v83)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (store v93 v90) - (let (v95 u32) (bitcast v94)) - (let (v96 u32) (mod.unchecked v95 4)) - (assertz 250 v96) - (let (v97 (ptr i32)) (inttoptr v95)) - (let (v98 i32) (load v97)) - (let (v100 u32) (bitcast v99)) - (let (v101 u32) (mod.unchecked v100 4)) - (assertz 250 v101) - (let (v102 (ptr i32)) (inttoptr v100)) - (let (v103 i32) (load v102)) - (br (block 11 v94 v98 v99 v103 v124 v170 v180))) - - (block 13 - (let (v51 i32) (const.i32 2)) - (let (v52 i32) (band v24 v51)) - (let (v53 i1) (neq v52 0)) - (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) - - (block 14 - (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) - - (block 15 - (let (v54 u32) (bitcast v49)) - (let (v55 u32) (add.checked v54 4)) - (let (v56 u32) (mod.unchecked v55 4)) - (assertz 250 v56) - (let (v57 (ptr i32)) (inttoptr v55)) - (let (v58 i32) (load v57)) - (let (v59 i32) (const.i32 3)) - (let (v60 i32) (band v58 v59)) - (let (v61 i32) (bor v60 v37)) - (let (v62 u32) (bitcast v49)) - (let (v63 u32) (add.checked v62 4)) - (let (v64 u32) (mod.unchecked v63 4)) - (assertz 250 v64) - (let (v65 (ptr i32)) (inttoptr v63)) - (store v65 v61) - (let (v66 u32) (bitcast v20)) - (let (v67 u32) (mod.unchecked v66 4)) - (assertz 250 v67) - (let (v68 (ptr i32)) (inttoptr v66)) - (let (v69 i32) (load v68)) - (let (v70 u32) (bitcast v31)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (let (v74 i32) (const.i32 -4)) - (let (v75 i32) (band v73 v74)) - (let (v76 i1) (eq v75 0)) - (let (v77 i32) (zext v76)) - (let (v78 i1) (neq v77 0)) - (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) - - (block 16 - (let (v79 u32) (bitcast v75)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) - - (block 17 - (let (v125 u32) (bitcast v123)) - (let (v126 u32) (mod.unchecked v125 4)) - (assertz 250 v126) - (let (v127 (ptr i32)) (inttoptr v125)) - (let (v128 i32) (load v127)) - (let (v129 i32) (const.i32 2)) - (let (v130 i32) (bor v128 v129)) - (let (v131 u32) (bitcast v123)) - (let (v132 u32) (mod.unchecked v131 4)) - (assertz 250 v132) - (let (v133 (ptr i32)) (inttoptr v131)) - (store v133 v130) - (br (block 7 v169 v179))) - - (block 18 - (let (v138 i32) (const.i32 -4)) - (let (v139 i32) (band v134 v138)) - (let (v140 i1) (eq v139 0)) - (let (v141 i32) (zext v140)) - (let (v142 i1) (neq v141 0)) - (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) - - (block 19 - (let (v143 u32) (bitcast v139)) - (let (v144 (ptr u8)) (inttoptr v143)) - (let (v145 u8) (load v144)) - (let (v146 i32) (zext v145)) - (let (v147 i32) (const.i32 1)) - (let (v148 i32) (band v146 v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) - - (block 20 - (let (v151 u32) (bitcast v139)) - (let (v152 u32) (add.checked v151 8)) - (let (v153 u32) (mod.unchecked v152 4)) - (assertz 250 v153) - (let (v154 (ptr i32)) (inttoptr v152)) - (let (v155 i32) (load v154)) - (let (v156 i32) (const.i32 -4)) - (let (v157 i32) (band v155 v156)) - (let (v158 u32) (bitcast v150)) - (let (v159 u32) (mod.unchecked v158 4)) - (assertz 250 v159) - (let (v160 (ptr i32)) (inttoptr v158)) - (store v160 v157) - (let (v162 i32) (const.i32 1)) - (let (v163 i32) (bor v161 v162)) - (let (v164 u32) (bitcast v139)) - (let (v165 u32) (add.checked v164 8)) - (let (v166 u32) (mod.unchecked v165 4)) - (assertz 250 v166) - (let (v167 (ptr i32)) (inttoptr v165)) - (store v167 v163) - (br (block 7 v171 v181))) - ) - - (func (export #core::panicking::panic_fmt) - (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v2 i32) (const.i32 0)) - (let (v3 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v4 i32) (const.i32 32)) - (let (v5 i32) (sub.wrapping v3 v4)) - (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) - (store v6 v5) - (let (v7 i32) (const.i32 16)) - (let (v8 i32) (add.wrapping v5 v7)) - (let (v9 i32) (const.i32 16)) - (let (v10 i32) (add.wrapping v0 v9)) - (let (v11 u32) (bitcast v10)) - (let (v12 u32) (mod.unchecked v11 4)) - (assertz 250 v12) - (let (v13 (ptr i64)) (inttoptr v11)) - (let (v14 i64) (load v13)) - (let (v15 u32) (bitcast v8)) - (let (v16 u32) (mod.unchecked v15 8)) - (assertz 250 v16) - (let (v17 (ptr i64)) (inttoptr v15)) - (store v17 v14) - (let (v18 i32) (const.i32 8)) - (let (v19 i32) (add.wrapping v5 v18)) - (let (v20 i32) (const.i32 8)) - (let (v21 i32) (add.wrapping v0 v20)) - (let (v22 u32) (bitcast v21)) - (let (v23 u32) (mod.unchecked v22 4)) - (assertz 250 v23) - (let (v24 (ptr i64)) (inttoptr v22)) - (let (v25 i64) (load v24)) - (let (v26 u32) (bitcast v19)) - (let (v27 u32) (mod.unchecked v26 8)) - (assertz 250 v27) - (let (v28 (ptr i64)) (inttoptr v26)) - (store v28 v25) - (let (v29 i32) (const.i32 1)) - (let (v30 u32) (bitcast v29)) - (let (v31 u16) (trunc v30)) - (let (v32 u32) (bitcast v5)) - (let (v33 u32) (add.checked v32 28)) - (let (v34 u32) (mod.unchecked v33 2)) - (assertz 250 v34) - (let (v35 (ptr u16)) (inttoptr v33)) - (store v35 v31) - (let (v36 u32) (bitcast v5)) - (let (v37 u32) (add.checked v36 24)) - (let (v38 u32) (mod.unchecked v37 4)) - (assertz 250 v38) - (let (v39 (ptr i32)) (inttoptr v37)) - (store v39 v1) - (let (v40 u32) (bitcast v0)) - (let (v41 u32) (mod.unchecked v40 4)) - (assertz 250 v41) - (let (v42 (ptr i64)) (inttoptr v40)) - (let (v43 i64) (load v42)) - (let (v44 u32) (bitcast v5)) - (let (v45 u32) (mod.unchecked v44 8)) - (assertz 250 v45) - (let (v46 (ptr i64)) (inttoptr v44)) - (store v46 v43) - (call #rust_begin_unwind v5) - (unreachable)) - - (block 1) - ) - - (func (export #core::slice::index::slice_start_index_len_fail) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i64) (const.i64 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 48)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 u32) (bitcast v7)) - (let (v10 u32) (mod.unchecked v9 4)) - (assertz 250 v10) - (let (v11 (ptr i32)) (inttoptr v9)) - (store v11 v0) - (let (v12 u32) (bitcast v7)) - (let (v13 u32) (add.checked v12 4)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v1) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v7)) - (let (v18 u32) (add.checked v17 12)) - (let (v19 u32) (mod.unchecked v18 4)) - (assertz 250 v19) - (let (v20 (ptr i32)) (inttoptr v18)) - (store v20 v16) - (let (v21 i32) (const.i32 1049264)) - (let (v22 u32) (bitcast v7)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (store v25 v21) - (let (v26 i64) (const.i64 2)) - (let (v27 u32) (bitcast v7)) - (let (v28 u32) (add.checked v27 20)) - (let (v29 u32) (mod.unchecked v28 4)) - (assertz 250 v29) - (let (v30 (ptr i64)) (inttoptr v28)) - (store v30 v26) - (let (v31 i32) (const.i32 6)) - (let (v32 u32) (bitcast v31)) - (let (v33 u64) (zext v32)) - (let (v34 i64) (bitcast v33)) - (let (v35 i64) (const.i64 32)) - (let (v36 u32) (cast v35)) - (let (v37 i64) (shl.wrapping v34 v36)) - (let (v38 i32) (const.i32 4)) - (let (v39 i32) (add.wrapping v7 v38)) - (let (v40 u32) (bitcast v39)) - (let (v41 u64) (zext v40)) - (let (v42 i64) (bitcast v41)) - (let (v43 i64) (bor v37 v42)) - (let (v44 u32) (bitcast v7)) - (let (v45 u32) (add.checked v44 40)) - (let (v46 u32) (mod.unchecked v45 8)) - (assertz 250 v46) - (let (v47 (ptr i64)) (inttoptr v45)) - (store v47 v43) - (let (v48 u32) (bitcast v7)) - (let (v49 u64) (zext v48)) - (let (v50 i64) (bitcast v49)) - (let (v51 i64) (bor v37 v50)) - (let (v52 u32) (bitcast v7)) - (let (v53 u32) (add.checked v52 32)) - (let (v54 u32) (mod.unchecked v53 8)) - (assertz 250 v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v51) - (let (v56 i32) (const.i32 32)) - (let (v57 i32) (add.wrapping v7 v56)) - (let (v58 u32) (bitcast v7)) - (let (v59 u32) (add.checked v58 16)) - (let (v60 u32) (mod.unchecked v59 4)) - (assertz 250 v60) - (let (v61 (ptr i32)) (inttoptr v59)) - (store v61 v57) - (let (v62 i32) (const.i32 8)) - (let (v63 i32) (add.wrapping v7 v62)) - (call #core::panicking::panic_fmt v63 v2) - (unreachable)) - - (block 1) - ) - - (func (export #core::panicking::panic_bounds_check) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i64) (const.i64 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 48)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 u32) (bitcast v7)) - (let (v10 u32) (add.checked v9 4)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (store v12 v1) - (let (v13 u32) (bitcast v7)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v0) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v7)) - (let (v18 u32) (add.checked v17 12)) - (let (v19 u32) (mod.unchecked v18 4)) - (assertz 250 v19) - (let (v20 (ptr i32)) (inttoptr v18)) - (store v20 v16) - (let (v21 i32) (const.i32 1048768)) - (let (v22 u32) (bitcast v7)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (store v25 v21) - (let (v26 i64) (const.i64 2)) - (let (v27 u32) (bitcast v7)) - (let (v28 u32) (add.checked v27 20)) - (let (v29 u32) (mod.unchecked v28 4)) - (assertz 250 v29) - (let (v30 (ptr i64)) (inttoptr v28)) - (store v30 v26) - (let (v31 i32) (const.i32 6)) - (let (v32 u32) (bitcast v31)) - (let (v33 u64) (zext v32)) - (let (v34 i64) (bitcast v33)) - (let (v35 i64) (const.i64 32)) - (let (v36 u32) (cast v35)) - (let (v37 i64) (shl.wrapping v34 v36)) - (let (v38 u32) (bitcast v7)) - (let (v39 u64) (zext v38)) - (let (v40 i64) (bitcast v39)) - (let (v41 i64) (bor v37 v40)) - (let (v42 u32) (bitcast v7)) - (let (v43 u32) (add.checked v42 40)) - (let (v44 u32) (mod.unchecked v43 8)) - (assertz 250 v44) - (let (v45 (ptr i64)) (inttoptr v43)) - (store v45 v41) - (let (v46 i32) (const.i32 4)) - (let (v47 i32) (add.wrapping v7 v46)) - (let (v48 u32) (bitcast v47)) - (let (v49 u64) (zext v48)) - (let (v50 i64) (bitcast v49)) - (let (v51 i64) (bor v37 v50)) - (let (v52 u32) (bitcast v7)) - (let (v53 u32) (add.checked v52 32)) - (let (v54 u32) (mod.unchecked v53 8)) - (assertz 250 v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v51) - (let (v56 i32) (const.i32 32)) - (let (v57 i32) (add.wrapping v7 v56)) - (let (v58 u32) (bitcast v7)) - (let (v59 u32) (add.checked v58 16)) - (let (v60 u32) (mod.unchecked v59 4)) - (assertz 250 v60) - (let (v61 (ptr i32)) (inttoptr v59)) - (store v61 v57) - (let (v62 i32) (const.i32 8)) - (let (v63 i32) (add.wrapping v7 v62)) - (call #core::panicking::panic_fmt v63 v2) - (unreachable)) - - (block 1) - ) - - (func (export #core::fmt::Formatter::pad) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 u32) (bitcast v0)) - (let (v6 u32) (add.checked v5 8)) - (let (v7 u32) (mod.unchecked v6 4)) - (assertz 250 v7) - (let (v8 (ptr i32)) (inttoptr v6)) - (let (v9 i32) (load v8)) - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (let (v13 i32) (load v12)) - (let (v14 i1) (neq v13 0)) - (condbr v14 (block 3 v9 v1 v2 v0 v13) (block 4))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 - (let (v415 u32) (bitcast v0)) - (let (v416 u32) (add.checked v415 20)) - (let (v417 u32) (mod.unchecked v416 4)) - (assertz 250 v417) - (let (v418 (ptr i32)) (inttoptr v416)) - (let (v419 i32) (load v418)) - (let (v420 u32) (bitcast v0)) - (let (v421 u32) (add.checked v420 24)) - (let (v422 u32) (mod.unchecked v421 4)) - (assertz 250 v422) - (let (v423 (ptr i32)) (inttoptr v421)) - (let (v424 i32) (load v423)) - (let (v425 u32) (bitcast v424)) - (let (v426 u32) (add.checked v425 12)) - (let (v427 u32) (mod.unchecked v426 4)) - (assertz 250 v427) - (let (v428 (ptr i32)) (inttoptr v426)) - (let (v429 i32) (load v428)) - (br (block 1 v429))) - - (block 3 - (param v20 i32) - (param v26 i32) - (param v27 i32) - (param v29 i32) - (param v145 i32) - (let (v21 i32) (const.i32 1)) - (let (v22 i32) (band v20 v21)) - (let (v23 i1) (eq v22 0)) - (let (v24 i32) (zext v23)) - (let (v25 i1) (neq v24 0)) - (condbr v25 (block 6 v145 v29 v26 v27) (block 7))) - - (block 4 - (let (v15 i32) (const.i32 1)) - (let (v16 i32) (band v9 v15)) - (let (v17 i1) (eq v16 0)) - (let (v18 i32) (zext v17)) - (let (v19 i1) (neq v18 0)) - (condbr v19 (block 2) (block 5))) - - (block 5 - (br (block 3 v9 v1 v2 v0 v13))) - - (block 6 - (param v144 i32) - (param v153 i32) - (param v165 i32) - (param v166 i32) - (let (v152 i1) (neq v144 0)) - (condbr v152 (block 32) (block 33))) - - (block 7 - (let (v28 i32) (add.wrapping v26 v27)) - (let (v30 u32) (bitcast v29)) - (let (v31 u32) (add.checked v30 12)) - (let (v32 u32) (mod.unchecked v31 4)) - (assertz 250 v32) - (let (v33 (ptr i32)) (inttoptr v31)) - (let (v34 i32) (load v33)) - (let (v35 i1) (neq v34 0)) - (condbr v35 (block 9) (block 10))) - - (block 8 - (param v83 i32) - (param v84 i32) - (param v102 i32) - (param v107 i32) - (param v116 i32) - (param v148 i32) - (param v156 i32) - (let (v85 i1) (eq v83 v84)) - (let (v86 i32) (zext v85)) - (let (v87 i1) (neq v86 0)) - (condbr v87 (block 6 v148 v156 v116 v107) (block 22))) - - (block 9 - (let (v37 i32) (const.i32 0)) - (br (block 11 v26 v28 v37 v34 v27 v26 v145 v29))) - - (block 10 - (let (v36 i32) (const.i32 0)) - (br (block 8 v26 v28 v36 v27 v26 v145 v29))) - - (block 11 - (param v38 i32) - (param v39 i32) - (param v75 i32) - (param v78 i32) - (param v109 i32) - (param v118 i32) - (param v146 i32) - (param v154 i32) - (let (v40 i1) (eq v38 v39)) - (let (v41 i32) (zext v40)) - (let (v42 i1) (neq v41 0)) - (condbr v42 (block 6 v146 v154 v118 v109) (block 13))) - - (block 12 - (br (block 8 v71 v82 v76 v108 v117 v147 v155))) - - (block 13 - (let (v43 u32) (bitcast v38)) - (let (v44 (ptr i8)) (inttoptr v43)) - (let (v45 i8) (load v44)) - (let (v46 i32) (sext v45)) - (let (v47 i32) (const.i32 -1)) - (let (v48 i1) (lte v46 v47)) - (let (v49 i32) (sext v48)) - (let (v50 i1) (neq v49 0)) - (condbr v50 (block 15) (block 16))) - - (block 14 - (param v71 i32) - (param v72 i32) - (param v74 i32) - (param v77 i32) - (param v82 i32) - (param v108 i32) - (param v117 i32) - (param v147 i32) - (param v155 i32) - (let (v73 i32) (sub.wrapping v71 v72)) - (let (v76 i32) (add.wrapping v73 v74)) - (let (v79 i32) (const.i32 -1)) - (let (v80 i32) (add.wrapping v77 v79)) - (let (v81 i1) (neq v80 0)) - (condbr v81 (block 11 v71 v82 v76 v80 v108 v117 v147 v155) (block 21))) - - (block 15 - (let (v53 i32) (const.i32 -32)) - (let (v54 u32) (bitcast v46)) - (let (v55 u32) (bitcast v53)) - (let (v56 i1) (gte v54 v55)) - (let (v57 i32) (zext v56)) - (let (v58 i1) (neq v57 0)) - (condbr v58 (block 17) (block 18))) - - (block 16 - (let (v51 i32) (const.i32 1)) - (let (v52 i32) (add.wrapping v38 v51)) - (br (block 14 v52 v38 v75 v78 v39 v109 v118 v146 v154))) - - (block 17 - (let (v61 i32) (const.i32 -16)) - (let (v62 u32) (bitcast v46)) - (let (v63 u32) (bitcast v61)) - (let (v64 i1) (gte v62 v63)) - (let (v65 i32) (zext v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 19) (block 20))) - - (block 18 - (let (v59 i32) (const.i32 2)) - (let (v60 i32) (add.wrapping v38 v59)) - (br (block 14 v60 v38 v75 v78 v39 v109 v118 v146 v154))) - - (block 19 - (let (v69 i32) (const.i32 4)) - (let (v70 i32) (add.wrapping v38 v69)) - (br (block 14 v70 v38 v75 v78 v39 v109 v118 v146 v154))) - - (block 20 - (let (v67 i32) (const.i32 3)) - (let (v68 i32) (add.wrapping v38 v67)) - (br (block 14 v68 v38 v75 v78 v39 v109 v118 v146 v154))) - - (block 21 - (br (block 12))) - - (block 22 - (let (v88 u32) (bitcast v83)) - (let (v89 (ptr i8)) (inttoptr v88)) - (let (v90 i8) (load v89)) - (let (v91 i32) (sext v90)) - (let (v92 i32) (const.i32 -1)) - (let (v93 i1) (gt v91 v92)) - (let (v94 i32) (zext v93)) - (let (v95 i1) (neq v94 0)) - (condbr v95 (block 23 v102 v107 v116 v148 v156) (block 24))) - - (block 23 - (param v101 i32) - (param v106 i32) - (param v115 i32) - (param v150 i32) - (param v158 i32) - (let (v103 i1) (eq v101 0)) - (let (v104 i32) (zext v103)) - (let (v105 i1) (neq v104 0)) - (condbr v105 (block 26 v115 v101 v106 v150 v158) (block 27))) - - (block 24 - (let (v96 i32) (const.i32 -32)) - (let (v97 u32) (bitcast v91)) - (let (v98 u32) (bitcast v96)) - (let (v99 i1) (lt v97 v98)) - (let (v100 i32) (sext v99)) - (br (block 23 v102 v107 v116 v148 v156))) - - (block 25 - (param v134 i32) - (param v136 i32) - (param v138 i32) - (param v141 i32) - (param v149 i32) - (param v157 i32) - (let (v139 i1) (neq v138 0)) - (let (v140 i32) (select v139 v134 v136)) - (let (v142 i1) (neq v138 0)) - (let (v143 i32) (select v142 v138 v141)) - (br (block 6 v149 v157 v143 v140))) - - (block 26 - (param v133 i32) - (param v135 i32) - (param v137 i32) - (param v151 i32) - (param v159 i32) - (br (block 25 v135 v137 v133 v133 v151 v159))) - - (block 27 - (let (v110 u32) (bitcast v101)) - (let (v111 u32) (bitcast v106)) - (let (v112 i1) (gte v110 v111)) - (let (v113 i32) (zext v112)) - (let (v114 i1) (neq v113 0)) - (condbr v114 (block 28) (block 29))) - - (block 28 - (let (v129 i1) (eq v101 v106)) - (let (v130 i32) (zext v129)) - (let (v131 i1) (neq v130 0)) - (condbr v131 (block 26 v115 v101 v106 v150 v158) (block 31))) - - (block 29 - (let (v119 i32) (add.wrapping v115 v101)) - (let (v120 u32) (bitcast v119)) - (let (v121 (ptr i8)) (inttoptr v120)) - (let (v122 i8) (load v121)) - (let (v123 i32) (sext v122)) - (let (v124 i32) (const.i32 -65)) - (let (v125 i1) (gt v123 v124)) - (let (v126 i32) (zext v125)) - (let (v127 i1) (neq v126 0)) - (condbr v127 (block 26 v115 v101 v106 v150 v158) (block 30))) - - (block 30 - (let (v128 i32) (const.i32 0)) - (br (block 25 v101 v106 v128 v115 v150 v158))) - - (block 31 - (let (v132 i32) (const.i32 0)) - (br (block 25 v101 v106 v132 v115 v150 v158))) - - (block 32 - (let (v177 u32) (bitcast v153)) - (let (v178 u32) (add.checked v177 4)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (let (v181 i32) (load v180)) - (let (v182 i32) (const.i32 16)) - (let (v183 u32) (bitcast v166)) - (let (v184 u32) (bitcast v182)) - (let (v185 i1) (lt v183 v184)) - (let (v186 i32) (sext v185)) - (let (v187 i1) (neq v186 0)) - (condbr v187 (block 35) (block 36))) - - (block 33 - (let (v160 u32) (bitcast v153)) - (let (v161 u32) (add.checked v160 20)) - (let (v162 u32) (mod.unchecked v161 4)) - (assertz 250 v162) - (let (v163 (ptr i32)) (inttoptr v161)) - (let (v164 i32) (load v163)) - (let (v167 u32) (bitcast v153)) - (let (v168 u32) (add.checked v167 24)) - (let (v169 u32) (mod.unchecked v168 4)) - (assertz 250 v169) - (let (v170 (ptr i32)) (inttoptr v168)) - (let (v171 i32) (load v170)) - (let (v172 u32) (bitcast v171)) - (let (v173 u32) (add.checked v172 12)) - (let (v174 u32) (mod.unchecked v173 4)) - (assertz 250 v174) - (let (v175 (ptr i32)) (inttoptr v173)) - (let (v176 i32) (load v175)) - (ret v176)) - - (block 34 - (param v278 i32) - (param v282 i32) - (param v290 i32) - (param v355 i32) - (param v357 i32) - (let (v283 u32) (bitcast v278)) - (let (v284 u32) (bitcast v282)) - (let (v285 i1) (lte v283 v284)) - (let (v286 i32) (sext v285)) - (let (v287 i1) (neq v286 0)) - (condbr v287 (block 50) (block 51))) - - (block 35 - (let (v189 i1) (neq v166 0)) - (condbr v189 (block 37) (block 38))) - - (block 36 - (let (v188 i32) (call #core::str::count::do_count_chars v165 v166)) - (br (block 34 v181 v188 v153 v165 v166))) - - (block 37 - (let (v191 i32) (const.i32 3)) - (let (v192 i32) (band v166 v191)) - (let (v193 i32) (const.i32 4)) - (let (v194 u32) (bitcast v166)) - (let (v195 u32) (bitcast v193)) - (let (v196 i1) (gte v194 v195)) - (let (v197 i32) (zext v196)) - (let (v198 i1) (neq v197 0)) - (condbr v198 (block 40) (block 41))) - - (block 38 - (let (v190 i32) (const.i32 0)) - (br (block 34 v181 v190 v153 v165 v166))) - - (block 39 - (param v253 i32) - (param v258 i32) - (param v259 i32) - (param v277 i32) - (param v279 i32) - (param v291 i32) - (param v358 i32) - (let (v255 i1) (eq v253 0)) - (let (v256 i32) (zext v255)) - (let (v257 i1) (neq v256 0)) - (condbr v257 (block 34 v279 v277 v291 v258 v358) (block 45))) - - (block 40 - (let (v201 i32) (const.i32 12)) - (let (v202 i32) (band v166 v201)) - (let (v203 i32) (const.i32 0)) - (let (v204 i32) (const.i32 0)) - (br (block 42 v203 v165 v204 v202 v192 v181 v153 v166))) - - (block 41 - (let (v199 i32) (const.i32 0)) - (let (v200 i32) (const.i32 0)) - (br (block 39 v192 v165 v200 v199 v181 v153 v166))) - - (block 42 - (param v205 i32) - (param v206 i32) - (param v207 i32) - (param v247 i32) - (param v254 i32) - (param v280 i32) - (param v292 i32) - (param v359 i32) - (let (v208 i32) (add.wrapping v206 v207)) - (let (v209 u32) (bitcast v208)) - (let (v210 (ptr i8)) (inttoptr v209)) - (let (v211 i8) (load v210)) - (let (v212 i32) (sext v211)) - (let (v213 i32) (const.i32 -65)) - (let (v214 i1) (gt v212 v213)) - (let (v215 i32) (zext v214)) - (let (v216 i32) (add.wrapping v205 v215)) - (let (v217 i32) (const.i32 1)) - (let (v218 i32) (add.wrapping v208 v217)) - (let (v219 u32) (bitcast v218)) - (let (v220 (ptr i8)) (inttoptr v219)) - (let (v221 i8) (load v220)) - (let (v222 i32) (sext v221)) - (let (v223 i32) (const.i32 -65)) - (let (v224 i1) (gt v222 v223)) - (let (v225 i32) (zext v224)) - (let (v226 i32) (add.wrapping v216 v225)) - (let (v227 i32) (const.i32 2)) - (let (v228 i32) (add.wrapping v208 v227)) - (let (v229 u32) (bitcast v228)) - (let (v230 (ptr i8)) (inttoptr v229)) - (let (v231 i8) (load v230)) - (let (v232 i32) (sext v231)) - (let (v233 i32) (const.i32 -65)) - (let (v234 i1) (gt v232 v233)) - (let (v235 i32) (zext v234)) - (let (v236 i32) (add.wrapping v226 v235)) - (let (v237 i32) (const.i32 3)) - (let (v238 i32) (add.wrapping v208 v237)) - (let (v239 u32) (bitcast v238)) - (let (v240 (ptr i8)) (inttoptr v239)) - (let (v241 i8) (load v240)) - (let (v242 i32) (sext v241)) - (let (v243 i32) (const.i32 -65)) - (let (v244 i1) (gt v242 v243)) - (let (v245 i32) (zext v244)) - (let (v246 i32) (add.wrapping v236 v245)) - (let (v248 i32) (const.i32 4)) - (let (v249 i32) (add.wrapping v207 v248)) - (let (v250 i1) (neq v247 v249)) - (let (v251 i32) (zext v250)) - (let (v252 i1) (neq v251 0)) - (condbr v252 (block 42 v246 v206 v249 v247 v254 v280 v292 v359) (block 44))) - - (block 43 - (br (block 39 v254 v206 v249 v246 v280 v292 v359))) - - (block 44 - (br (block 43))) - - (block 45 - (let (v260 i32) (add.wrapping v258 v259)) - (br (block 46 v277 v260 v253 v279 v291 v258 v358))) - - (block 46 - (param v261 i32) - (param v262 i32) - (param v273 i32) - (param v281 i32) - (param v293 i32) - (param v356 i32) - (param v360 i32) - (let (v263 u32) (bitcast v262)) - (let (v264 (ptr i8)) (inttoptr v263)) - (let (v265 i8) (load v264)) - (let (v266 i32) (sext v265)) - (let (v267 i32) (const.i32 -65)) - (let (v268 i1) (gt v266 v267)) - (let (v269 i32) (zext v268)) - (let (v270 i32) (add.wrapping v261 v269)) - (let (v271 i32) (const.i32 1)) - (let (v272 i32) (add.wrapping v262 v271)) - (let (v274 i32) (const.i32 -1)) - (let (v275 i32) (add.wrapping v273 v274)) - (let (v276 i1) (neq v275 0)) - (condbr v276 (block 46 v270 v272 v275 v281 v293 v356 v360) (block 48))) - - (block 47 - (br (block 34 v281 v270 v293 v356 v360))) - - (block 48 - (br (block 47))) - - (block 49 - (let (v375 u32) (bitcast v340)) - (let (v376 u32) (add.checked v375 12)) - (let (v377 u32) (mod.unchecked v376 4)) - (assertz 250 v377) - (let (v378 (ptr i32)) (inttoptr v376)) - (let (v379 i32) (load v378)) - (let (v380 i1) (eq v379 0)) - (let (v381 i32) (zext v380)) - (let (v382 i1) (neq v381 0)) - (condbr v382 (block 59) (block 60))) - - (block 50 - (let (v350 u32) (bitcast v290)) - (let (v351 u32) (add.checked v350 20)) - (let (v352 u32) (mod.unchecked v351 4)) - (assertz 250 v352) - (let (v353 (ptr i32)) (inttoptr v351)) - (let (v354 i32) (load v353)) - (let (v361 u32) (bitcast v290)) - (let (v362 u32) (add.checked v361 24)) - (let (v363 u32) (mod.unchecked v362 4)) - (assertz 250 v363) - (let (v364 (ptr i32)) (inttoptr v362)) - (let (v365 i32) (load v364)) - (let (v366 u32) (bitcast v365)) - (let (v367 u32) (add.checked v366 12)) - (let (v368 u32) (mod.unchecked v367 4)) - (assertz 250 v368) - (let (v369 (ptr i32)) (inttoptr v367)) - (let (v370 i32) (load v369)) - (ret v370)) - - (block 51 - (let (v288 i32) (sub.wrapping v278 v282)) - (let (v289 i32) (const.i32 0)) - (let (v294 u32) (bitcast v290)) - (let (v295 u32) (add.checked v294 32)) - (let (v296 (ptr u8)) (inttoptr v295)) - (let (v297 u8) (load v296)) - (let (v298 i32) (zext v297)) - (let (v299 u32) (cast v298)) - (switchv299 - (0 . (block 54)) - (1 . (block 53)) - (2 . (block 52 v289 v290 v355 v357 v288)) - (3 . (block 52 v289 v290 v355 v357 v288)) - (_ . (block 52 v289 v290 v355 v357 v288)))) - - (block 52 - (param v313 i32) - (param v316 i32) - (param v372 i32) - (param v374 i32) - (param v408 i32) - (let (v314 i32) (const.i32 1)) - (let (v315 i32) (add.wrapping v313 v314)) - (let (v317 u32) (bitcast v316)) - (let (v318 u32) (add.checked v317 16)) - (let (v319 u32) (mod.unchecked v318 4)) - (assertz 250 v319) - (let (v320 (ptr i32)) (inttoptr v318)) - (let (v321 i32) (load v320)) - (let (v322 u32) (bitcast v316)) - (let (v323 u32) (add.checked v322 24)) - (let (v324 u32) (mod.unchecked v323 4)) - (assertz 250 v324) - (let (v325 (ptr i32)) (inttoptr v323)) - (let (v326 i32) (load v325)) - (let (v327 u32) (bitcast v316)) - (let (v328 u32) (add.checked v327 20)) - (let (v329 u32) (mod.unchecked v328 4)) - (assertz 250 v329) - (let (v330 (ptr i32)) (inttoptr v328)) - (let (v331 i32) (load v330)) - (br (block 55 v315 v331 v321 v326 v372 v374 v408))) - - (block 53 - (let (v301 i32) (const.i32 1)) - (let (v302 u32) (bitcast v288)) - (let (v303 u32) (bitcast v301)) - (let (v304 u32) (shr.wrapping v302 v303)) - (let (v305 i32) (bitcast v304)) - (let (v306 i32) (const.i32 1)) - (let (v307 i32) (add.wrapping v288 v306)) - (let (v308 i32) (const.i32 1)) - (let (v309 u32) (bitcast v307)) - (let (v310 u32) (bitcast v308)) - (let (v311 u32) (shr.wrapping v309 v310)) - (let (v312 i32) (bitcast v311)) - (br (block 52 v305 v290 v355 v357 v312))) - - (block 54 - (let (v300 i32) (const.i32 0)) - (br (block 52 v288 v290 v355 v357 v300))) - - (block 55 - (param v332 i32) - (param v338 i32) - (param v339 i32) - (param v340 i32) - (param v371 i32) - (param v373 i32) - (param v407 i32) - (let (v333 i32) (const.i32 -1)) - (let (v334 i32) (add.wrapping v332 v333)) - (let (v335 i1) (eq v334 0)) - (let (v336 i32) (zext v335)) - (let (v337 i1) (neq v336 0)) - (condbr v337 (block 49) (block 57))) - - (block 56 - (let (v349 i32) (const.i32 1)) - (ret v349)) - - (block 57 - (let (v341 u32) (bitcast v340)) - (let (v342 u32) (add.checked v341 16)) - (let (v343 u32) (mod.unchecked v342 4)) - (assertz 250 v343) - (let (v344 (ptr i32)) (inttoptr v342)) - (let (v345 i32) (load v344)) - (let (v346 i1) (eq v345 0)) - (let (v347 i32) (zext v346)) - (let (v348 i1) (neq v347 0)) - (condbr v348 (block 55 v334 v338 v339 v340 v371 v373 v407) (block 58))) - - (block 58 - (br (block 56))) - - (block 59 - (let (v384 i32) (const.i32 0)) - (br (block 61 v407 v384 v338 v339 v340))) - - (block 60 - (let (v383 i32) (const.i32 1)) - (ret v383)) - - (block 61 - (param v385 i32) - (param v386 i32) - (param v396 i32) - (param v397 i32) - (param v398 i32) - (let (v387 i1) (neq v385 v386)) - (let (v388 i32) (zext v387)) - (let (v389 i1) (neq v388 0)) - (condbr v389 (block 63) (block 64))) - - (block 62 - (let (v409 i32) (const.i32 -1)) - (let (v410 i32) (add.wrapping v395 v409)) - (let (v411 u32) (bitcast v410)) - (let (v412 u32) (bitcast v385)) - (let (v413 i1) (lt v411 v412)) - (let (v414 i32) (sext v413)) - (ret v414)) - - (block 63 - (let (v394 i32) (const.i32 1)) - (let (v395 i32) (add.wrapping v386 v394)) - (let (v399 u32) (bitcast v398)) - (let (v400 u32) (add.checked v399 16)) - (let (v401 u32) (mod.unchecked v400 4)) - (assertz 250 v401) - (let (v402 (ptr i32)) (inttoptr v400)) - (let (v403 i32) (load v402)) - (let (v404 i1) (eq v403 0)) - (let (v405 i32) (zext v404)) - (let (v406 i1) (neq v405 0)) - (condbr v406 (block 61 v385 v395 v396 v397 v398) (block 65))) - - (block 64 - (let (v390 u32) (bitcast v385)) - (let (v391 u32) (bitcast v385)) - (let (v392 i1) (lt v390 v391)) - (let (v393 i32) (sext v392)) - (ret v393)) - - (block 65 - (br (block 62))) - ) - - (func (export #core::fmt::num::imp::::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (mod.unchecked v3 4)) - (assertz 250 v4) - (let (v5 (ptr u32)) (inttoptr v3)) - (let (v6 u32) (load v5)) - (let (v7 i64) (zext v6)) - (let (v8 i32) (const.i32 1)) - (let (v9 i32) (call #core::fmt::num::imp::fmt_u64 v7 v8 v1)) - (br (block 1 v9))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #core::fmt::write) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 48)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 i32) (const.i32 3)) - (let (v10 u32) (bitcast v9)) - (let (v11 u8) (trunc v10)) - (let (v12 u32) (bitcast v7)) - (let (v13 u32) (add.checked v12 44)) - (let (v14 (ptr u8)) (inttoptr v13)) - (store v14 v11) - (let (v15 i32) (const.i32 32)) - (let (v16 u32) (bitcast v7)) - (let (v17 u32) (add.checked v16 28)) - (let (v18 u32) (mod.unchecked v17 4)) - (assertz 250 v18) - (let (v19 (ptr i32)) (inttoptr v17)) - (store v19 v15) - (let (v20 i32) (const.i32 0)) - (let (v21 i32) (const.i32 0)) - (let (v22 u32) (bitcast v7)) - (let (v23 u32) (add.checked v22 40)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (store v25 v21) - (let (v26 u32) (bitcast v7)) - (let (v27 u32) (add.checked v26 36)) - (let (v28 u32) (mod.unchecked v27 4)) - (assertz 250 v28) - (let (v29 (ptr i32)) (inttoptr v27)) - (store v29 v1) - (let (v30 u32) (bitcast v7)) - (let (v31 u32) (add.checked v30 32)) - (let (v32 u32) (mod.unchecked v31 4)) - (assertz 250 v32) - (let (v33 (ptr i32)) (inttoptr v31)) - (store v33 v0) - (let (v34 i32) (const.i32 0)) - (let (v35 u32) (bitcast v7)) - (let (v36 u32) (add.checked v35 20)) - (let (v37 u32) (mod.unchecked v36 4)) - (assertz 250 v37) - (let (v38 (ptr i32)) (inttoptr v36)) - (store v38 v34) - (let (v39 i32) (const.i32 0)) - (let (v40 u32) (bitcast v7)) - (let (v41 u32) (add.checked v40 12)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (store v43 v39) - (let (v44 u32) (bitcast v2)) - (let (v45 u32) (add.checked v44 16)) - (let (v46 u32) (mod.unchecked v45 4)) - (assertz 250 v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (let (v48 i32) (load v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 6) (block 7))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 (param v436 i32) (param v442 i32) - (let (v439 i32) (const.i32 48)) - (let (v440 i32) (add.wrapping v436 v439)) - (let (v441 (ptr i32)) (global.symbol #__stack_pointer)) - (store v441 v440) - (br (block 1 v442))) - - (block 3 (param v438 i32) - (let (v435 i32) (const.i32 0)) - (br (block 2 v438 v435))) - - (block 4 (param v437 i32) - (let (v434 i32) (const.i32 1)) - (br (block 2 v437 v434))) - - (block 5 (param v370 i32) (param v379 i32) (param v398 i32) - (let (v388 u32) (bitcast v379)) - (let (v389 u32) (add.checked v388 4)) - (let (v390 u32) (mod.unchecked v389 4)) - (assertz 250 v390) - (let (v391 (ptr i32)) (inttoptr v389)) - (let (v392 i32) (load v391)) - (let (v393 u32) (bitcast v370)) - (let (v394 u32) (bitcast v392)) - (let (v395 i1) (gte v393 v394)) - (let (v396 i32) (zext v395)) - (let (v397 i1) (neq v396 0)) - (condbr v397 (block 3 v398) (block 32))) - - (block 6 - (let (v132 u32) (bitcast v2)) - (let (v133 u32) (add.checked v132 20)) - (let (v134 u32) (mod.unchecked v133 4)) - (assertz 250 v134) - (let (v135 (ptr i32)) (inttoptr v133)) - (let (v136 i32) (load v135)) - (let (v137 i1) (eq v136 0)) - (let (v138 i32) (zext v137)) - (let (v139 i1) (neq v138 0)) - (condbr v139 (block 5 v20 v2 v7) (block 16))) - - (block 7 - (let (v50 u32) (bitcast v2)) - (let (v51 u32) (add.checked v50 12)) - (let (v52 u32) (mod.unchecked v51 4)) - (assertz 250 v52) - (let (v53 (ptr i32)) (inttoptr v51)) - (let (v54 i32) (load v53)) - (let (v55 i1) (eq v54 0)) - (let (v56 i32) (zext v55)) - (let (v57 i1) (neq v56 0)) - (condbr v57 (block 5 v20 v2 v7) (block 8))) - - (block 8 - (let (v58 u32) (bitcast v2)) - (let (v59 u32) (add.checked v58 8)) - (let (v60 u32) (mod.unchecked v59 4)) - (assertz 250 v60) - (let (v61 (ptr i32)) (inttoptr v59)) - (let (v62 i32) (load v61)) - (let (v63 i32) (const.i32 3)) - (let (v64 u32) (bitcast v63)) - (let (v65 i32) (shl.wrapping v54 v64)) - (let (v66 i32) (const.i32 -1)) - (let (v67 i32) (add.wrapping v54 v66)) - (let (v68 i32) (const.i32 536870911)) - (let (v69 i32) (band v67 v68)) - (let (v70 i32) (const.i32 1)) - (let (v71 i32) (add.wrapping v69 v70)) - (let (v72 u32) (bitcast v2)) - (let (v73 u32) (mod.unchecked v72 4)) - (assertz 250 v73) - (let (v74 (ptr i32)) (inttoptr v72)) - (let (v75 i32) (load v74)) - (br (block 9 v75 v7 v62 v65 v71 v2))) - - (block 9 - (param v76 i32) - (param v86 i32) - (param v108 i32) - (param v128 i32) - (param v372 i32) - (param v381 i32) - (let (v77 i32) (const.i32 4)) - (let (v78 i32) (add.wrapping v76 v77)) - (let (v79 u32) (bitcast v78)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 i1) (eq v82 0)) - (let (v84 i32) (zext v83)) - (let (v85 i1) (neq v84 0)) - (condbr v85 (block 11 v108 v86 v76 v128 v372 v381) (block 12))) - - (block 10) - - (block 11 - (param v107 i32) - (param v113 i32) - (param v124 i32) - (param v127 i32) - (param v371 i32) - (param v380 i32) - (let (v109 u32) (bitcast v107)) - (let (v110 u32) (mod.unchecked v109 4)) - (assertz 250 v110) - (let (v111 (ptr i32)) (inttoptr v109)) - (let (v112 i32) (load v111)) - (let (v114 i32) (const.i32 12)) - (let (v115 i32) (add.wrapping v113 v114)) - (let (v116 u32) (bitcast v107)) - (let (v117 u32) (add.checked v116 4)) - (let (v118 u32) (mod.unchecked v117 4)) - (assertz 250 v118) - (let (v119 (ptr i32)) (inttoptr v117)) - (let (v120 i32) (load v119)) - (let (v121 i1) (neq v120 0)) - (condbr v121 (block 4 v113) (block 14))) - - (block 12 - (let (v87 u32) (bitcast v86)) - (let (v88 u32) (add.checked v87 32)) - (let (v89 u32) (mod.unchecked v88 4)) - (assertz 250 v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (let (v91 i32) (load v90)) - (let (v92 u32) (bitcast v76)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (let (v96 u32) (bitcast v86)) - (let (v97 u32) (add.checked v96 36)) - (let (v98 u32) (mod.unchecked v97 4)) - (assertz 250 v98) - (let (v99 (ptr i32)) (inttoptr v97)) - (let (v100 i32) (load v99)) - (let (v101 u32) (bitcast v100)) - (let (v102 u32) (add.checked v101 12)) - (let (v103 u32) (mod.unchecked v102 4)) - (assertz 250 v103) - (let (v104 (ptr i32)) (inttoptr v102)) - (let (v105 i32) (load v104)) - (let (v106 i1) (neq v105 0)) - (condbr v106 (block 4 v86) (block 13))) - - (block 13 - (br (block 11 v108 v86 v76 v128 v372 v381))) - - (block 14 - (let (v122 i32) (const.i32 8)) - (let (v123 i32) (add.wrapping v107 v122)) - (let (v125 i32) (const.i32 8)) - (let (v126 i32) (add.wrapping v124 v125)) - (let (v129 i32) (const.i32 -8)) - (let (v130 i32) (add.wrapping v127 v129)) - (let (v131 i1) (neq v130 0)) - (condbr v131 (block 9 v126 v113 v123 v130 v371 v380) (block 15))) - - (block 15 - (br (block 5 v371 v380 v113))) - - (block 16 - (let (v140 i32) (const.i32 5)) - (let (v141 u32) (bitcast v140)) - (let (v142 i32) (shl.wrapping v136 v141)) - (let (v143 i32) (const.i32 -1)) - (let (v144 i32) (add.wrapping v136 v143)) - (let (v145 i32) (const.i32 134217727)) - (let (v146 i32) (band v144 v145)) - (let (v147 i32) (const.i32 1)) - (let (v148 i32) (add.wrapping v146 v147)) - (let (v149 u32) (bitcast v2)) - (let (v150 u32) (add.checked v149 8)) - (let (v151 u32) (mod.unchecked v150 4)) - (assertz 250 v151) - (let (v152 (ptr i32)) (inttoptr v150)) - (let (v153 i32) (load v152)) - (let (v154 u32) (bitcast v2)) - (let (v155 u32) (mod.unchecked v154 4)) - (assertz 250 v155) - (let (v156 (ptr i32)) (inttoptr v154)) - (let (v157 i32) (load v156)) - (let (v158 i32) (const.i32 0)) - (br (block 17 v157 v7 v48 v158 v153 v142 v148 v2))) - - (block 17 - (param v159 i32) - (param v169 i32) - (param v192 i32) - (param v194 i32) - (param v247 i32) - (param v354 i32) - (param v376 i32) - (param v385 i32) - (let (v160 i32) (const.i32 4)) - (let (v161 i32) (add.wrapping v159 v160)) - (let (v162 u32) (bitcast v161)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i1) (eq v165 0)) - (let (v167 i32) (zext v166)) - (let (v168 i1) (neq v167 0)) - (condbr v168 (block 19 v169 v192 v194 v247 v159 v354 v376 v385) (block 20))) - - (block 18 - (br (block 5 v373 v382 v303))) - - (block 19 - (param v190 i32) - (param v191 i32) - (param v193 i32) - (param v246 i32) - (param v346 i32) - (param v353 i32) - (param v375 i32) - (param v384 i32) - (let (v195 i32) (add.wrapping v191 v193)) - (let (v196 i32) (const.i32 16)) - (let (v197 i32) (add.wrapping v195 v196)) - (let (v198 u32) (bitcast v197)) - (let (v199 u32) (mod.unchecked v198 4)) - (assertz 250 v199) - (let (v200 (ptr i32)) (inttoptr v198)) - (let (v201 i32) (load v200)) - (let (v202 u32) (bitcast v190)) - (let (v203 u32) (add.checked v202 28)) - (let (v204 u32) (mod.unchecked v203 4)) - (assertz 250 v204) - (let (v205 (ptr i32)) (inttoptr v203)) - (store v205 v201) - (let (v206 i32) (const.i32 28)) - (let (v207 i32) (add.wrapping v195 v206)) - (let (v208 u32) (bitcast v207)) - (let (v209 (ptr u8)) (inttoptr v208)) - (let (v210 u8) (load v209)) - (let (v211 i32) (zext v210)) - (let (v212 u32) (bitcast v211)) - (let (v213 u8) (trunc v212)) - (let (v214 u32) (bitcast v190)) - (let (v215 u32) (add.checked v214 44)) - (let (v216 (ptr u8)) (inttoptr v215)) - (store v216 v213) - (let (v217 i32) (const.i32 24)) - (let (v218 i32) (add.wrapping v195 v217)) - (let (v219 u32) (bitcast v218)) - (let (v220 u32) (mod.unchecked v219 4)) - (assertz 250 v220) - (let (v221 (ptr i32)) (inttoptr v219)) - (let (v222 i32) (load v221)) - (let (v223 u32) (bitcast v190)) - (let (v224 u32) (add.checked v223 40)) - (let (v225 u32) (mod.unchecked v224 4)) - (assertz 250 v225) - (let (v226 (ptr i32)) (inttoptr v224)) - (store v226 v222) - (let (v227 i32) (const.i32 12)) - (let (v228 i32) (add.wrapping v195 v227)) - (let (v229 u32) (bitcast v228)) - (let (v230 u32) (mod.unchecked v229 4)) - (assertz 250 v230) - (let (v231 (ptr i32)) (inttoptr v229)) - (let (v232 i32) (load v231)) - (let (v233 i32) (const.i32 0)) - (let (v234 i32) (const.i32 0)) - (let (v235 i32) (const.i32 8)) - (let (v236 i32) (add.wrapping v195 v235)) - (let (v237 u32) (bitcast v236)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i32)) (inttoptr v237)) - (let (v240 i32) (load v239)) - (let (v241 u32) (cast v240)) - (switchv241 - (0 . (block 24)) - (1 . (block 23 v190 v232 v195 v246 v233 v346 v353 v193 v191 v375 v384)) - (2 . (block 22 v190 v232 v234 v195 v246 v233 v346 v353 v193 v191 v375 v384)) - (_ . (block 23 v190 v232 v195 v246 v233 v346 v353 v193 v191 v375 v384)))) - - (block 20 - (let (v170 u32) (bitcast v169)) - (let (v171 u32) (add.checked v170 32)) - (let (v172 u32) (mod.unchecked v171 4)) - (assertz 250 v172) - (let (v173 (ptr i32)) (inttoptr v171)) - (let (v174 i32) (load v173)) - (let (v175 u32) (bitcast v159)) - (let (v176 u32) (mod.unchecked v175 4)) - (assertz 250 v176) - (let (v177 (ptr i32)) (inttoptr v175)) - (let (v178 i32) (load v177)) - (let (v179 u32) (bitcast v169)) - (let (v180 u32) (add.checked v179 36)) - (let (v181 u32) (mod.unchecked v180 4)) - (assertz 250 v181) - (let (v182 (ptr i32)) (inttoptr v180)) - (let (v183 i32) (load v182)) - (let (v184 u32) (bitcast v183)) - (let (v185 u32) (add.checked v184 12)) - (let (v186 u32) (mod.unchecked v185 4)) - (assertz 250 v186) - (let (v187 (ptr i32)) (inttoptr v185)) - (let (v188 i32) (load v187)) - (let (v189 i1) (neq v188 0)) - (condbr v189 (block 4 v169) (block 21))) - - (block 21 - (br (block 19 v169 v192 v194 v247 v159 v354 v376 v385))) - - (block 22 - (param v260 i32) - (param v262 i32) - (param v268 i32) - (param v273 i32) - (param v289 i32) - (param v312 i32) - (param v345 i32) - (param v352 i32) - (param v358 i32) - (param v367 i32) - (param v374 i32) - (param v383 i32) - (let (v264 u32) (bitcast v260)) - (let (v265 u32) (add.checked v264 16)) - (let (v266 u32) (mod.unchecked v265 4)) - (assertz 250 v266) - (let (v267 (ptr i32)) (inttoptr v265)) - (store v267 v262) - (let (v269 u32) (bitcast v260)) - (let (v270 u32) (add.checked v269 12)) - (let (v271 u32) (mod.unchecked v270 4)) - (assertz 250 v271) - (let (v272 (ptr i32)) (inttoptr v270)) - (store v272 v268) - (let (v275 i32) (const.i32 4)) - (let (v276 i32) (add.wrapping v273 v275)) - (let (v277 u32) (bitcast v276)) - (let (v278 u32) (mod.unchecked v277 4)) - (assertz 250 v278) - (let (v279 (ptr i32)) (inttoptr v277)) - (let (v280 i32) (load v279)) - (let (v281 u32) (bitcast v273)) - (let (v282 u32) (mod.unchecked v281 4)) - (assertz 250 v282) - (let (v283 (ptr i32)) (inttoptr v281)) - (let (v284 i32) (load v283)) - (let (v285 u32) (cast v284)) - (switchv285 - (0 . (block 28)) - (1 . (block 27 v260 v280 v289 v273 v345 v352 v358 v367 v374 v383)) - (2 . (block 26 v260 v280 v312 v289 v273 v345 v352 v358 v367 v374 v383)) - (_ . (block 27 v260 v280 v289 v273 v345 v352 v358 v367 v374 v383)))) - - (block 23 - (param v261 i32) - (param v263 i32) - (param v274 i32) - (param v290 i32) - (param v313 i32) - (param v347 i32) - (param v355 i32) - (param v359 i32) - (param v368 i32) - (param v377 i32) - (param v386 i32) - (let (v259 i32) (const.i32 1)) - (br (block 22 v261 v263 v259 v274 v290 v313 v347 v355 v359 v368 v377 v386))) - - (block 24 - (let (v242 i32) (const.i32 3)) - (let (v243 u32) (bitcast v242)) - (let (v244 i32) (shl.wrapping v232 v243)) - (let (v245 i32) (const.i32 0)) - (let (v248 i32) (add.wrapping v246 v244)) - (let (v249 u32) (bitcast v248)) - (let (v250 u32) (add.checked v249 4)) - (let (v251 u32) (mod.unchecked v250 4)) - (assertz 250 v251) - (let (v252 (ptr i32)) (inttoptr v250)) - (let (v253 i32) (load v252)) - (let (v254 i1) (neq v253 0)) - (condbr v254 (block 22 v190 v232 v245 v195 v246 v233 v346 v353 v193 v191 v375 v384) (block 25))) - - (block 25 - (let (v255 u32) (bitcast v248)) - (let (v256 u32) (mod.unchecked v255 4)) - (assertz 250 v256) - (let (v257 (ptr i32)) (inttoptr v255)) - (let (v258 i32) (load v257)) - (br (block 23 v190 v258 v195 v246 v233 v346 v353 v193 v191 v375 v384))) - - (block 26 - (param v303 i32) - (param v305 i32) - (param v311 i32) - (param v318 i32) - (param v320 i32) - (param v344 i32) - (param v351 i32) - (param v357 i32) - (param v366 i32) - (param v373 i32) - (param v382 i32) - (let (v307 u32) (bitcast v303)) - (let (v308 u32) (add.checked v307 24)) - (let (v309 u32) (mod.unchecked v308 4)) - (assertz 250 v309) - (let (v310 (ptr i32)) (inttoptr v308)) - (store v310 v305) - (let (v314 u32) (bitcast v303)) - (let (v315 u32) (add.checked v314 20)) - (let (v316 u32) (mod.unchecked v315 4)) - (assertz 250 v316) - (let (v317 (ptr i32)) (inttoptr v315)) - (store v317 v311) - (let (v322 i32) (const.i32 20)) - (let (v323 i32) (add.wrapping v320 v322)) - (let (v324 u32) (bitcast v323)) - (let (v325 u32) (mod.unchecked v324 4)) - (assertz 250 v325) - (let (v326 (ptr i32)) (inttoptr v324)) - (let (v327 i32) (load v326)) - (let (v328 i32) (const.i32 3)) - (let (v329 u32) (bitcast v328)) - (let (v330 i32) (shl.wrapping v327 v329)) - (let (v331 i32) (add.wrapping v318 v330)) - (let (v332 u32) (bitcast v331)) - (let (v333 u32) (mod.unchecked v332 4)) - (assertz 250 v333) - (let (v334 (ptr i32)) (inttoptr v332)) - (let (v335 i32) (load v334)) - (let (v336 i32) (const.i32 12)) - (let (v337 i32) (add.wrapping v303 v336)) - (let (v338 u32) (bitcast v331)) - (let (v339 u32) (add.checked v338 4)) - (let (v340 u32) (mod.unchecked v339 4)) - (assertz 250 v340) - (let (v341 (ptr i32)) (inttoptr v339)) - (let (v342 i32) (load v341)) - (let (v343 i1) (neq v342 0)) - (condbr v343 (block 4 v303) (block 30))) - - (block 27 - (param v304 i32) - (param v306 i32) - (param v319 i32) - (param v321 i32) - (param v348 i32) - (param v356 i32) - (param v360 i32) - (param v369 i32) - (param v378 i32) - (param v387 i32) - (let (v302 i32) (const.i32 1)) - (br (block 26 v304 v306 v302 v319 v321 v348 v356 v360 v369 v378 v387))) - - (block 28 - (let (v286 i32) (const.i32 3)) - (let (v287 u32) (bitcast v286)) - (let (v288 i32) (shl.wrapping v280 v287)) - (let (v291 i32) (add.wrapping v289 v288)) - (let (v292 u32) (bitcast v291)) - (let (v293 u32) (add.checked v292 4)) - (let (v294 u32) (mod.unchecked v293 4)) - (assertz 250 v294) - (let (v295 (ptr i32)) (inttoptr v293)) - (let (v296 i32) (load v295)) - (let (v297 i1) (neq v296 0)) - (condbr v297 (block 26 v260 v280 v312 v289 v273 v345 v352 v358 v367 v374 v383) (block 29))) - - (block 29 - (let (v298 u32) (bitcast v291)) - (let (v299 u32) (mod.unchecked v298 4)) - (assertz 250 v299) - (let (v300 (ptr i32)) (inttoptr v298)) - (let (v301 i32) (load v300)) - (br (block 27 v260 v301 v289 v273 v345 v352 v358 v367 v374 v383))) - - (block 30 - (let (v349 i32) (const.i32 8)) - (let (v350 i32) (add.wrapping v344 v349)) - (let (v361 i32) (const.i32 32)) - (let (v362 i32) (add.wrapping v357 v361)) - (let (v363 i1) (neq v351 v362)) - (let (v364 i32) (zext v363)) - (let (v365 i1) (neq v364 0)) - (condbr v365 (block 17 v350 v303 v366 v362 v318 v351 v373 v382) (block 31))) - - (block 31 - (br (block 18))) - - (block 32 - (let (v399 u32) (bitcast v398)) - (let (v400 u32) (add.checked v399 32)) - (let (v401 u32) (mod.unchecked v400 4)) - (assertz 250 v401) - (let (v402 (ptr i32)) (inttoptr v400)) - (let (v403 i32) (load v402)) - (let (v404 u32) (bitcast v379)) - (let (v405 u32) (mod.unchecked v404 4)) - (assertz 250 v405) - (let (v406 (ptr i32)) (inttoptr v404)) - (let (v407 i32) (load v406)) - (let (v408 i32) (const.i32 3)) - (let (v409 u32) (bitcast v408)) - (let (v410 i32) (shl.wrapping v370 v409)) - (let (v411 i32) (add.wrapping v407 v410)) - (let (v412 u32) (bitcast v411)) - (let (v413 u32) (mod.unchecked v412 4)) - (assertz 250 v413) - (let (v414 (ptr i32)) (inttoptr v412)) - (let (v415 i32) (load v414)) - (let (v416 u32) (bitcast v411)) - (let (v417 u32) (add.checked v416 4)) - (let (v418 u32) (mod.unchecked v417 4)) - (assertz 250 v418) - (let (v419 (ptr i32)) (inttoptr v417)) - (let (v420 i32) (load v419)) - (let (v421 u32) (bitcast v398)) - (let (v422 u32) (add.checked v421 36)) - (let (v423 u32) (mod.unchecked v422 4)) - (assertz 250 v423) - (let (v424 (ptr i32)) (inttoptr v422)) - (let (v425 i32) (load v424)) - (let (v426 u32) (bitcast v425)) - (let (v427 u32) (add.checked v426 12)) - (let (v428 u32) (mod.unchecked v427 4)) - (assertz 250 v428) - (let (v429 (ptr i32)) (inttoptr v427)) - (let (v430 i32) (load v429)) - (let (v431 i1) (eq v430 0)) - (let (v432 i32) (zext v431)) - (let (v433 i1) (neq v432 0)) - (condbr v433 (block 3 v398) (block 33))) - - (block 33 - (br (block 4 v398))) - ) - - (func (export #core::fmt::builders::DebugStruct::field) - (param i32) (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 - (param v0 i32) - (param v1 i32) - (param v2 i32) - (param v3 i32) - (param v4 i32) - (let (v6 i32) (const.i32 0)) - (let (v7 i64) (const.i64 0)) - (let (v8 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v9 i32) (const.i32 64)) - (let (v10 i32) (sub.wrapping v8 v9)) - (let (v11 (ptr i32)) (global.symbol #__stack_pointer)) - (store v11 v10) - (let (v12 i32) (const.i32 1)) - (let (v13 u32) (bitcast v0)) - (let (v14 u32) (add.checked v13 4)) - (let (v15 (ptr u8)) (inttoptr v14)) - (let (v16 u8) (load v15)) - (let (v17 i32) (zext v16)) - (let (v18 i1) (neq v17 0)) - (condbr v18 (block 2 v0 v12 v10) (block 3))) - - (block 1 (param v5 i32) - (ret v5)) - - (block 2 (param v244 i32) (param v252 i32) (param v258 i32) - (let (v246 i32) (const.i32 1)) - (let (v247 u32) (bitcast v246)) - (let (v248 u8) (trunc v247)) - (let (v249 u32) (bitcast v244)) - (let (v250 u32) (add.checked v249 5)) - (let (v251 (ptr u8)) (inttoptr v250)) - (store v251 v248) - (let (v253 u32) (bitcast v252)) - (let (v254 u8) (trunc v253)) - (let (v255 u32) (bitcast v244)) - (let (v256 u32) (add.checked v255 4)) - (let (v257 (ptr u8)) (inttoptr v256)) - (store v257 v254) - (let (v259 i32) (const.i32 64)) - (let (v260 i32) (add.wrapping v258 v259)) - (let (v261 (ptr i32)) (global.symbol #__stack_pointer)) - (store v261 v260) - (br (block 1 v244))) - - (block 3 - (let (v19 u32) (bitcast v0)) - (let (v20 u32) (add.checked v19 5)) - (let (v21 (ptr u8)) (inttoptr v20)) - (let (v22 u8) (load v21)) - (let (v23 i32) (zext v22)) - (let (v24 u32) (bitcast v0)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (let (v28 u32) (bitcast v27)) - (let (v29 u32) (add.checked v28 28)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 4)) - (let (v34 i32) (band v32 v33)) - (let (v35 i1) (neq v34 0)) - (condbr v35 (block 4) (block 5))) - - (block 4 - (let (v102 i32) (const.i32 1)) - (let (v103 i32) (const.i32 1)) - (let (v104 i32) (band v23 v103)) - (let (v105 i1) (neq v104 0)) - (condbr v105 (block 9 v10 v27 v32 v1 v2 v3 v4 v0) (block 10))) - - (block 5 - (let (v36 i32) (const.i32 1)) - (let (v37 u32) (bitcast v27)) - (let (v38 u32) (add.checked v37 20)) - (let (v39 u32) (mod.unchecked v38 4)) - (assertz 250 v39) - (let (v40 (ptr i32)) (inttoptr v38)) - (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 1048963)) - (let (v43 i32) (const.i32 1048960)) - (let (v44 i32) (const.i32 1)) - (let (v45 i32) (band v23 v44)) - (let (v46 i1) (neq v45 0)) - (let (v47 i32) (select v46 v42 v43)) - (let (v48 i32) (const.i32 2)) - (let (v49 i32) (const.i32 3)) - (let (v50 i1) (neq v45 0)) - (let (v51 i32) (select v50 v48 v49)) - (let (v52 u32) (bitcast v27)) - (let (v53 u32) (add.checked v52 24)) - (let (v54 u32) (mod.unchecked v53 4)) - (assertz 250 v54) - (let (v55 (ptr i32)) (inttoptr v53)) - (let (v56 i32) (load v55)) - (let (v57 u32) (bitcast v56)) - (let (v58 u32) (add.checked v57 12)) - (let (v59 u32) (mod.unchecked v58 4)) - (assertz 250 v59) - (let (v60 (ptr i32)) (inttoptr v58)) - (let (v61 i32) (load v60)) - (let (v62 i1) (neq v61 0)) - (condbr v62 (block 2 v0 v36 v10) (block 6))) - - (block 6 - (let (v63 u32) (bitcast v27)) - (let (v64 u32) (add.checked v63 20)) - (let (v65 u32) (mod.unchecked v64 4)) - (assertz 250 v65) - (let (v66 (ptr i32)) (inttoptr v64)) - (let (v67 i32) (load v66)) - (let (v68 u32) (bitcast v27)) - (let (v69 u32) (add.checked v68 24)) - (let (v70 u32) (mod.unchecked v69 4)) - (assertz 250 v70) - (let (v71 (ptr i32)) (inttoptr v69)) - (let (v72 i32) (load v71)) - (let (v73 u32) (bitcast v72)) - (let (v74 u32) (add.checked v73 12)) - (let (v75 u32) (mod.unchecked v74 4)) - (assertz 250 v75) - (let (v76 (ptr i32)) (inttoptr v74)) - (let (v77 i32) (load v76)) - (let (v78 i1) (neq v77 0)) - (condbr v78 (block 2 v0 v36 v10) (block 7))) - - (block 7 - (let (v79 u32) (bitcast v27)) - (let (v80 u32) (add.checked v79 20)) - (let (v81 u32) (mod.unchecked v80 4)) - (assertz 250 v81) - (let (v82 (ptr i32)) (inttoptr v80)) - (let (v83 i32) (load v82)) - (let (v84 i32) (const.i32 1048928)) - (let (v85 i32) (const.i32 2)) - (let (v86 u32) (bitcast v27)) - (let (v87 u32) (add.checked v86 24)) - (let (v88 u32) (mod.unchecked v87 4)) - (assertz 250 v88) - (let (v89 (ptr i32)) (inttoptr v87)) - (let (v90 i32) (load v89)) - (let (v91 u32) (bitcast v90)) - (let (v92 u32) (add.checked v91 12)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (let (v96 i1) (neq v95 0)) - (condbr v96 (block 2 v0 v36 v10) (block 8))) - - (block 8 - (let (v97 u32) (bitcast v4)) - (let (v98 u32) (add.checked v97 12)) - (let (v99 u32) (mod.unchecked v98 4)) - (assertz 250 v99) - (let (v100 (ptr i32)) (inttoptr v98)) - (let (v101 i32) (load v100)) - (br (block 2 v0 v101 v10))) - - (block 9 - (param v130 i32) - (param v137 i32) - (param v171 i32) - (param v207 i32) - (param v208 i32) - (param v217 i32) - (param v220 i32) - (param v245 i32) - (let (v129 i32) (const.i32 1)) - (let (v131 i32) (const.i32 1)) - (let (v132 u32) (bitcast v131)) - (let (v133 u8) (trunc v132)) - (let (v134 u32) (bitcast v130)) - (let (v135 u32) (add.checked v134 27)) - (let (v136 (ptr u8)) (inttoptr v135)) - (store v136 v133) - (let (v138 u32) (bitcast v137)) - (let (v139 u32) (add.checked v138 20)) - (let (v140 u32) (mod.unchecked v139 4)) - (assertz 250 v140) - (let (v141 (ptr i64)) (inttoptr v139)) - (let (v142 i64) (load v141)) - (let (v143 u32) (bitcast v130)) - (let (v144 u32) (add.checked v143 12)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i64)) (inttoptr v144)) - (store v146 v142) - (let (v147 i32) (const.i32 1048932)) - (let (v148 u32) (bitcast v130)) - (let (v149 u32) (add.checked v148 52)) - (let (v150 u32) (mod.unchecked v149 4)) - (assertz 250 v150) - (let (v151 (ptr i32)) (inttoptr v149)) - (store v151 v147) - (let (v152 i32) (const.i32 27)) - (let (v153 i32) (add.wrapping v130 v152)) - (let (v154 u32) (bitcast v130)) - (let (v155 u32) (add.checked v154 20)) - (let (v156 u32) (mod.unchecked v155 4)) - (assertz 250 v156) - (let (v157 (ptr i32)) (inttoptr v155)) - (store v157 v153) - (let (v158 u32) (bitcast v137)) - (let (v159 u32) (add.checked v158 8)) - (let (v160 u32) (mod.unchecked v159 4)) - (assertz 250 v160) - (let (v161 (ptr i64)) (inttoptr v159)) - (let (v162 i64) (load v161)) - (let (v163 u32) (bitcast v130)) - (let (v164 u32) (add.checked v163 36)) - (let (v165 u32) (mod.unchecked v164 4)) - (assertz 250 v165) - (let (v166 (ptr i64)) (inttoptr v164)) - (store v166 v162) - (let (v167 u32) (bitcast v137)) - (let (v168 u32) (mod.unchecked v167 4)) - (assertz 250 v168) - (let (v169 (ptr i64)) (inttoptr v167)) - (let (v170 i64) (load v169)) - (let (v172 u32) (bitcast v130)) - (let (v173 u32) (add.checked v172 56)) - (let (v174 u32) (mod.unchecked v173 4)) - (assertz 250 v174) - (let (v175 (ptr i32)) (inttoptr v173)) - (store v175 v171) - (let (v176 u32) (bitcast v137)) - (let (v177 u32) (add.checked v176 16)) - (let (v178 u32) (mod.unchecked v177 4)) - (assertz 250 v178) - (let (v179 (ptr i32)) (inttoptr v177)) - (let (v180 i32) (load v179)) - (let (v181 u32) (bitcast v130)) - (let (v182 u32) (add.checked v181 44)) - (let (v183 u32) (mod.unchecked v182 4)) - (assertz 250 v183) - (let (v184 (ptr i32)) (inttoptr v182)) - (store v184 v180) - (let (v185 u32) (bitcast v137)) - (let (v186 u32) (add.checked v185 32)) - (let (v187 (ptr u8)) (inttoptr v186)) - (let (v188 u8) (load v187)) - (let (v189 i32) (zext v188)) - (let (v190 u32) (bitcast v189)) - (let (v191 u8) (trunc v190)) - (let (v192 u32) (bitcast v130)) - (let (v193 u32) (add.checked v192 60)) - (let (v194 (ptr u8)) (inttoptr v193)) - (store v194 v191) - (let (v195 u32) (bitcast v130)) - (let (v196 u32) (add.checked v195 28)) - (let (v197 u32) (mod.unchecked v196 4)) - (assertz 250 v197) - (let (v198 (ptr i64)) (inttoptr v196)) - (store v198 v170) - (let (v199 i32) (const.i32 12)) - (let (v200 i32) (add.wrapping v130 v199)) - (let (v201 u32) (bitcast v130)) - (let (v202 u32) (add.checked v201 48)) - (let (v203 u32) (mod.unchecked v202 4)) - (assertz 250 v203) - (let (v204 (ptr i32)) (inttoptr v202)) - (store v204 v200) - (let (v205 i32) (const.i32 12)) - (let (v206 i32) (add.wrapping v130 v205)) - (let (v209 i32) (call #::write_str v206 v207 v208)) - (let (v210 i1) (neq v209 0)) - (condbr v210 (block 2 v245 v129 v130) (block 12))) - - (block 10 - (let (v106 u32) (bitcast v27)) - (let (v107 u32) (add.checked v106 20)) - (let (v108 u32) (mod.unchecked v107 4)) - (assertz 250 v108) - (let (v109 (ptr i32)) (inttoptr v107)) - (let (v110 i32) (load v109)) - (let (v111 i32) (const.i32 1048965)) - (let (v112 i32) (const.i32 3)) - (let (v113 u32) (bitcast v27)) - (let (v114 u32) (add.checked v113 24)) - (let (v115 u32) (mod.unchecked v114 4)) - (assertz 250 v115) - (let (v116 (ptr i32)) (inttoptr v114)) - (let (v117 i32) (load v116)) - (let (v118 u32) (bitcast v117)) - (let (v119 u32) (add.checked v118 12)) - (let (v120 u32) (mod.unchecked v119 4)) - (assertz 250 v120) - (let (v121 (ptr i32)) (inttoptr v119)) - (let (v122 i32) (load v121)) - (let (v123 i1) (neq v122 0)) - (condbr v123 (block 2 v0 v102 v10) (block 11))) - - (block 11 - (let (v124 u32) (bitcast v27)) - (let (v125 u32) (add.checked v124 28)) - (let (v126 u32) (mod.unchecked v125 4)) - (assertz 250 v126) - (let (v127 (ptr i32)) (inttoptr v125)) - (let (v128 i32) (load v127)) - (br (block 9 v10 v27 v128 v1 v2 v3 v4 v0))) - - (block 12 - (let (v211 i32) (const.i32 12)) - (let (v212 i32) (add.wrapping v130 v211)) - (let (v213 i32) (const.i32 1048928)) - (let (v214 i32) (const.i32 2)) - (let (v215 i32) (call #::write_str v212 v213 v214)) - (let (v216 i1) (neq v215 0)) - (condbr v216 (block 2 v245 v129 v130) (block 13))) - - (block 13 - (let (v218 i32) (const.i32 28)) - (let (v219 i32) (add.wrapping v130 v218)) - (let (v221 u32) (bitcast v220)) - (let (v222 u32) (add.checked v221 12)) - (let (v223 u32) (mod.unchecked v222 4)) - (assertz 250 v223) - (let (v224 (ptr i32)) (inttoptr v222)) - (let (v225 i32) (load v224)) - (let (v226 i1) (neq v225 0)) - (condbr v226 (block 2 v245 v129 v130) (block 14))) - - (block 14 - (let (v227 u32) (bitcast v130)) - (let (v228 u32) (add.checked v227 48)) - (let (v229 u32) (mod.unchecked v228 4)) - (assertz 250 v229) - (let (v230 (ptr i32)) (inttoptr v228)) - (let (v231 i32) (load v230)) - (let (v232 i32) (const.i32 1048968)) - (let (v233 i32) (const.i32 2)) - (let (v234 u32) (bitcast v130)) - (let (v235 u32) (add.checked v234 52)) - (let (v236 u32) (mod.unchecked v235 4)) - (assertz 250 v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 u32) (bitcast v238)) - (let (v240 u32) (add.checked v239 12)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (br (block 2 v245 v243 v130))) - ) - - (func (export #<&T as core::fmt::Display>::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (mod.unchecked v3 4)) - (assertz 250 v4) - (let (v5 (ptr i32)) (inttoptr v3)) - (let (v6 i32) (load v5)) - (let (v7 u32) (bitcast v0)) - (let (v8 u32) (add.checked v7 4)) - (let (v9 u32) (mod.unchecked v8 4)) - (assertz 250 v9) - (let (v10 (ptr i32)) (inttoptr v8)) - (let (v11 i32) (load v10)) - (let (v12 i32) (call #core::fmt::Formatter::pad v1 v6 v11)) - (br (block 1 v12))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #core::panicking::assert_failed_inner) - (param i32) (param i32) (param i32) (param i32) (param i32) (param i32) (param i32) - (block 0 - (param v0 i32) - (param v1 i32) - (param v2 i32) - (param v3 i32) - (param v4 i32) - (param v5 i32) - (param v6 i32) - (let (v7 i32) (const.i32 0)) - (let (v8 i64) (const.i64 0)) - (let (v9 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v10 i32) (const.i32 112)) - (let (v11 i32) (sub.wrapping v9 v10)) - (let (v12 (ptr i32)) (global.symbol #__stack_pointer)) - (store v12 v11) - (let (v13 u32) (bitcast v11)) - (let (v14 u32) (add.checked v13 12)) - (let (v15 u32) (mod.unchecked v14 4)) - (assertz 250 v15) - (let (v16 (ptr i32)) (inttoptr v14)) - (store v16 v2) - (let (v17 u32) (bitcast v11)) - (let (v18 u32) (add.checked v17 8)) - (let (v19 u32) (mod.unchecked v18 4)) - (assertz 250 v19) - (let (v20 (ptr i32)) (inttoptr v18)) - (store v20 v1) - (let (v21 u32) (bitcast v11)) - (let (v22 u32) (add.checked v21 20)) - (let (v23 u32) (mod.unchecked v22 4)) - (assertz 250 v23) - (let (v24 (ptr i32)) (inttoptr v22)) - (store v24 v4) - (let (v25 u32) (bitcast v11)) - (let (v26 u32) (add.checked v25 16)) - (let (v27 u32) (mod.unchecked v26 4)) - (assertz 250 v27) - (let (v28 (ptr i32)) (inttoptr v26)) - (store v28 v3) - (let (v29 i32) (const.i32 255)) - (let (v30 i32) (band v0 v29)) - (let (v31 u32) (cast v30)) - (switchv31 - (0 . (block 5)) - (1 . (block 4)) - (2 . (block 3)) - (_ . (block 5)))) - - (block 1) - - (block 2 - (param v50 i32) - (param v51 i32) - (param v56 i32) - (param v129 i32) - (let (v52 u32) (bitcast v50)) - (let (v53 u32) (add.checked v52 28)) - (let (v54 u32) (mod.unchecked v53 4)) - (assertz 250 v54) - (let (v55 (ptr i32)) (inttoptr v53)) - (store v55 v51) - (let (v57 u32) (bitcast v56)) - (let (v58 u32) (mod.unchecked v57 4)) - (assertz 250 v58) - (let (v59 (ptr i32)) (inttoptr v57)) - (let (v60 i32) (load v59)) - (let (v61 i1) (neq v60 0)) - (condbr v61 (block 6) (block 7))) - - (block 3 - (let (v44 i32) (const.i32 1048788)) - (let (v45 u32) (bitcast v11)) - (let (v46 u32) (add.checked v45 24)) - (let (v47 u32) (mod.unchecked v46 4)) - (assertz 250 v47) - (let (v48 (ptr i32)) (inttoptr v46)) - (store v48 v44) - (let (v49 i32) (const.i32 7)) - (br (block 2 v11 v49 v5 v6))) - - (block 4 - (let (v38 i32) (const.i32 1048786)) - (let (v39 u32) (bitcast v11)) - (let (v40 u32) (add.checked v39 24)) - (let (v41 u32) (mod.unchecked v40 4)) - (assertz 250 v41) - (let (v42 (ptr i32)) (inttoptr v40)) - (store v42 v38) - (let (v43 i32) (const.i32 2)) - (br (block 2 v11 v43 v5 v6))) - - (block 5 - (let (v32 i32) (const.i32 1048784)) - (let (v33 u32) (bitcast v11)) - (let (v34 u32) (add.checked v33 24)) - (let (v35 u32) (mod.unchecked v34 4)) - (assertz 250 v35) - (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v32) - (let (v37 i32) (const.i32 2)) - (br (block 2 v11 v37 v5 v6))) - - (block 6 - (let (v130 i32) (const.i32 32)) - (let (v131 i32) (add.wrapping v50 v130)) - (let (v132 i32) (const.i32 16)) - (let (v133 i32) (add.wrapping v131 v132)) - (let (v134 i32) (const.i32 16)) - (let (v135 i32) (add.wrapping v56 v134)) - (let (v136 u32) (bitcast v135)) - (let (v137 u32) (mod.unchecked v136 4)) - (assertz 250 v137) - (let (v138 (ptr i64)) (inttoptr v136)) - (let (v139 i64) (load v138)) - (let (v140 u32) (bitcast v133)) - (let (v141 u32) (mod.unchecked v140 8)) - (assertz 250 v141) - (let (v142 (ptr i64)) (inttoptr v140)) - (store v142 v139) - (let (v143 i32) (const.i32 32)) - (let (v144 i32) (add.wrapping v50 v143)) - (let (v145 i32) (const.i32 8)) - (let (v146 i32) (add.wrapping v144 v145)) - (let (v147 i32) (const.i32 8)) - (let (v148 i32) (add.wrapping v56 v147)) - (let (v149 u32) (bitcast v148)) - (let (v150 u32) (mod.unchecked v149 4)) - (assertz 250 v150) - (let (v151 (ptr i64)) (inttoptr v149)) - (let (v152 i64) (load v151)) - (let (v153 u32) (bitcast v146)) - (let (v154 u32) (mod.unchecked v153 8)) - (assertz 250 v154) - (let (v155 (ptr i64)) (inttoptr v153)) - (store v155 v152) - (let (v156 u32) (bitcast v56)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i64)) (inttoptr v156)) - (let (v159 i64) (load v158)) - (let (v160 u32) (bitcast v50)) - (let (v161 u32) (add.checked v160 32)) - (let (v162 u32) (mod.unchecked v161 8)) - (assertz 250 v162) - (let (v163 (ptr i64)) (inttoptr v161)) - (store v163 v159) - (let (v164 i32) (const.i32 4)) - (let (v165 u32) (bitcast v50)) - (let (v166 u32) (add.checked v165 92)) - (let (v167 u32) (mod.unchecked v166 4)) - (assertz 250 v167) - (let (v168 (ptr i32)) (inttoptr v166)) - (store v168 v164) - (let (v169 i32) (const.i32 1048896)) - (let (v170 u32) (bitcast v50)) - (let (v171 u32) (add.checked v170 88)) - (let (v172 u32) (mod.unchecked v171 4)) - (assertz 250 v172) - (let (v173 (ptr i32)) (inttoptr v171)) - (store v173 v169) - (let (v174 i64) (const.i64 4)) - (let (v175 u32) (bitcast v50)) - (let (v176 u32) (add.checked v175 100)) - (let (v177 u32) (mod.unchecked v176 4)) - (assertz 250 v177) - (let (v178 (ptr i64)) (inttoptr v176)) - (store v178 v174) - (let (v179 i32) (const.i32 7)) - (let (v180 u32) (bitcast v179)) - (let (v181 u64) (zext v180)) - (let (v182 i64) (bitcast v181)) - (let (v183 i64) (const.i64 32)) - (let (v184 u32) (cast v183)) - (let (v185 i64) (shl.wrapping v182 v184)) - (let (v186 i32) (const.i32 16)) - (let (v187 i32) (add.wrapping v50 v186)) - (let (v188 u32) (bitcast v187)) - (let (v189 u64) (zext v188)) - (let (v190 i64) (bitcast v189)) - (let (v191 i64) (bor v185 v190)) - (let (v192 u32) (bitcast v50)) - (let (v193 u32) (add.checked v192 80)) - (let (v194 u32) (mod.unchecked v193 8)) - (assertz 250 v194) - (let (v195 (ptr i64)) (inttoptr v193)) - (store v195 v191) - (let (v196 i32) (const.i32 8)) - (let (v197 i32) (add.wrapping v50 v196)) - (let (v198 u32) (bitcast v197)) - (let (v199 u64) (zext v198)) - (let (v200 i64) (bitcast v199)) - (let (v201 i64) (bor v185 v200)) - (let (v202 u32) (bitcast v50)) - (let (v203 u32) (add.checked v202 72)) - (let (v204 u32) (mod.unchecked v203 8)) - (assertz 250 v204) - (let (v205 (ptr i64)) (inttoptr v203)) - (store v205 v201) - (let (v206 i32) (const.i32 9)) - (let (v207 u32) (bitcast v206)) - (let (v208 u64) (zext v207)) - (let (v209 i64) (bitcast v208)) - (let (v210 i64) (const.i64 32)) - (let (v211 u32) (cast v210)) - (let (v212 i64) (shl.wrapping v209 v211)) - (let (v213 i32) (const.i32 32)) - (let (v214 i32) (add.wrapping v50 v213)) - (let (v215 u32) (bitcast v214)) - (let (v216 u64) (zext v215)) - (let (v217 i64) (bitcast v216)) - (let (v218 i64) (bor v212 v217)) - (let (v219 u32) (bitcast v50)) - (let (v220 u32) (add.checked v219 64)) - (let (v221 u32) (mod.unchecked v220 8)) - (assertz 250 v221) - (let (v222 (ptr i64)) (inttoptr v220)) - (store v222 v218) - (let (v223 i32) (const.i32 8)) - (let (v224 u32) (bitcast v223)) - (let (v225 u64) (zext v224)) - (let (v226 i64) (bitcast v225)) - (let (v227 i64) (const.i64 32)) - (let (v228 u32) (cast v227)) - (let (v229 i64) (shl.wrapping v226 v228)) - (let (v230 i32) (const.i32 24)) - (let (v231 i32) (add.wrapping v50 v230)) - (let (v232 u32) (bitcast v231)) - (let (v233 u64) (zext v232)) - (let (v234 i64) (bitcast v233)) - (let (v235 i64) (bor v229 v234)) - (let (v236 u32) (bitcast v50)) - (let (v237 u32) (add.checked v236 56)) - (let (v238 u32) (mod.unchecked v237 8)) - (assertz 250 v238) - (let (v239 (ptr i64)) (inttoptr v237)) - (store v239 v235) - (let (v240 i32) (const.i32 56)) - (let (v241 i32) (add.wrapping v50 v240)) - (let (v242 u32) (bitcast v50)) - (let (v243 u32) (add.checked v242 96)) - (let (v244 u32) (mod.unchecked v243 4)) - (assertz 250 v244) - (let (v245 (ptr i32)) (inttoptr v243)) - (store v245 v241) - (let (v246 i32) (const.i32 88)) - (let (v247 i32) (add.wrapping v50 v246)) - (call #core::panicking::panic_fmt v247 v129) - (unreachable)) - - (block 7 - (let (v62 i32) (const.i32 3)) - (let (v63 u32) (bitcast v50)) - (let (v64 u32) (add.checked v63 92)) - (let (v65 u32) (mod.unchecked v64 4)) - (assertz 250 v65) - (let (v66 (ptr i32)) (inttoptr v64)) - (store v66 v62) - (let (v67 i32) (const.i32 1048844)) - (let (v68 u32) (bitcast v50)) - (let (v69 u32) (add.checked v68 88)) - (let (v70 u32) (mod.unchecked v69 4)) - (assertz 250 v70) - (let (v71 (ptr i32)) (inttoptr v69)) - (store v71 v67) - (let (v72 i64) (const.i64 3)) - (let (v73 u32) (bitcast v50)) - (let (v74 u32) (add.checked v73 100)) - (let (v75 u32) (mod.unchecked v74 4)) - (assertz 250 v75) - (let (v76 (ptr i64)) (inttoptr v74)) - (store v76 v72) - (let (v77 i32) (const.i32 7)) - (let (v78 u32) (bitcast v77)) - (let (v79 u64) (zext v78)) - (let (v80 i64) (bitcast v79)) - (let (v81 i64) (const.i64 32)) - (let (v82 u32) (cast v81)) - (let (v83 i64) (shl.wrapping v80 v82)) - (let (v84 i32) (const.i32 16)) - (let (v85 i32) (add.wrapping v50 v84)) - (let (v86 u32) (bitcast v85)) - (let (v87 u64) (zext v86)) - (let (v88 i64) (bitcast v87)) - (let (v89 i64) (bor v83 v88)) - (let (v90 u32) (bitcast v50)) - (let (v91 u32) (add.checked v90 72)) - (let (v92 u32) (mod.unchecked v91 8)) - (assertz 250 v92) - (let (v93 (ptr i64)) (inttoptr v91)) - (store v93 v89) - (let (v94 i32) (const.i32 8)) - (let (v95 i32) (add.wrapping v50 v94)) - (let (v96 u32) (bitcast v95)) - (let (v97 u64) (zext v96)) - (let (v98 i64) (bitcast v97)) - (let (v99 i64) (bor v83 v98)) - (let (v100 u32) (bitcast v50)) - (let (v101 u32) (add.checked v100 64)) - (let (v102 u32) (mod.unchecked v101 8)) - (assertz 250 v102) - (let (v103 (ptr i64)) (inttoptr v101)) - (store v103 v99) - (let (v104 i32) (const.i32 8)) - (let (v105 u32) (bitcast v104)) - (let (v106 u64) (zext v105)) - (let (v107 i64) (bitcast v106)) - (let (v108 i64) (const.i64 32)) - (let (v109 u32) (cast v108)) - (let (v110 i64) (shl.wrapping v107 v109)) - (let (v111 i32) (const.i32 24)) - (let (v112 i32) (add.wrapping v50 v111)) - (let (v113 u32) (bitcast v112)) - (let (v114 u64) (zext v113)) - (let (v115 i64) (bitcast v114)) - (let (v116 i64) (bor v110 v115)) - (let (v117 u32) (bitcast v50)) - (let (v118 u32) (add.checked v117 56)) - (let (v119 u32) (mod.unchecked v118 8)) - (assertz 250 v119) - (let (v120 (ptr i64)) (inttoptr v118)) - (store v120 v116) - (let (v121 i32) (const.i32 56)) - (let (v122 i32) (add.wrapping v50 v121)) - (let (v123 u32) (bitcast v50)) - (let (v124 u32) (add.checked v123 96)) - (let (v125 u32) (mod.unchecked v124 4)) - (assertz 250 v125) - (let (v126 (ptr i32)) (inttoptr v124)) - (store v126 v122) - (let (v127 i32) (const.i32 88)) - (let (v128 i32) (add.wrapping v50 v127)) - (call #core::panicking::panic_fmt v128 v129) - (unreachable)) - ) - - (func (export #<&T as core::fmt::Debug>::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (mod.unchecked v3 4)) - (assertz 250 v4) - (let (v5 (ptr i32)) (inttoptr v3)) - (let (v6 i32) (load v5)) - (let (v7 u32) (bitcast v0)) - (let (v8 u32) (add.checked v7 4)) - (let (v9 u32) (mod.unchecked v8 4)) - (assertz 250 v9) - (let (v10 (ptr i32)) (inttoptr v8)) - (let (v11 i32) (load v10)) - (let (v12 u32) (bitcast v11)) - (let (v13 u32) (add.checked v12 12)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (let (v16 i32) (load v15)) - (br (block 1 v16))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 u32) (bitcast v1)) - (let (v4 u32) (add.checked v3 20)) - (let (v5 u32) (mod.unchecked v4 4)) - (assertz 250 v5) - (let (v6 (ptr i32)) (inttoptr v4)) - (let (v7 i32) (load v6)) - (let (v8 u32) (bitcast v1)) - (let (v9 u32) (add.checked v8 24)) - (let (v10 u32) (mod.unchecked v9 4)) - (assertz 250 v10) - (let (v11 (ptr i32)) (inttoptr v9)) - (let (v12 i32) (load v11)) - (let (v13 i32) (call #core::fmt::write v7 v12 v0)) - (br (block 1 v13))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #::write_str) - (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i32) (const.i32 -1)) - (let (v6 i32) (add.wrapping v1 v5)) - (let (v7 u32) (bitcast v0)) - (let (v8 u32) (add.checked v7 4)) - (let (v9 u32) (mod.unchecked v8 4)) - (assertz 250 v9) - (let (v10 (ptr i32)) (inttoptr v8)) - (let (v11 i32) (load v10)) - (let (v12 u32) (bitcast v0)) - (let (v13 u32) (mod.unchecked v12 4)) - (assertz 250 v13) - (let (v14 (ptr i32)) (inttoptr v12)) - (let (v15 i32) (load v14)) - (let (v16 u32) (bitcast v0)) - (let (v17 u32) (add.checked v16 8)) - (let (v18 u32) (mod.unchecked v17 4)) - (assertz 250 v18) - (let (v19 (ptr i32)) (inttoptr v17)) - (let (v20 i32) (load v19)) - (let (v21 i32) (const.i32 0)) - (let (v22 i32) (const.i32 0)) - (let (v23 i32) (const.i32 0)) - (let (v24 i32) (const.i32 0)) - (br (block 3 v24 v23 v2 v1 v22 v20 v15 v11 v6 v21))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 (param v370 i32) - (br (block 1 v370))) - - (block 3 - (param v25 i32) - (param v29 i32) - (param v30 i32) - (param v214 i32) - (param v225 i32) - (param v243 i32) - (param v262 i32) - (param v276 i32) - (param v304 i32) - (param v371 i32) - (let (v26 i32) (const.i32 1)) - (let (v27 i32) (band v25 v26)) - (let (v28 i1) (neq v27 0)) - (condbr v28 (block 2 v371) (block 5))) - - (block 4 - (let (v369 i32) (const.i32 1)) - (br (block 2 v369))) - - (block 5 - (let (v31 u32) (bitcast v29)) - (let (v32 u32) (bitcast v30)) - (let (v33 i1) (gt v31 v32)) - (let (v34 i32) (sext v33)) - (let (v35 i1) (neq v34 0)) - (condbr v35 (block 7 v225 v30 v243 v262 v276 v304 v214 v29 v371) (block 8))) - - (block 6 - (param v239 i32) - (param v258 i32) - (param v272 i32) - (param v291 i32) - (param v293 i32) - (param v300 i32) - (param v322 i32) - (param v335 i32) - (param v351 i32) - (param v363 i32) - (param v367 i32) - (param v374 i32) - (let (v251 u32) (bitcast v239)) - (let (v252 (ptr u8)) (inttoptr v251)) - (let (v253 u8) (load v252)) - (let (v254 i32) (zext v253)) - (let (v255 i1) (eq v254 0)) - (let (v256 i32) (zext v255)) - (let (v257 i1) (neq v256 0)) - (condbr v257 (block 46 v291 v293 v300 v322 v239 v335 v258 v272 v351 v363 v367 v374) (block 47))) - - (block 7 - (param v224 i32) - (param v235 i32) - (param v250 i32) - (param v269 i32) - (param v283 i32) - (param v311 i32) - (param v323 i32) - (param v364 i32) - (param v384 i32) - (let (v223 i32) (const.i32 1)) - (let (v236 i1) (eq v224 v235)) - (let (v237 i32) (zext v236)) - (let (v238 i1) (neq v237 0)) - (condbr v238 (block 2 v384) (block 44))) - - (block 8 - (br (block 9 v214 v29 v30 v225 v243 v262 v276 v304 v25 v371))) - - (block 9 - (param v36 i32) - (param v37 i32) - (param v39 i32) - (param v226 i32) - (param v242 i32) - (param v261 i32) - (param v275 i32) - (param v303 i32) - (param v354 i32) - (param v377 i32) - (let (v38 i32) (add.wrapping v36 v37)) - (let (v40 i32) (sub.wrapping v39 v37)) - (let (v41 i32) (const.i32 7)) - (let (v42 u32) (bitcast v40)) - (let (v43 u32) (bitcast v41)) - (let (v44 i1) (gt v42 v43)) - (let (v45 i32) (sext v44)) - (let (v46 i1) (neq v45 0)) - (condbr v46 (block 14) (block 15))) - - (block 10 - (br (block 7 v227 v208 v244 v263 v277 v305 v215 v207 v378))) - - (block 11 - (param v180 i32) - (param v181 i32) - (param v191 i32) - (param v197 i32) - (param v216 i32) - (param v228 i32) - (param v240 i32) - (param v259 i32) - (param v273 i32) - (param v301 i32) - (param v352 i32) - (param v375 i32) - (let (v188 i32) (add.wrapping v180 v181)) - (let (v189 i32) (const.i32 1)) - (let (v190 i32) (add.wrapping v188 v189)) - (let (v192 u32) (bitcast v188)) - (let (v193 u32) (bitcast v191)) - (let (v194 i1) (gte v192 v193)) - (let (v195 i32) (zext v194)) - (let (v196 i1) (neq v195 0)) - (condbr v196 (block 40 v190 v191 v216 v228 v240 v259 v273 v301 v352 v375) (block 41))) - - (block 12 - (param v148 i32) - (param v149 i32) - (param v155 i32) - (param v176 i32) - (param v185 i32) - (param v220 i32) - (param v232 i32) - (param v247 i32) - (param v266 i32) - (param v280 i32) - (param v308 i32) - (param v358 i32) - (param v381 i32) - (let (v152 i1) (neq v148 v149)) - (let (v153 i32) (zext v152)) - (let (v154 i1) (neq v153 0)) - (condbr v154 (block 33) (block 34))) - - (block 13 - (let (v129 i32) (const.i32 0)) - (br (block 29 v38 v129 v40 v39 v37 v36 v226 v242 v261 v275 v303 v354 v377))) - - (block 14 - (let (v50 i32) (const.i32 3)) - (let (v51 i32) (add.wrapping v38 v50)) - (let (v52 i32) (const.i32 -4)) - (let (v53 i32) (band v51 v52)) - (let (v54 i32) (sub.wrapping v53 v38)) - (let (v55 i1) (eq v54 0)) - (let (v56 i32) (zext v55)) - (let (v57 i1) (neq v56 0)) - (condbr v57 (block 18) (block 19))) - - (block 15 - (let (v47 i1) (neq v39 v37)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 13) (block 16))) - - (block 16 - (br (block 7 v226 v39 v242 v261 v275 v303 v36 v39 v377))) - - (block 17 - (param v125 i32) - (param v127 i32) - (param v128 i32) - (param v151 i32) - (param v158 i32) - (param v178 i32) - (param v187 i32) - (param v222 i32) - (param v234 i32) - (param v249 i32) - (param v268 i32) - (param v282 i32) - (param v310 i32) - (param v360 i32) - (param v383 i32) - (br (block 25 v125 v127 v128 v151 v158 v178 v187 v222 v234 v249 v268 v282 v310 v360 v383))) - - (block 18 - (let (v84 i32) (const.i32 -8)) - (let (v85 i32) (add.wrapping v40 v84)) - (br (block 17 v53 v54 v85 v40 v39 v38 v37 v36 v226 v242 v261 v275 v303 v354 v377))) - - (block 19 - (let (v58 i32) (const.i32 0)) - (br (block 20 v38 v58 v54 v40 v53 v39 v37 v36 v226 v242 v261 v275 v303 v354 v377))) - - (block 20 - (param v59 i32) - (param v60 i32) - (param v70 i32) - (param v76 i32) - (param v126 i32) - (param v156 i32) - (param v182 i32) - (param v217 i32) - (param v229 i32) - (param v241 i32) - (param v260 i32) - (param v274 i32) - (param v302 i32) - (param v353 i32) - (param v376 i32) - (let (v61 i32) (add.wrapping v59 v60)) - (let (v62 u32) (bitcast v61)) - (let (v63 (ptr u8)) (inttoptr v62)) - (let (v64 u8) (load v63)) - (let (v65 i32) (zext v64)) - (let (v66 i32) (const.i32 10)) - (let (v67 i1) (eq v65 v66)) - (let (v68 i32) (zext v67)) - (let (v69 i1) (neq v68 0)) - (condbr v69 (block 11 v60 v182 v156 v59 v217 v229 v241 v260 v274 v302 v353 v376) (block 22))) - - (block 21 - (let (v77 i32) (const.i32 -8)) - (let (v78 i32) (add.wrapping v76 v77)) - (let (v79 u32) (bitcast v70)) - (let (v80 u32) (bitcast v78)) - (let (v81 i1) (lte v79 v80)) - (let (v82 i32) (sext v81)) - (let (v83 i1) (neq v82 0)) - (condbr v83 (block 17 v126 v70 v78 v76 v156 v59 v182 v217 v229 v241 v260 v274 v302 v353 v376) (block 24))) - - (block 22 - (let (v71 i32) (const.i32 1)) - (let (v72 i32) (add.wrapping v60 v71)) - (let (v73 i1) (neq v70 v72)) - (let (v74 i32) (zext v73)) - (let (v75 i1) (neq v74 0)) - (condbr v75 (block 20 v59 v72 v70 v76 v126 v156 v182 v217 v229 v241 v260 v274 v302 v353 v376) (block 23))) - - (block 23 - (br (block 21))) - - (block 24 - (br (block 12 v70 v76 v156 v59 v182 v217 v229 v241 v260 v274 v302 v353 v376))) - - (block 25 - (param v87 i32) - (param v116 i32) - (param v119 i32) - (param v150 i32) - (param v157 i32) - (param v177 i32) - (param v186 i32) - (param v221 i32) - (param v233 i32) - (param v248 i32) - (param v267 i32) - (param v281 i32) - (param v309 i32) - (param v359 i32) - (param v382 i32) - (let (v86 i32) (const.i32 16843008)) - (let (v88 u32) (bitcast v87)) - (let (v89 u32) (mod.unchecked v88 4)) - (assertz 250 v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (let (v91 i32) (load v90)) - (let (v92 i32) (const.i32 168430090)) - (let (v93 i32) (bxor v91 v92)) - (let (v94 i32) (sub.wrapping v86 v93)) - (let (v95 i32) (bor v94 v91)) - (let (v96 i32) (const.i32 16843008)) - (let (v97 i32) (const.i32 4)) - (let (v98 i32) (add.wrapping v87 v97)) - (let (v99 u32) (bitcast v98)) - (let (v100 u32) (mod.unchecked v99 4)) - (assertz 250 v100) - (let (v101 (ptr i32)) (inttoptr v99)) - (let (v102 i32) (load v101)) - (let (v103 i32) (const.i32 168430090)) - (let (v104 i32) (bxor v102 v103)) - (let (v105 i32) (sub.wrapping v96 v104)) - (let (v106 i32) (bor v105 v102)) - (let (v107 i32) (band v95 v106)) - (let (v108 i32) (const.i32 -2139062144)) - (let (v109 i32) (band v107 v108)) - (let (v110 i32) (const.i32 -2139062144)) - (let (v111 i1) (neq v109 v110)) - (let (v112 i32) (zext v111)) - (let (v113 i1) (neq v112 0)) - (condbr v113 (block 12 v116 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382) (block 27))) - - (block 26) - - (block 27 - (let (v114 i32) (const.i32 8)) - (let (v115 i32) (add.wrapping v87 v114)) - (let (v117 i32) (const.i32 8)) - (let (v118 i32) (add.wrapping v116 v117)) - (let (v120 u32) (bitcast v118)) - (let (v121 u32) (bitcast v119)) - (let (v122 i1) (lte v120 v121)) - (let (v123 i32) (sext v122)) - (let (v124 i1) (neq v123 0)) - (condbr v124 (block 25 v115 v118 v119 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382) (block 28))) - - (block 28 - (br (block 12 v118 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382))) - - (block 29 - (param v130 i32) - (param v131 i32) - (param v141 i32) - (param v147 i32) - (param v183 i32) - (param v218 i32) - (param v230 i32) - (param v245 i32) - (param v264 i32) - (param v278 i32) - (param v306 i32) - (param v356 i32) - (param v379 i32) - (let (v132 i32) (add.wrapping v130 v131)) - (let (v133 u32) (bitcast v132)) - (let (v134 (ptr u8)) (inttoptr v133)) - (let (v135 u8) (load v134)) - (let (v136 i32) (zext v135)) - (let (v137 i32) (const.i32 10)) - (let (v138 i1) (eq v136 v137)) - (let (v139 i32) (zext v138)) - (let (v140 i1) (neq v139 0)) - (condbr v140 (block 11 v131 v183 v147 v130 v218 v230 v245 v264 v278 v306 v356 v379) (block 31))) - - (block 30 - (br (block 7 v230 v147 v245 v264 v278 v306 v218 v147 v379))) - - (block 31 - (let (v142 i32) (const.i32 1)) - (let (v143 i32) (add.wrapping v131 v142)) - (let (v144 i1) (neq v141 v143)) - (let (v145 i32) (zext v144)) - (let (v146 i1) (neq v145 0)) - (condbr v146 (block 29 v130 v143 v141 v147 v183 v218 v230 v245 v264 v278 v306 v356 v379) (block 32))) - - (block 32 - (br (block 30))) - - (block 33 - (br (block 35 v176 v148 v149 v155 v185 v220 v232 v247 v266 v280 v308 v358 v381))) - - (block 34 - (br (block 7 v232 v155 v247 v266 v280 v308 v220 v155 v381))) - - (block 35 - (param v159 i32) - (param v160 i32) - (param v170 i32) - (param v179 i32) - (param v184 i32) - (param v219 i32) - (param v231 i32) - (param v246 i32) - (param v265 i32) - (param v279 i32) - (param v307 i32) - (param v357 i32) - (param v380 i32) - (let (v161 i32) (add.wrapping v159 v160)) - (let (v162 u32) (bitcast v161)) - (let (v163 (ptr u8)) (inttoptr v162)) - (let (v164 u8) (load v163)) - (let (v165 i32) (zext v164)) - (let (v166 i32) (const.i32 10)) - (let (v167 i1) (neq v165 v166)) - (let (v168 i32) (zext v167)) - (let (v169 i1) (neq v168 0)) - (condbr v169 (block 37) (block 38))) - - (block 36 - (br (block 7 v231 v179 v246 v265 v279 v307 v219 v179 v380))) - - (block 37 - (let (v171 i32) (const.i32 1)) - (let (v172 i32) (add.wrapping v160 v171)) - (let (v173 i1) (neq v170 v172)) - (let (v174 i32) (zext v173)) - (let (v175 i1) (neq v174 0)) - (condbr v175 (block 35 v159 v172 v170 v179 v184 v219 v231 v246 v265 v279 v307 v357 v380) (block 39))) - - (block 38 - (br (block 11 v160 v184 v179 v159 v219 v231 v246 v265 v279 v307 v357 v380))) - - (block 39 - (br (block 36))) - - (block 40 - (param v207 i32) - (param v208 i32) - (param v215 i32) - (param v227 i32) - (param v244 i32) - (param v263 i32) - (param v277 i32) - (param v305 i32) - (param v355 i32) - (param v378 i32) - (let (v209 u32) (bitcast v207)) - (let (v210 u32) (bitcast v208)) - (let (v211 i1) (lte v209 v210)) - (let (v212 i32) (sext v211)) - (let (v213 i1) (neq v212 0)) - (condbr v213 (block 9 v215 v207 v208 v227 v244 v263 v277 v305 v355 v378) (block 43))) - - (block 41 - (let (v198 i32) (add.wrapping v197 v180)) - (let (v199 u32) (bitcast v198)) - (let (v200 (ptr u8)) (inttoptr v199)) - (let (v201 u8) (load v200)) - (let (v202 i32) (zext v201)) - (let (v203 i32) (const.i32 10)) - (let (v204 i1) (neq v202 v203)) - (let (v205 i32) (zext v204)) - (let (v206 i1) (neq v205 0)) - (condbr v206 (block 40 v190 v191 v216 v228 v240 v259 v273 v301 v352 v375) (block 42))) - - (block 42 - (br (block 6 v240 v259 v273 v190 v228 v301 v216 v190 v352 v190 v191 v375))) - - (block 43 - (br (block 10))) - - (block 44 - (br (block 6 v250 v269 v283 v235 v224 v311 v323 v224 v223 v364 v235 v384))) - - (block 45 - (br (block 4))) - - (block 46 - (param v290 i32) - (param v292 i32) - (param v299 i32) - (param v321 i32) - (param v327 i32) - (param v334 i32) - (param v337 i32) - (param v340 i32) - (param v350 i32) - (param v362 i32) - (param v366 i32) - (param v373 i32) - (let (v294 i32) (sub.wrapping v290 v292)) - (let (v295 i32) (const.i32 0)) - (let (v296 i1) (eq v290 v292)) - (let (v297 i32) (zext v296)) - (let (v298 i1) (neq v297 0)) - (condbr v298 (block 49 v321 v292 v327 v295 v334 v337 v294 v340 v350 v362 v366 v299 v373) (block 50))) - - (block 47 - (let (v270 i32) (const.i32 1048956)) - (let (v271 i32) (const.i32 4)) - (let (v284 u32) (bitcast v272)) - (let (v285 u32) (add.checked v284 12)) - (let (v286 u32) (mod.unchecked v285 4)) - (assertz 250 v286) - (let (v287 (ptr i32)) (inttoptr v285)) - (let (v288 i32) (load v287)) - (let (v289 i1) (neq v288 0)) - (condbr v289 (block 45) (block 48))) - - (block 48 - (br (block 46 v291 v293 v300 v322 v239 v335 v258 v272 v351 v363 v367 v374))) - - (block 49 - (param v320 i32) - (param v324 i32) - (param v326 i32) - (param v328 i32) - (param v333 i32) - (param v336 i32) - (param v338 i32) - (param v339 i32) - (param v349 i32) - (param v361 i32) - (param v365 i32) - (param v368 i32) - (param v372 i32) - (let (v325 i32) (add.wrapping v320 v324)) - (let (v329 u32) (bitcast v328)) - (let (v330 u8) (trunc v329)) - (let (v331 u32) (bitcast v326)) - (let (v332 (ptr u8)) (inttoptr v331)) - (store v332 v330) - (let (v341 u32) (bitcast v339)) - (let (v342 u32) (add.checked v341 12)) - (let (v343 u32) (mod.unchecked v342 4)) - (assertz 250 v343) - (let (v344 (ptr i32)) (inttoptr v342)) - (let (v345 i32) (load v344)) - (let (v346 i1) (eq v345 0)) - (let (v347 i32) (zext v346)) - (let (v348 i1) (neq v347 0)) - (condbr v348 (block 3 v349 v361 v365 v320 v333 v326 v336 v339 v368 v372) (block 51))) - - (block 50 - (let (v312 i32) (add.wrapping v299 v290)) - (let (v313 u32) (bitcast v312)) - (let (v314 (ptr u8)) (inttoptr v313)) - (let (v315 u8) (load v314)) - (let (v316 i32) (zext v315)) - (let (v317 i32) (const.i32 10)) - (let (v318 i1) (eq v316 v317)) - (let (v319 i32) (zext v318)) - (br (block 49 v321 v292 v327 v319 v334 v337 v294 v340 v350 v362 v366 v299 v373))) - - (block 51 - (br (block 45))) - ) - - (func (export #::write_char) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 u32) (bitcast v0)) - (let (v5 u32) (add.checked v4 4)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 u32) (bitcast v0)) - (let (v10 u32) (mod.unchecked v9 4)) - (assertz 250 v10) - (let (v11 (ptr i32)) (inttoptr v9)) - (let (v12 i32) (load v11)) - (let (v13 u32) (bitcast v0)) - (let (v14 u32) (add.checked v13 8)) - (let (v15 u32) (mod.unchecked v14 4)) - (assertz 250 v15) - (let (v16 (ptr i32)) (inttoptr v14)) - (let (v17 i32) (load v16)) - (let (v18 u32) (bitcast v17)) - (let (v19 (ptr u8)) (inttoptr v18)) - (let (v20 u8) (load v19)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (eq v21 0)) - (let (v23 i32) (zext v22)) - (let (v24 i1) (neq v23 0)) - (condbr v24 (block 2 v17 v1 v12 v8) (block 3))) - - (block 1 (param v2 i32) - (ret v2)) - - (block 2 - (param v36 i32) - (param v37 i32) - (param v45 i32) - (param v46 i32) - (let (v38 i32) (const.i32 10)) - (let (v39 i1) (eq v37 v38)) - (let (v40 i32) (zext v39)) - (let (v41 u32) (bitcast v40)) - (let (v42 u8) (trunc v41)) - (let (v43 u32) (bitcast v36)) - (let (v44 (ptr u8)) (inttoptr v43)) - (store v44 v42) - (let (v47 u32) (bitcast v46)) - (let (v48 u32) (add.checked v47 16)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (let (v51 i32) (load v50)) - (br (block 1 v51))) - - (block 3 - (let (v25 i32) (const.i32 1048956)) - (let (v26 i32) (const.i32 4)) - (let (v27 u32) (bitcast v8)) - (let (v28 u32) (add.checked v27 12)) - (let (v29 u32) (mod.unchecked v28 4)) - (assertz 250 v29) - (let (v30 (ptr i32)) (inttoptr v28)) - (let (v31 i32) (load v30)) - (let (v32 i1) (eq v31 0)) - (let (v33 i32) (zext v32)) - (let (v34 i1) (neq v33 0)) - (condbr v34 (block 2 v17 v1 v12 v8) (block 4))) - - (block 4 - (let (v35 i32) (const.i32 1)) - (ret v35)) - ) - - (func (export #core::fmt::builders::DebugStruct::finish) - (param i32) (result i32) - (block 0 (param v0 i32) - (let (v2 i32) (const.i32 0)) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (add.checked v3 4)) - (let (v5 (ptr u8)) (inttoptr v4)) - (let (v6 u8) (load v5)) - (let (v7 i32) (zext v6)) - (let (v8 u32) (bitcast v0)) - (let (v9 u32) (add.checked v8 5)) - (let (v10 (ptr u8)) (inttoptr v9)) - (let (v11 u8) (load v10)) - (let (v12 i32) (zext v11)) - (let (v13 i1) (eq v12 0)) - (let (v14 i32) (zext v13)) - (let (v15 i1) (neq v14 0)) - (condbr v15 (block 2 v7) (block 3))) - - (block 1 (param v1 i32) - (ret v1)) - - (block 2 (param v73 i32) - (let (v74 i32) (const.i32 1)) - (let (v75 i32) (band v73 v74)) - (br (block 1 v75))) - - (block 3 - (let (v16 i32) (const.i32 1)) - (let (v17 i32) (const.i32 1)) - (let (v18 i32) (band v7 v17)) - (let (v19 i1) (neq v18 0)) - (condbr v19 (block 4 v0 v16) (block 5))) - - (block 4 (param v66 i32) (param v67 i32) - (let (v68 u32) (bitcast v67)) - (let (v69 u8) (trunc v68)) - (let (v70 u32) (bitcast v66)) - (let (v71 u32) (add.checked v70 4)) - (let (v72 (ptr u8)) (inttoptr v71)) - (store v72 v69) - (br (block 2 v67))) - - (block 5 - (let (v20 u32) (bitcast v0)) - (let (v21 u32) (mod.unchecked v20 4)) - (assertz 250 v21) - (let (v22 (ptr i32)) (inttoptr v20)) - (let (v23 i32) (load v22)) - (let (v24 u32) (bitcast v23)) - (let (v25 u32) (add.checked v24 28)) - (let (v26 (ptr u8)) (inttoptr v25)) - (let (v27 u8) (load v26)) - (let (v28 i32) (zext v27)) - (let (v29 i32) (const.i32 4)) - (let (v30 i32) (band v28 v29)) - (let (v31 i1) (neq v30 0)) - (condbr v31 (block 6) (block 7))) - - (block 6 - (let (v49 u32) (bitcast v23)) - (let (v50 u32) (add.checked v49 20)) - (let (v51 u32) (mod.unchecked v50 4)) - (assertz 250 v51) - (let (v52 (ptr i32)) (inttoptr v50)) - (let (v53 i32) (load v52)) - (let (v54 i32) (const.i32 1048970)) - (let (v55 i32) (const.i32 1)) - (let (v56 u32) (bitcast v23)) - (let (v57 u32) (add.checked v56 24)) - (let (v58 u32) (mod.unchecked v57 4)) - (assertz 250 v58) - (let (v59 (ptr i32)) (inttoptr v57)) - (let (v60 i32) (load v59)) - (let (v61 u32) (bitcast v60)) - (let (v62 u32) (add.checked v61 12)) - (let (v63 u32) (mod.unchecked v62 4)) - (assertz 250 v63) - (let (v64 (ptr i32)) (inttoptr v62)) - (let (v65 i32) (load v64)) - (br (block 4 v0 v65))) - - (block 7 - (let (v32 u32) (bitcast v23)) - (let (v33 u32) (add.checked v32 20)) - (let (v34 u32) (mod.unchecked v33 4)) - (assertz 250 v34) - (let (v35 (ptr i32)) (inttoptr v33)) - (let (v36 i32) (load v35)) - (let (v37 i32) (const.i32 1048971)) - (let (v38 i32) (const.i32 2)) - (let (v39 u32) (bitcast v23)) - (let (v40 u32) (add.checked v39 24)) - (let (v41 u32) (mod.unchecked v40 4)) - (assertz 250 v41) - (let (v42 (ptr i32)) (inttoptr v40)) - (let (v43 i32) (load v42)) - (let (v44 u32) (bitcast v43)) - (let (v45 u32) (add.checked v44 12)) - (let (v46 u32) (mod.unchecked v45 4)) - (assertz 250 v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (let (v48 i32) (load v47)) - (br (block 4 v0 v48))) - ) - - (func (export #core::fmt::Formatter::pad_integral) - (param i32) (param i32) (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 - (param v0 i32) - (param v1 i32) - (param v2 i32) - (param v3 i32) - (param v4 i32) - (param v5 i32) - (let (v7 i32) (const.i32 0)) - (let (v8 i1) (neq v1 0)) - (condbr v8 (block 3) (block 4))) - - (block 1 (param v6 i32) - (ret v6)) - - (block 2 - (param v29 i32) - (param v34 i32) - (param v41 i32) - (param v134 i32) - (param v140 i32) - (param v161 i32) - (param v180 i32) - (param v186 i32) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (band v29 v30)) - (let (v32 i1) (neq v31 0)) - (condbr v32 (block 6) (block 7))) - - (block 3 - (let (v17 i32) (const.i32 43)) - (let (v18 i32) (const.i32 1114112)) - (let (v19 u32) (bitcast v0)) - (let (v20 u32) (add.checked v19 28)) - (let (v21 u32) (mod.unchecked v20 4)) - (assertz 250 v21) - (let (v22 (ptr i32)) (inttoptr v20)) - (let (v23 i32) (load v22)) - (let (v24 i32) (const.i32 1)) - (let (v25 i32) (band v23 v24)) - (let (v26 i1) (neq v25 0)) - (let (v27 i32) (select v26 v17 v18)) - (let (v28 i32) (add.wrapping v25 v5)) - (br (block 2 v23 v3 v2 v28 v0 v27 v4 v5))) - - (block 4 - (let (v9 i32) (const.i32 1)) - (let (v10 i32) (add.wrapping v5 v9)) - (let (v11 u32) (bitcast v0)) - (let (v12 u32) (add.checked v11 28)) - (let (v13 u32) (mod.unchecked v12 4)) - (assertz 250 v13) - (let (v14 (ptr i32)) (inttoptr v12)) - (let (v15 i32) (load v14)) - (let (v16 i32) (const.i32 45)) - (br (block 2 v15 v3 v2 v10 v0 v16 v4 v5))) - - (block 5 - (param v139 i32) - (param v160 i32) - (param v166 i32) - (param v169 i32) - (param v179 i32) - (param v185 i32) - (param v201 i32) - (param v222 i32) - (let (v145 u32) (bitcast v139)) - (let (v146 u32) (mod.unchecked v145 4)) - (assertz 250 v146) - (let (v147 (ptr i32)) (inttoptr v145)) - (let (v148 i32) (load v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 23) (block 24))) - - (block 6 - (let (v35 i32) (const.i32 16)) - (let (v36 u32) (bitcast v34)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (lt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 9) (block 10))) - - (block 7 - (let (v33 i32) (const.i32 0)) - (br (block 5 v140 v161 v33 v34 v180 v186 v134 v29))) - - (block 8 - (param v132 i32) - (param v133 i32) - (param v141 i32) - (param v162 i32) - (param v167 i32) - (param v170 i32) - (param v181 i32) - (param v187 i32) - (param v223 i32) - (let (v138 i32) (add.wrapping v132 v133)) - (br (block 5 v141 v162 v167 v170 v181 v187 v138 v223))) - - (block 9 - (let (v43 i1) (neq v34 0)) - (condbr v43 (block 11) (block 12))) - - (block 10 - (let (v42 i32) (call #core::str::count::do_count_chars v41 v34)) - (br (block 8 v42 v134 v140 v161 v41 v34 v180 v186 v29))) - - (block 11 - (let (v45 i32) (const.i32 3)) - (let (v46 i32) (band v34 v45)) - (let (v47 i32) (const.i32 4)) - (let (v48 u32) (bitcast v34)) - (let (v49 u32) (bitcast v47)) - (let (v50 i1) (gte v48 v49)) - (let (v51 i32) (zext v50)) - (let (v52 i1) (neq v51 0)) - (condbr v52 (block 14) (block 15))) - - (block 12 - (let (v44 i32) (const.i32 0)) - (br (block 8 v44 v134 v140 v161 v41 v34 v180 v186 v29))) - - (block 13 - (param v107 i32) - (param v112 i32) - (param v113 i32) - (param v131 i32) - (param v135 i32) - (param v142 i32) - (param v163 i32) - (param v171 i32) - (param v182 i32) - (param v188 i32) - (param v224 i32) - (let (v109 i1) (eq v107 0)) - (let (v110 i32) (zext v109)) - (let (v111 i1) (neq v110 0)) - (condbr v111 (block 8 v131 v135 v142 v163 v112 v171 v182 v188 v224) (block 19))) - - (block 14 - (let (v55 i32) (const.i32 12)) - (let (v56 i32) (band v34 v55)) - (let (v57 i32) (const.i32 0)) - (let (v58 i32) (const.i32 0)) - (br (block 16 v57 v41 v58 v56 v46 v134 v140 v161 v34 v180 v186 v29))) - - (block 15 - (let (v53 i32) (const.i32 0)) - (let (v54 i32) (const.i32 0)) - (br (block 13 v46 v41 v54 v53 v134 v140 v161 v34 v180 v186 v29))) - - (block 16 - (param v59 i32) - (param v60 i32) - (param v61 i32) - (param v101 i32) - (param v108 i32) - (param v136 i32) - (param v143 i32) - (param v164 i32) - (param v172 i32) - (param v183 i32) - (param v189 i32) - (param v225 i32) - (let (v62 i32) (add.wrapping v60 v61)) - (let (v63 u32) (bitcast v62)) - (let (v64 (ptr i8)) (inttoptr v63)) - (let (v65 i8) (load v64)) - (let (v66 i32) (sext v65)) - (let (v67 i32) (const.i32 -65)) - (let (v68 i1) (gt v66 v67)) - (let (v69 i32) (zext v68)) - (let (v70 i32) (add.wrapping v59 v69)) - (let (v71 i32) (const.i32 1)) - (let (v72 i32) (add.wrapping v62 v71)) - (let (v73 u32) (bitcast v72)) - (let (v74 (ptr i8)) (inttoptr v73)) - (let (v75 i8) (load v74)) - (let (v76 i32) (sext v75)) - (let (v77 i32) (const.i32 -65)) - (let (v78 i1) (gt v76 v77)) - (let (v79 i32) (zext v78)) - (let (v80 i32) (add.wrapping v70 v79)) - (let (v81 i32) (const.i32 2)) - (let (v82 i32) (add.wrapping v62 v81)) - (let (v83 u32) (bitcast v82)) - (let (v84 (ptr i8)) (inttoptr v83)) - (let (v85 i8) (load v84)) - (let (v86 i32) (sext v85)) - (let (v87 i32) (const.i32 -65)) - (let (v88 i1) (gt v86 v87)) - (let (v89 i32) (zext v88)) - (let (v90 i32) (add.wrapping v80 v89)) - (let (v91 i32) (const.i32 3)) - (let (v92 i32) (add.wrapping v62 v91)) - (let (v93 u32) (bitcast v92)) - (let (v94 (ptr i8)) (inttoptr v93)) - (let (v95 i8) (load v94)) - (let (v96 i32) (sext v95)) - (let (v97 i32) (const.i32 -65)) - (let (v98 i1) (gt v96 v97)) - (let (v99 i32) (zext v98)) - (let (v100 i32) (add.wrapping v90 v99)) - (let (v102 i32) (const.i32 4)) - (let (v103 i32) (add.wrapping v61 v102)) - (let (v104 i1) (neq v101 v103)) - (let (v105 i32) (zext v104)) - (let (v106 i1) (neq v105 0)) - (condbr v106 (block 16 v100 v60 v103 v101 v108 v136 v143 v164 v172 v183 v189 v225) (block 18))) - - (block 17 - (br (block 13 v108 v60 v103 v100 v136 v143 v164 v172 v183 v189 v225))) - - (block 18 - (br (block 17))) - - (block 19 - (let (v114 i32) (add.wrapping v112 v113)) - (br (block 20 v131 v114 v107 v135 v142 v163 v112 v171 v182 v188 v224))) - - (block 20 - (param v115 i32) - (param v116 i32) - (param v127 i32) - (param v137 i32) - (param v144 i32) - (param v165 i32) - (param v168 i32) - (param v173 i32) - (param v184 i32) - (param v190 i32) - (param v226 i32) - (let (v117 u32) (bitcast v116)) - (let (v118 (ptr i8)) (inttoptr v117)) - (let (v119 i8) (load v118)) - (let (v120 i32) (sext v119)) - (let (v121 i32) (const.i32 -65)) - (let (v122 i1) (gt v120 v121)) - (let (v123 i32) (zext v122)) - (let (v124 i32) (add.wrapping v115 v123)) - (let (v125 i32) (const.i32 1)) - (let (v126 i32) (add.wrapping v116 v125)) - (let (v128 i32) (const.i32 -1)) - (let (v129 i32) (add.wrapping v127 v128)) - (let (v130 i1) (neq v129 0)) - (condbr v130 (block 20 v124 v126 v129 v137 v144 v165 v168 v173 v184 v190 v226) (block 22))) - - (block 21 - (br (block 8 v124 v137 v144 v165 v168 v173 v184 v190 v226))) - - (block 22 - (br (block 21))) - - (block 23 - (let (v196 u32) (bitcast v139)) - (let (v197 u32) (add.checked v196 4)) - (let (v198 u32) (mod.unchecked v197 4)) - (assertz 250 v198) - (let (v199 (ptr i32)) (inttoptr v197)) - (let (v200 i32) (load v199)) - (let (v202 u32) (bitcast v200)) - (let (v203 u32) (bitcast v201)) - (let (v204 i1) (gt v202 v203)) - (let (v205 i32) (sext v204)) - (let (v206 i1) (neq v205 0)) - (condbr v206 (block 30) (block 31))) - - (block 24 - (let (v150 u32) (bitcast v139)) - (let (v151 u32) (add.checked v150 20)) - (let (v152 u32) (mod.unchecked v151 4)) - (assertz 250 v152) - (let (v153 (ptr i32)) (inttoptr v151)) - (let (v154 i32) (load v153)) - (let (v155 u32) (bitcast v139)) - (let (v156 u32) (add.checked v155 24)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v174 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v154 v159 v160 v166 v169)) - (let (v175 i1) (eq v174 0)) - (let (v176 i32) (zext v175)) - (let (v177 i1) (neq v176 0)) - (condbr v177 (block 25) (block 26))) - - (block 25 - (let (v191 u32) (bitcast v159)) - (let (v192 u32) (add.checked v191 12)) - (let (v193 u32) (mod.unchecked v192 4)) - (assertz 250 v193) - (let (v194 (ptr i32)) (inttoptr v192)) - (let (v195 i32) (load v194)) - (ret v195)) - - (block 26 - (let (v178 i32) (const.i32 1)) - (ret v178)) - - (block 27 (param v423 i32) - (br (block 1 v423))) - - (block 28 - (let (v316 i32) (sub.wrapping v200 v201)) - (let (v317 u32) (bitcast v139)) - (let (v318 u32) (add.checked v317 32)) - (let (v319 (ptr u8)) (inttoptr v318)) - (let (v320 u8) (load v319)) - (let (v321 i32) (zext v320)) - (let (v322 u32) (cast v321)) - (switchv322 - (0 . (block 44)) - (1 . (block 44)) - (2 . (block 43)) - (3 . (block 42 v321 v139 v160 v166 v169 v179 v185 v316)) - (_ . (block 42 v321 v139 v160 v166 v169 v179 v185 v316)))) - - (block 29 - (let (v311 u32) (bitcast v216)) - (let (v312 u32) (add.checked v311 12)) - (let (v313 u32) (mod.unchecked v312 4)) - (assertz 250 v313) - (let (v314 (ptr i32)) (inttoptr v312)) - (let (v315 i32) (load v314)) - (br (block 27 v315))) - - (block 30 - (let (v227 i32) (const.i32 8)) - (let (v228 i32) (band v222 v227)) - (let (v229 i1) (eq v228 0)) - (let (v230 i32) (zext v229)) - (let (v231 i1) (neq v230 0)) - (condbr v231 (block 28) (block 33))) - - (block 31 - (let (v207 u32) (bitcast v139)) - (let (v208 u32) (add.checked v207 20)) - (let (v209 u32) (mod.unchecked v208 4)) - (assertz 250 v209) - (let (v210 (ptr i32)) (inttoptr v208)) - (let (v211 i32) (load v210)) - (let (v212 u32) (bitcast v139)) - (let (v213 u32) (add.checked v212 24)) - (let (v214 u32) (mod.unchecked v213 4)) - (assertz 250 v214) - (let (v215 (ptr i32)) (inttoptr v213)) - (let (v216 i32) (load v215)) - (let (v217 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v211 v216 v160 v166 v169)) - (let (v218 i1) (eq v217 0)) - (let (v219 i32) (zext v218)) - (let (v220 i1) (neq v219 0)) - (condbr v220 (block 29) (block 32))) - - (block 32 - (let (v221 i32) (const.i32 1)) - (ret v221)) - - (block 33 - (let (v232 u32) (bitcast v139)) - (let (v233 u32) (add.checked v232 16)) - (let (v234 u32) (mod.unchecked v233 4)) - (assertz 250 v234) - (let (v235 (ptr i32)) (inttoptr v233)) - (let (v236 i32) (load v235)) - (let (v237 i32) (const.i32 48)) - (let (v238 u32) (bitcast v139)) - (let (v239 u32) (add.checked v238 16)) - (let (v240 u32) (mod.unchecked v239 4)) - (assertz 250 v240) - (let (v241 (ptr i32)) (inttoptr v239)) - (store v241 v237) - (let (v242 u32) (bitcast v139)) - (let (v243 u32) (add.checked v242 32)) - (let (v244 (ptr u8)) (inttoptr v243)) - (let (v245 u8) (load v244)) - (let (v246 i32) (zext v245)) - (let (v247 i32) (const.i32 1)) - (let (v248 i32) (const.i32 1)) - (let (v249 u32) (bitcast v248)) - (let (v250 u8) (trunc v249)) - (let (v251 u32) (bitcast v139)) - (let (v252 u32) (add.checked v251 32)) - (let (v253 (ptr u8)) (inttoptr v252)) - (store v253 v250) - (let (v254 u32) (bitcast v139)) - (let (v255 u32) (add.checked v254 20)) - (let (v256 u32) (mod.unchecked v255 4)) - (assertz 250 v256) - (let (v257 (ptr i32)) (inttoptr v255)) - (let (v258 i32) (load v257)) - (let (v259 u32) (bitcast v139)) - (let (v260 u32) (add.checked v259 24)) - (let (v261 u32) (mod.unchecked v260 4)) - (assertz 250 v261) - (let (v262 (ptr i32)) (inttoptr v260)) - (let (v263 i32) (load v262)) - (let (v264 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v258 v263 v160 v166 v169)) - (let (v265 i1) (neq v264 0)) - (condbr v265 (block 27 v247) (block 34))) - - (block 34 - (let (v266 i32) (sub.wrapping v200 v201)) - (let (v267 i32) (const.i32 1)) - (let (v268 i32) (add.wrapping v266 v267)) - (br (block 36 v268 v258 v263 v179 v185 v139 v246 v236))) - - (block 35 - (let (v289 u32) (bitcast v277)) - (let (v290 u32) (add.checked v289 12)) - (let (v291 u32) (mod.unchecked v290 4)) - (assertz 250 v291) - (let (v292 (ptr i32)) (inttoptr v290)) - (let (v293 i32) (load v292)) - (let (v294 i1) (eq v293 0)) - (let (v295 i32) (zext v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 40) (block 41))) - - (block 36 - (param v269 i32) - (param v275 i32) - (param v277 i32) - (param v287 i32) - (param v288 i32) - (param v298 i32) - (param v299 i32) - (param v305 i32) - (let (v270 i32) (const.i32 -1)) - (let (v271 i32) (add.wrapping v269 v270)) - (let (v272 i1) (eq v271 0)) - (let (v273 i32) (zext v272)) - (let (v274 i1) (neq v273 0)) - (condbr v274 (block 35) (block 38))) - - (block 37 - (let (v286 i32) (const.i32 1)) - (ret v286)) - - (block 38 - (let (v276 i32) (const.i32 48)) - (let (v278 u32) (bitcast v277)) - (let (v279 u32) (add.checked v278 16)) - (let (v280 u32) (mod.unchecked v279 4)) - (assertz 250 v280) - (let (v281 (ptr i32)) (inttoptr v279)) - (let (v282 i32) (load v281)) - (let (v283 i1) (eq v282 0)) - (let (v284 i32) (zext v283)) - (let (v285 i1) (neq v284 0)) - (condbr v285 (block 36 v271 v275 v277 v287 v288 v298 v299 v305) (block 39))) - - (block 39 - (br (block 37))) - - (block 40 - (let (v300 u32) (bitcast v299)) - (let (v301 u8) (trunc v300)) - (let (v302 u32) (bitcast v298)) - (let (v303 u32) (add.checked v302 32)) - (let (v304 (ptr u8)) (inttoptr v303)) - (store v304 v301) - (let (v306 u32) (bitcast v298)) - (let (v307 u32) (add.checked v306 16)) - (let (v308 u32) (mod.unchecked v307 4)) - (assertz 250 v308) - (let (v309 (ptr i32)) (inttoptr v307)) - (store v309 v305) - (let (v310 i32) (const.i32 0)) - (ret v310)) - - (block 41 - (let (v297 i32) (const.i32 1)) - (ret v297)) - - (block 42 - (param v336 i32) - (param v339 i32) - (param v375 i32) - (param v377 i32) - (param v379 i32) - (param v383 i32) - (param v385 i32) - (param v416 i32) - (let (v337 i32) (const.i32 1)) - (let (v338 i32) (add.wrapping v336 v337)) - (let (v340 u32) (bitcast v339)) - (let (v341 u32) (add.checked v340 16)) - (let (v342 u32) (mod.unchecked v341 4)) - (assertz 250 v342) - (let (v343 (ptr i32)) (inttoptr v341)) - (let (v344 i32) (load v343)) - (let (v345 u32) (bitcast v339)) - (let (v346 u32) (add.checked v345 24)) - (let (v347 u32) (mod.unchecked v346 4)) - (assertz 250 v347) - (let (v348 (ptr i32)) (inttoptr v346)) - (let (v349 i32) (load v348)) - (let (v350 u32) (bitcast v339)) - (let (v351 u32) (add.checked v350 20)) - (let (v352 u32) (mod.unchecked v351 4)) - (assertz 250 v352) - (let (v353 (ptr i32)) (inttoptr v351)) - (let (v354 i32) (load v353)) - (br (block 46 v338 v354 v344 v349 v375 v377 v379 v383 v385 v416))) - - (block 43 - (let (v324 i32) (const.i32 1)) - (let (v325 u32) (bitcast v316)) - (let (v326 u32) (bitcast v324)) - (let (v327 u32) (shr.wrapping v325 v326)) - (let (v328 i32) (bitcast v327)) - (let (v329 i32) (const.i32 1)) - (let (v330 i32) (add.wrapping v316 v329)) - (let (v331 i32) (const.i32 1)) - (let (v332 u32) (bitcast v330)) - (let (v333 u32) (bitcast v331)) - (let (v334 u32) (shr.wrapping v332 v333)) - (let (v335 i32) (bitcast v334)) - (br (block 42 v328 v139 v160 v166 v169 v179 v185 v335))) - - (block 44 - (let (v323 i32) (const.i32 0)) - (br (block 42 v316 v139 v160 v166 v169 v179 v185 v323))) - - (block 45 - (let (v373 i32) (const.i32 1)) - (let (v380 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v361 v363 v374 v376 v378)) - (let (v381 i1) (neq v380 0)) - (condbr v381 (block 27 v373) (block 50))) - - (block 46 - (param v355 i32) - (param v361 i32) - (param v362 i32) - (param v363 i32) - (param v374 i32) - (param v376 i32) - (param v378 i32) - (param v382 i32) - (param v384 i32) - (param v415 i32) - (let (v356 i32) (const.i32 -1)) - (let (v357 i32) (add.wrapping v355 v356)) - (let (v358 i1) (eq v357 0)) - (let (v359 i32) (zext v358)) - (let (v360 i1) (neq v359 0)) - (condbr v360 (block 45) (block 48))) - - (block 47 - (let (v372 i32) (const.i32 1)) - (ret v372)) - - (block 48 - (let (v364 u32) (bitcast v363)) - (let (v365 u32) (add.checked v364 16)) - (let (v366 u32) (mod.unchecked v365 4)) - (assertz 250 v366) - (let (v367 (ptr i32)) (inttoptr v365)) - (let (v368 i32) (load v367)) - (let (v369 i1) (eq v368 0)) - (let (v370 i32) (zext v369)) - (let (v371 i1) (neq v370 0)) - (condbr v371 (block 46 v357 v361 v362 v363 v374 v376 v378 v382 v384 v415) (block 49))) - - (block 49 - (br (block 47))) - - (block 50 - (let (v386 u32) (bitcast v363)) - (let (v387 u32) (add.checked v386 12)) - (let (v388 u32) (mod.unchecked v387 4)) - (assertz 250 v388) - (let (v389 (ptr i32)) (inttoptr v387)) - (let (v390 i32) (load v389)) - (let (v391 i1) (neq v390 0)) - (condbr v391 (block 27 v373) (block 51))) - - (block 51 - (let (v392 i32) (const.i32 0)) - (br (block 52 v415 v392 v361 v362 v363))) - - (block 52 - (param v393 i32) - (param v394 i32) - (param v404 i32) - (param v405 i32) - (param v406 i32) - (let (v395 i1) (neq v393 v394)) - (let (v396 i32) (zext v395)) - (let (v397 i1) (neq v396 0)) - (condbr v397 (block 54) (block 55))) - - (block 53 - (let (v417 i32) (const.i32 -1)) - (let (v418 i32) (add.wrapping v403 v417)) - (let (v419 u32) (bitcast v418)) - (let (v420 u32) (bitcast v393)) - (let (v421 i1) (lt v419 v420)) - (let (v422 i32) (sext v421)) - (ret v422)) - - (block 54 - (let (v402 i32) (const.i32 1)) - (let (v403 i32) (add.wrapping v394 v402)) - (let (v407 u32) (bitcast v406)) - (let (v408 u32) (add.checked v407 16)) - (let (v409 u32) (mod.unchecked v408 4)) - (assertz 250 v409) - (let (v410 (ptr i32)) (inttoptr v408)) - (let (v411 i32) (load v410)) - (let (v412 i1) (eq v411 0)) - (let (v413 i32) (zext v412)) - (let (v414 i1) (neq v413 0)) - (condbr v414 (block 52 v393 v403 v404 v405 v406) (block 56))) - - (block 55 - (let (v398 u32) (bitcast v393)) - (let (v399 u32) (bitcast v393)) - (let (v400 i1) (lt v398 v399)) - (let (v401 i32) (sext v400)) - (ret v401)) - - (block 56 - (br (block 53))) - ) - - (func (export #core::fmt::Write::write_fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048932)) - (let (v4 i32) (call #core::fmt::write v0 v3 v1)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #core::str::count::do_count_chars) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i32) (const.i32 3)) - (let (v5 i32) (add.wrapping v0 v4)) - (let (v6 i32) (const.i32 -4)) - (let (v7 i32) (band v5 v6)) - (let (v8 i32) (sub.wrapping v7 v0)) - (let (v9 u32) (bitcast v1)) - (let (v10 u32) (bitcast v8)) - (let (v11 i1) (lt v9 v10)) - (let (v12 i32) (sext v11)) - (let (v13 i1) (neq v12 0)) - (condbr v13 (block 3 v1 v0) (block 4))) - - (block 1 (param v2 i32) - (ret v2)) - - (block 2 (param v520 i32) - (br (block 1 v520))) - - (block 3 (param v429 i32) (param v494 i32) - (let (v430 i1) (neq v429 0)) - (condbr v430 (block 34) (block 35))) - - (block 4 - (let (v14 i32) (sub.wrapping v1 v8)) - (let (v15 i32) (const.i32 4)) - (let (v16 u32) (bitcast v14)) - (let (v17 u32) (bitcast v15)) - (let (v18 i1) (lt v16 v17)) - (let (v19 i32) (sext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 3 v1 v0) (block 5))) - - (block 5 - (let (v21 i32) (const.i32 3)) - (let (v22 i32) (band v14 v21)) - (let (v23 i32) (const.i32 0)) - (let (v24 i32) (const.i32 0)) - (let (v25 i1) (eq v7 v0)) - (let (v26 i32) (zext v25)) - (let (v27 i1) (neq v26 0)) - (condbr v27 (block 6 v0 v8 v22 v14 v23 v24) (block 7))) - - (block 6 - (param v108 i32) - (param v110 i32) - (param v115 i32) - (param v122 i32) - (param v169 i32) - (param v174 i32) - (let (v114 i32) (add.wrapping v108 v110)) - (let (v119 i1) (eq v115 0)) - (let (v120 i32) (zext v119)) - (let (v121 i1) (neq v120 0)) - (condbr v121 (block 18 v122 v169 v174 v114) (block 19))) - - (block 7 - (let (v28 i32) (const.i32 0)) - (let (v29 i32) (sub.wrapping v0 v7)) - (let (v30 i32) (const.i32 -4)) - (let (v31 u32) (bitcast v29)) - (let (v32 u32) (bitcast v30)) - (let (v33 i1) (lte v31 v32)) - (let (v34 i32) (sext v33)) - (let (v35 i1) (neq v34 0)) - (condbr v35 (block 9) (block 10))) - - (block 8 - (param v83 i32) - (param v86 i32) - (param v87 i32) - (param v105 i32) - (param v106 i32) - (param v111 i32) - (param v116 i32) - (param v123 i32) - (param v170 i32) - (let (v85 i1) (neq v83 0)) - (condbr v85 (block 6 v86 v111 v116 v123 v170 v105) (block 14))) - - (block 9 - (let (v37 i32) (const.i32 0)) - (br (block 11 v28 v0 v37 v26 v29 v8 v22 v14 v23))) - - (block 10 - (let (v36 i32) (const.i32 0)) - (br (block 8 v26 v0 v36 v28 v29 v8 v22 v14 v23))) - - (block 11 - (param v38 i32) - (param v39 i32) - (param v40 i32) - (param v84 i32) - (param v107 i32) - (param v112 i32) - (param v117 i32) - (param v124 i32) - (param v171 i32) - (let (v41 i32) (add.wrapping v39 v40)) - (let (v42 u32) (bitcast v41)) - (let (v43 (ptr i8)) (inttoptr v42)) - (let (v44 i8) (load v43)) - (let (v45 i32) (sext v44)) - (let (v46 i32) (const.i32 -65)) - (let (v47 i1) (gt v45 v46)) - (let (v48 i32) (zext v47)) - (let (v49 i32) (add.wrapping v38 v48)) - (let (v50 i32) (const.i32 1)) - (let (v51 i32) (add.wrapping v41 v50)) - (let (v52 u32) (bitcast v51)) - (let (v53 (ptr i8)) (inttoptr v52)) - (let (v54 i8) (load v53)) - (let (v55 i32) (sext v54)) - (let (v56 i32) (const.i32 -65)) - (let (v57 i1) (gt v55 v56)) - (let (v58 i32) (zext v57)) - (let (v59 i32) (add.wrapping v49 v58)) - (let (v60 i32) (const.i32 2)) - (let (v61 i32) (add.wrapping v41 v60)) - (let (v62 u32) (bitcast v61)) - (let (v63 (ptr i8)) (inttoptr v62)) - (let (v64 i8) (load v63)) - (let (v65 i32) (sext v64)) - (let (v66 i32) (const.i32 -65)) - (let (v67 i1) (gt v65 v66)) - (let (v68 i32) (zext v67)) - (let (v69 i32) (add.wrapping v59 v68)) - (let (v70 i32) (const.i32 3)) - (let (v71 i32) (add.wrapping v41 v70)) - (let (v72 u32) (bitcast v71)) - (let (v73 (ptr i8)) (inttoptr v72)) - (let (v74 i8) (load v73)) - (let (v75 i32) (sext v74)) - (let (v76 i32) (const.i32 -65)) - (let (v77 i1) (gt v75 v76)) - (let (v78 i32) (zext v77)) - (let (v79 i32) (add.wrapping v69 v78)) - (let (v80 i32) (const.i32 4)) - (let (v81 i32) (add.wrapping v40 v80)) - (let (v82 i1) (neq v81 0)) - (condbr v82 (block 11 v79 v39 v81 v84 v107 v112 v117 v124 v171) (block 13))) - - (block 12 - (br (block 8 v84 v39 v81 v79 v107 v112 v117 v124 v171))) - - (block 13 - (br (block 12))) - - (block 14 - (let (v88 i32) (add.wrapping v86 v87)) - (br (block 15 v105 v88 v106 v86 v111 v116 v123 v170))) - - (block 15 - (param v89 i32) - (param v90 i32) - (param v101 i32) - (param v109 i32) - (param v113 i32) - (param v118 i32) - (param v125 i32) - (param v172 i32) - (let (v91 u32) (bitcast v90)) - (let (v92 (ptr i8)) (inttoptr v91)) - (let (v93 i8) (load v92)) - (let (v94 i32) (sext v93)) - (let (v95 i32) (const.i32 -65)) - (let (v96 i1) (gt v94 v95)) - (let (v97 i32) (zext v96)) - (let (v98 i32) (add.wrapping v89 v97)) - (let (v99 i32) (const.i32 1)) - (let (v100 i32) (add.wrapping v90 v99)) - (let (v102 i32) (const.i32 1)) - (let (v103 i32) (add.wrapping v101 v102)) - (let (v104 i1) (neq v103 0)) - (condbr v104 (block 15 v98 v100 v103 v109 v113 v118 v125 v172) (block 17))) - - (block 16 - (br (block 6 v109 v113 v118 v125 v172 v98))) - - (block 17 - (br (block 16))) - - (block 18 - (param v162 i32) - (param v168 i32) - (param v173 i32) - (param v333 i32) - (let (v163 i32) (const.i32 2)) - (let (v164 u32) (bitcast v162)) - (let (v165 u32) (bitcast v163)) - (let (v166 u32) (shr.wrapping v164 v165)) - (let (v167 i32) (bitcast v166)) - (let (v175 i32) (add.wrapping v168 v173)) - (br (block 22 v333 v167 v175))) - - (block 19 - (let (v126 i32) (const.i32 -4)) - (let (v127 i32) (band v122 v126)) - (let (v128 i32) (add.wrapping v114 v127)) - (let (v129 u32) (bitcast v128)) - (let (v130 (ptr i8)) (inttoptr v129)) - (let (v131 i8) (load v130)) - (let (v132 i32) (sext v131)) - (let (v133 i32) (const.i32 -65)) - (let (v134 i1) (gt v132 v133)) - (let (v135 i32) (zext v134)) - (let (v136 i32) (const.i32 1)) - (let (v137 i1) (eq v115 v136)) - (let (v138 i32) (zext v137)) - (let (v139 i1) (neq v138 0)) - (condbr v139 (block 18 v122 v135 v174 v114) (block 20))) - - (block 20 - (let (v140 u32) (bitcast v128)) - (let (v141 u32) (add.checked v140 1)) - (let (v142 (ptr i8)) (inttoptr v141)) - (let (v143 i8) (load v142)) - (let (v144 i32) (sext v143)) - (let (v145 i32) (const.i32 -65)) - (let (v146 i1) (gt v144 v145)) - (let (v147 i32) (zext v146)) - (let (v148 i32) (add.wrapping v135 v147)) - (let (v149 i32) (const.i32 2)) - (let (v150 i1) (eq v115 v149)) - (let (v151 i32) (zext v150)) - (let (v152 i1) (neq v151 0)) - (condbr v152 (block 18 v122 v148 v174 v114) (block 21))) - - (block 21 - (let (v153 u32) (bitcast v128)) - (let (v154 u32) (add.checked v153 2)) - (let (v155 (ptr i8)) (inttoptr v154)) - (let (v156 i8) (load v155)) - (let (v157 i32) (sext v156)) - (let (v158 i32) (const.i32 -65)) - (let (v159 i1) (gt v157 v158)) - (let (v160 i32) (zext v159)) - (let (v161 i32) (add.wrapping v148 v160)) - (br (block 18 v122 v161 v174 v114))) - - (block 22 (param v176 i32) (param v177 i32) (param v325 i32) - (let (v178 i1) (eq v177 0)) - (let (v179 i32) (zext v178)) - (let (v180 i1) (neq v179 0)) - (condbr v180 (block 2 v325) (block 24))) - - (block 23 - (let (v334 i32) (const.i32 252)) - (let (v335 i32) (band v298 v334)) - (let (v336 i32) (const.i32 2)) - (let (v337 u32) (bitcast v336)) - (let (v338 i32) (shl.wrapping v335 v337)) - (let (v339 i32) (add.wrapping v301 v338)) - (let (v340 u32) (bitcast v339)) - (let (v341 u32) (mod.unchecked v340 4)) - (assertz 250 v341) - (let (v342 (ptr i32)) (inttoptr v340)) - (let (v343 i32) (load v342)) - (let (v344 i32) (const.i32 -1)) - (let (v345 i32) (bxor v343 v344)) - (let (v346 i32) (const.i32 7)) - (let (v347 u32) (bitcast v345)) - (let (v348 u32) (bitcast v346)) - (let (v349 u32) (shr.wrapping v347 v348)) - (let (v350 i32) (bitcast v349)) - (let (v351 i32) (const.i32 6)) - (let (v352 u32) (bitcast v343)) - (let (v353 u32) (bitcast v351)) - (let (v354 u32) (shr.wrapping v352 v353)) - (let (v355 i32) (bitcast v354)) - (let (v356 i32) (bor v350 v355)) - (let (v357 i32) (const.i32 16843009)) - (let (v358 i32) (band v356 v357)) - (let (v359 i32) (const.i32 1)) - (let (v360 i1) (eq v328 v359)) - (let (v361 i32) (zext v360)) - (let (v362 i1) (neq v361 0)) - (condbr v362 (block 31 v358 v327) (block 32))) - - (block 24 - (let (v181 i32) (const.i32 192)) - (let (v182 i32) (const.i32 192)) - (let (v183 u32) (bitcast v177)) - (let (v184 u32) (bitcast v182)) - (let (v185 i1) (lt v183 v184)) - (let (v186 i32) (sext v185)) - (let (v187 i1) (neq v186 0)) - (let (v188 i32) (select v187 v177 v181)) - (let (v189 i32) (const.i32 3)) - (let (v190 i32) (band v188 v189)) - (let (v191 i32) (const.i32 2)) - (let (v192 u32) (bitcast v191)) - (let (v193 i32) (shl.wrapping v188 v192)) - (let (v194 i32) (const.i32 0)) - (let (v195 i32) (const.i32 4)) - (let (v196 u32) (bitcast v177)) - (let (v197 u32) (bitcast v195)) - (let (v198 i1) (lt v196 v197)) - (let (v199 i32) (sext v198)) - (let (v200 i1) (neq v199 0)) - (condbr v200 (block 25 v177 v188 v176 v193 v194 v325 v190) (block 26))) - - (block 25 - (param v296 i32) - (param v298 i32) - (param v301 i32) - (param v303 i32) - (param v306 i32) - (param v324 i32) - (param v328 i32) - (let (v300 i32) (sub.wrapping v296 v298)) - (let (v305 i32) (add.wrapping v301 v303)) - (let (v307 i32) (const.i32 8)) - (let (v308 u32) (bitcast v306)) - (let (v309 u32) (bitcast v307)) - (let (v310 u32) (shr.wrapping v308 v309)) - (let (v311 i32) (bitcast v310)) - (let (v312 i32) (const.i32 16711935)) - (let (v313 i32) (band v311 v312)) - (let (v314 i32) (const.i32 16711935)) - (let (v315 i32) (band v306 v314)) - (let (v316 i32) (add.wrapping v313 v315)) - (let (v317 i32) (const.i32 65537)) - (let (v318 i32) (mul.wrapping v316 v317)) - (let (v319 i32) (const.i32 16)) - (let (v320 u32) (bitcast v318)) - (let (v321 u32) (bitcast v319)) - (let (v322 u32) (shr.wrapping v320 v321)) - (let (v323 i32) (bitcast v322)) - (let (v327 i32) (add.wrapping v323 v324)) - (let (v330 i1) (eq v328 0)) - (let (v331 i32) (zext v330)) - (let (v332 i1) (neq v331 0)) - (condbr v332 (block 22 v305 v300 v327) (block 30))) - - (block 26 - (let (v201 i32) (const.i32 1008)) - (let (v202 i32) (band v193 v201)) - (let (v203 i32) (add.wrapping v176 v202)) - (let (v204 i32) (const.i32 0)) - (br (block 27 v176 v204 v203 v177 v188 v176 v193 v325 v190))) - - (block 27 - (param v205 i32) - (param v285 i32) - (param v292 i32) - (param v297 i32) - (param v299 i32) - (param v302 i32) - (param v304 i32) - (param v326 i32) - (param v329 i32) - (let (v206 u32) (bitcast v205)) - (let (v207 u32) (add.checked v206 12)) - (let (v208 u32) (mod.unchecked v207 4)) - (assertz 250 v208) - (let (v209 (ptr i32)) (inttoptr v207)) - (let (v210 i32) (load v209)) - (let (v211 i32) (const.i32 -1)) - (let (v212 i32) (bxor v210 v211)) - (let (v213 i32) (const.i32 7)) - (let (v214 u32) (bitcast v212)) - (let (v215 u32) (bitcast v213)) - (let (v216 u32) (shr.wrapping v214 v215)) - (let (v217 i32) (bitcast v216)) - (let (v218 i32) (const.i32 6)) - (let (v219 u32) (bitcast v210)) - (let (v220 u32) (bitcast v218)) - (let (v221 u32) (shr.wrapping v219 v220)) - (let (v222 i32) (bitcast v221)) - (let (v223 i32) (bor v217 v222)) - (let (v224 i32) (const.i32 16843009)) - (let (v225 i32) (band v223 v224)) - (let (v226 u32) (bitcast v205)) - (let (v227 u32) (add.checked v226 8)) - (let (v228 u32) (mod.unchecked v227 4)) - (assertz 250 v228) - (let (v229 (ptr i32)) (inttoptr v227)) - (let (v230 i32) (load v229)) - (let (v231 i32) (const.i32 -1)) - (let (v232 i32) (bxor v230 v231)) - (let (v233 i32) (const.i32 7)) - (let (v234 u32) (bitcast v232)) - (let (v235 u32) (bitcast v233)) - (let (v236 u32) (shr.wrapping v234 v235)) - (let (v237 i32) (bitcast v236)) - (let (v238 i32) (const.i32 6)) - (let (v239 u32) (bitcast v230)) - (let (v240 u32) (bitcast v238)) - (let (v241 u32) (shr.wrapping v239 v240)) - (let (v242 i32) (bitcast v241)) - (let (v243 i32) (bor v237 v242)) - (let (v244 i32) (const.i32 16843009)) - (let (v245 i32) (band v243 v244)) - (let (v246 u32) (bitcast v205)) - (let (v247 u32) (add.checked v246 4)) - (let (v248 u32) (mod.unchecked v247 4)) - (assertz 250 v248) - (let (v249 (ptr i32)) (inttoptr v247)) - (let (v250 i32) (load v249)) - (let (v251 i32) (const.i32 -1)) - (let (v252 i32) (bxor v250 v251)) - (let (v253 i32) (const.i32 7)) - (let (v254 u32) (bitcast v252)) - (let (v255 u32) (bitcast v253)) - (let (v256 u32) (shr.wrapping v254 v255)) - (let (v257 i32) (bitcast v256)) - (let (v258 i32) (const.i32 6)) - (let (v259 u32) (bitcast v250)) - (let (v260 u32) (bitcast v258)) - (let (v261 u32) (shr.wrapping v259 v260)) - (let (v262 i32) (bitcast v261)) - (let (v263 i32) (bor v257 v262)) - (let (v264 i32) (const.i32 16843009)) - (let (v265 i32) (band v263 v264)) - (let (v266 u32) (bitcast v205)) - (let (v267 u32) (mod.unchecked v266 4)) - (assertz 250 v267) - (let (v268 (ptr i32)) (inttoptr v266)) - (let (v269 i32) (load v268)) - (let (v270 i32) (const.i32 -1)) - (let (v271 i32) (bxor v269 v270)) - (let (v272 i32) (const.i32 7)) - (let (v273 u32) (bitcast v271)) - (let (v274 u32) (bitcast v272)) - (let (v275 u32) (shr.wrapping v273 v274)) - (let (v276 i32) (bitcast v275)) - (let (v277 i32) (const.i32 6)) - (let (v278 u32) (bitcast v269)) - (let (v279 u32) (bitcast v277)) - (let (v280 u32) (shr.wrapping v278 v279)) - (let (v281 i32) (bitcast v280)) - (let (v282 i32) (bor v276 v281)) - (let (v283 i32) (const.i32 16843009)) - (let (v284 i32) (band v282 v283)) - (let (v286 i32) (add.wrapping v284 v285)) - (let (v287 i32) (add.wrapping v265 v286)) - (let (v288 i32) (add.wrapping v245 v287)) - (let (v289 i32) (add.wrapping v225 v288)) - (let (v290 i32) (const.i32 16)) - (let (v291 i32) (add.wrapping v205 v290)) - (let (v293 i1) (neq v291 v292)) - (let (v294 i32) (zext v293)) - (let (v295 i1) (neq v294 0)) - (condbr v295 (block 27 v291 v289 v292 v297 v299 v302 v304 v326 v329) (block 29))) - - (block 28 - (br (block 25 v297 v299 v302 v304 v289 v326 v329))) - - (block 29 - (br (block 28))) - - (block 30 - (br (block 23))) - - (block 31 (param v409 i32) (param v427 i32) - (let (v410 i32) (const.i32 8)) - (let (v411 u32) (bitcast v409)) - (let (v412 u32) (bitcast v410)) - (let (v413 u32) (shr.wrapping v411 v412)) - (let (v414 i32) (bitcast v413)) - (let (v415 i32) (const.i32 459007)) - (let (v416 i32) (band v414 v415)) - (let (v417 i32) (const.i32 16711935)) - (let (v418 i32) (band v409 v417)) - (let (v419 i32) (add.wrapping v416 v418)) - (let (v420 i32) (const.i32 65537)) - (let (v421 i32) (mul.wrapping v419 v420)) - (let (v422 i32) (const.i32 16)) - (let (v423 u32) (bitcast v421)) - (let (v424 u32) (bitcast v422)) - (let (v425 u32) (shr.wrapping v423 v424)) - (let (v426 i32) (bitcast v425)) - (let (v428 i32) (add.wrapping v426 v427)) - (ret v428)) - - (block 32 - (let (v363 u32) (bitcast v339)) - (let (v364 u32) (add.checked v363 4)) - (let (v365 u32) (mod.unchecked v364 4)) - (assertz 250 v365) - (let (v366 (ptr i32)) (inttoptr v364)) - (let (v367 i32) (load v366)) - (let (v368 i32) (const.i32 -1)) - (let (v369 i32) (bxor v367 v368)) - (let (v370 i32) (const.i32 7)) - (let (v371 u32) (bitcast v369)) - (let (v372 u32) (bitcast v370)) - (let (v373 u32) (shr.wrapping v371 v372)) - (let (v374 i32) (bitcast v373)) - (let (v375 i32) (const.i32 6)) - (let (v376 u32) (bitcast v367)) - (let (v377 u32) (bitcast v375)) - (let (v378 u32) (shr.wrapping v376 v377)) - (let (v379 i32) (bitcast v378)) - (let (v380 i32) (bor v374 v379)) - (let (v381 i32) (const.i32 16843009)) - (let (v382 i32) (band v380 v381)) - (let (v383 i32) (add.wrapping v382 v358)) - (let (v384 i32) (const.i32 2)) - (let (v385 i1) (eq v328 v384)) - (let (v386 i32) (zext v385)) - (let (v387 i1) (neq v386 0)) - (condbr v387 (block 31 v383 v327) (block 33))) - - (block 33 - (let (v388 u32) (bitcast v339)) - (let (v389 u32) (add.checked v388 8)) - (let (v390 u32) (mod.unchecked v389 4)) - (assertz 250 v390) - (let (v391 (ptr i32)) (inttoptr v389)) - (let (v392 i32) (load v391)) - (let (v393 i32) (const.i32 -1)) - (let (v394 i32) (bxor v392 v393)) - (let (v395 i32) (const.i32 7)) - (let (v396 u32) (bitcast v394)) - (let (v397 u32) (bitcast v395)) - (let (v398 u32) (shr.wrapping v396 v397)) - (let (v399 i32) (bitcast v398)) - (let (v400 i32) (const.i32 6)) - (let (v401 u32) (bitcast v392)) - (let (v402 u32) (bitcast v400)) - (let (v403 u32) (shr.wrapping v401 v402)) - (let (v404 i32) (bitcast v403)) - (let (v405 i32) (bor v399 v404)) - (let (v406 i32) (const.i32 16843009)) - (let (v407 i32) (band v405 v406)) - (let (v408 i32) (add.wrapping v407 v383)) - (br (block 31 v408 v327))) - - (block 34 - (let (v432 i32) (const.i32 3)) - (let (v433 i32) (band v429 v432)) - (let (v434 i32) (const.i32 4)) - (let (v435 u32) (bitcast v429)) - (let (v436 u32) (bitcast v434)) - (let (v437 i1) (gte v435 v436)) - (let (v438 i32) (zext v437)) - (let (v439 i1) (neq v438 0)) - (condbr v439 (block 37) (block 38))) - - (block 35 - (let (v431 i32) (const.i32 0)) - (ret v431)) - - (block 36 - (param v495 i32) - (param v500 i32) - (param v501 i32) - (param v519 i32) - (let (v497 i1) (eq v495 0)) - (let (v498 i32) (zext v497)) - (let (v499 i1) (neq v498 0)) - (condbr v499 (block 2 v519) (block 42))) - - (block 37 - (let (v442 i32) (const.i32 -4)) - (let (v443 i32) (band v429 v442)) - (let (v444 i32) (const.i32 0)) - (let (v445 i32) (const.i32 0)) - (br (block 39 v444 v494 v445 v443 v433))) - - (block 38 - (let (v440 i32) (const.i32 0)) - (let (v441 i32) (const.i32 0)) - (br (block 36 v433 v494 v441 v440))) - - (block 39 - (param v446 i32) - (param v447 i32) - (param v448 i32) - (param v488 i32) - (param v496 i32) - (let (v449 i32) (add.wrapping v447 v448)) - (let (v450 u32) (bitcast v449)) - (let (v451 (ptr i8)) (inttoptr v450)) - (let (v452 i8) (load v451)) - (let (v453 i32) (sext v452)) - (let (v454 i32) (const.i32 -65)) - (let (v455 i1) (gt v453 v454)) - (let (v456 i32) (zext v455)) - (let (v457 i32) (add.wrapping v446 v456)) - (let (v458 i32) (const.i32 1)) - (let (v459 i32) (add.wrapping v449 v458)) - (let (v460 u32) (bitcast v459)) - (let (v461 (ptr i8)) (inttoptr v460)) - (let (v462 i8) (load v461)) - (let (v463 i32) (sext v462)) - (let (v464 i32) (const.i32 -65)) - (let (v465 i1) (gt v463 v464)) - (let (v466 i32) (zext v465)) - (let (v467 i32) (add.wrapping v457 v466)) - (let (v468 i32) (const.i32 2)) - (let (v469 i32) (add.wrapping v449 v468)) - (let (v470 u32) (bitcast v469)) - (let (v471 (ptr i8)) (inttoptr v470)) - (let (v472 i8) (load v471)) - (let (v473 i32) (sext v472)) - (let (v474 i32) (const.i32 -65)) - (let (v475 i1) (gt v473 v474)) - (let (v476 i32) (zext v475)) - (let (v477 i32) (add.wrapping v467 v476)) - (let (v478 i32) (const.i32 3)) - (let (v479 i32) (add.wrapping v449 v478)) - (let (v480 u32) (bitcast v479)) - (let (v481 (ptr i8)) (inttoptr v480)) - (let (v482 i8) (load v481)) - (let (v483 i32) (sext v482)) - (let (v484 i32) (const.i32 -65)) - (let (v485 i1) (gt v483 v484)) - (let (v486 i32) (zext v485)) - (let (v487 i32) (add.wrapping v477 v486)) - (let (v489 i32) (const.i32 4)) - (let (v490 i32) (add.wrapping v448 v489)) - (let (v491 i1) (neq v488 v490)) - (let (v492 i32) (zext v491)) - (let (v493 i1) (neq v492 0)) - (condbr v493 (block 39 v487 v447 v490 v488 v496) (block 41))) - - (block 40 - (br (block 36 v496 v447 v490 v487))) - - (block 41 - (br (block 40))) - - (block 42 - (let (v502 i32) (add.wrapping v500 v501)) - (br (block 43 v519 v502 v495))) - - (block 43 (param v503 i32) (param v504 i32) (param v515 i32) - (let (v505 u32) (bitcast v504)) - (let (v506 (ptr i8)) (inttoptr v505)) - (let (v507 i8) (load v506)) - (let (v508 i32) (sext v507)) - (let (v509 i32) (const.i32 -65)) - (let (v510 i1) (gt v508 v509)) - (let (v511 i32) (zext v510)) - (let (v512 i32) (add.wrapping v503 v511)) - (let (v513 i32) (const.i32 1)) - (let (v514 i32) (add.wrapping v504 v513)) - (let (v516 i32) (const.i32 -1)) - (let (v517 i32) (add.wrapping v515 v516)) - (let (v518 i1) (neq v517 0)) - (condbr v518 (block 43 v512 v514 v517) (block 45))) - - (block 44 - (br (block 2 v512))) - - (block 45 - (br (block 44))) - ) - - (func (export #core::fmt::Formatter::pad_integral::write_prefix) - (param i32) (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 - (param v0 i32) - (param v1 i32) - (param v2 i32) - (param v3 i32) - (param v4 i32) - (let (v6 i32) (const.i32 1114112)) - (let (v7 i1) (eq v2 v6)) - (let (v8 i32) (zext v7)) - (let (v9 i1) (neq v8 0)) - (condbr v9 (block 2 v3 v0 v4 v1) (block 3))) - - (block 1 (param v5 i32) - (ret v5)) - - (block 2 - (param v19 i32) - (param v22 i32) - (param v23 i32) - (param v24 i32) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 5) (block 6))) - - (block 3 - (let (v10 u32) (bitcast v1)) - (let (v11 u32) (add.checked v10 16)) - (let (v12 u32) (mod.unchecked v11 4)) - (assertz 250 v12) - (let (v13 (ptr i32)) (inttoptr v11)) - (let (v14 i32) (load v13)) - (let (v15 i1) (eq v14 0)) - (let (v16 i32) (zext v15)) - (let (v17 i1) (neq v16 0)) - (condbr v17 (block 2 v3 v0 v4 v1) (block 4))) - - (block 4 - (let (v18 i32) (const.i32 1)) - (ret v18)) - - (block 5 - (let (v25 u32) (bitcast v24)) - (let (v26 u32) (add.checked v25 12)) - (let (v27 u32) (mod.unchecked v26 4)) - (assertz 250 v27) - (let (v28 (ptr i32)) (inttoptr v26)) - (let (v29 i32) (load v28)) - (br (block 1 v29))) - - (block 6 - (let (v21 i32) (const.i32 0)) - (ret v21)) - ) - - (func (export #core::fmt::Formatter::debug_struct) - (param i32) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v4 u32) (bitcast v1)) - (let (v5 u32) (add.checked v4 20)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 u32) (bitcast v1)) - (let (v10 u32) (add.checked v9 24)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (let (v13 i32) (load v12)) - (let (v14 u32) (bitcast v13)) - (let (v15 u32) (add.checked v14 12)) - (let (v16 u32) (mod.unchecked v15 4)) - (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (let (v18 i32) (load v17)) - (let (v19 i32) (const.i32 0)) - (let (v20 u32) (bitcast v19)) - (let (v21 u8) (trunc v20)) - (let (v22 u32) (bitcast v0)) - (let (v23 u32) (add.checked v22 5)) - (let (v24 (ptr u8)) (inttoptr v23)) - (store v24 v21) - (let (v25 u32) (bitcast v18)) - (let (v26 u8) (trunc v25)) - (let (v27 u32) (bitcast v0)) - (let (v28 u32) (add.checked v27 4)) - (let (v29 (ptr u8)) (inttoptr v28)) - (store v29 v26) - (let (v30 u32) (bitcast v0)) - (let (v31 u32) (mod.unchecked v30 4)) - (assertz 250 v31) - (let (v32 (ptr i32)) (inttoptr v30)) - (store v32 v1) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #core::fmt::num::imp::::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (mod.unchecked v3 8)) - (assertz 250 v4) - (let (v5 (ptr i64)) (inttoptr v3)) - (let (v6 i64) (load v5)) - (let (v7 i32) (const.i32 1)) - (let (v8 i32) (call #core::fmt::num::imp::fmt_u64 v6 v7 v1)) - (br (block 1 v8))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #core::fmt::num::imp::fmt_u64) - (param i64) (param i32) (param i32) (result i32) - (block 0 (param v0 i64) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) - (let (v5 i64) (const.i64 0)) - (let (v6 i32) (const.i32 0)) - (let (v7 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v8 i32) (const.i32 48)) - (let (v9 i32) (sub.wrapping v7 v8)) - (let (v10 (ptr i32)) (global.symbol #__stack_pointer)) - (store v10 v9) - (let (v11 i32) (const.i32 39)) - (let (v12 i64) (const.i64 10000)) - (let (v13 u64) (bitcast v0)) - (let (v14 u64) (bitcast v12)) - (let (v15 i1) (gte v13 v14)) - (let (v16 i32) (zext v15)) - (let (v17 i1) (neq v16 0)) - (condbr v17 (block 3) (block 4))) - - (block 1 (param v3 i32) - (ret v3)) - - (block 2 - (param v84 i64) - (param v92 i32) - (param v95 i32) - (param v165 i32) - (param v169 i32) - (let (v85 i64) (const.i64 99)) - (let (v86 u64) (bitcast v84)) - (let (v87 u64) (bitcast v85)) - (let (v88 i1) (gt v86 v87)) - (let (v89 i32) (sext v88)) - (let (v90 i1) (neq v89 0)) - (condbr v90 (block 9) (block 10))) - - (block 3 - (let (v18 i32) (const.i32 39)) - (br (block 5 v9 v18 v0 v2 v1))) - - (block 4 - (br (block 2 v0 v9 v11 v2 v1))) - - (block 5 - (param v19 i32) - (param v22 i32) - (param v26 i64) - (param v166 i32) - (param v170 i32) - (let (v20 i32) (const.i32 9)) - (let (v21 i32) (add.wrapping v19 v20)) - (let (v23 i32) (add.wrapping v21 v22)) - (let (v24 i32) (const.i32 -4)) - (let (v25 i32) (add.wrapping v23 v24)) - (let (v27 i64) (const.i64 10000)) - (let (v28 u64) (bitcast v26)) - (let (v29 u64) (bitcast v27)) - (let (v30 u64) (div.unchecked v28 v29)) - (let (v31 i64) (bitcast v30)) - (let (v32 i64) (const.i64 10000)) - (let (v33 i64) (mul.wrapping v31 v32)) - (let (v34 i64) (sub.wrapping v26 v33)) - (let (v35 i32) (trunc v34)) - (let (v36 i32) (const.i32 65535)) - (let (v37 i32) (band v35 v36)) - (let (v38 i32) (const.i32 100)) - (let (v39 u32) (bitcast v37)) - (let (v40 u32) (bitcast v38)) - (let (v41 u32) (div.unchecked v39 v40)) - (let (v42 i32) (bitcast v41)) - (let (v43 i32) (const.i32 1)) - (let (v44 u32) (bitcast v43)) - (let (v45 i32) (shl.wrapping v42 v44)) - (let (v46 i32) (const.i32 1049010)) - (let (v47 i32) (add.wrapping v45 v46)) - (let (v48 u32) (bitcast v47)) - (let (v49 (ptr u16)) (inttoptr v48)) - (let (v50 u16) (load v49)) - (let (v51 i32) (zext v50)) - (let (v52 u32) (bitcast v51)) - (let (v53 u16) (trunc v52)) - (let (v54 u32) (bitcast v25)) - (let (v55 (ptr u16)) (inttoptr v54)) - (store v55 v53) - (let (v56 i32) (const.i32 -2)) - (let (v57 i32) (add.wrapping v23 v56)) - (let (v58 i32) (const.i32 100)) - (let (v59 i32) (mul.wrapping v42 v58)) - (let (v60 i32) (sub.wrapping v35 v59)) - (let (v61 i32) (const.i32 65535)) - (let (v62 i32) (band v60 v61)) - (let (v63 i32) (const.i32 1)) - (let (v64 u32) (bitcast v63)) - (let (v65 i32) (shl.wrapping v62 v64)) - (let (v66 i32) (const.i32 1049010)) - (let (v67 i32) (add.wrapping v65 v66)) - (let (v68 u32) (bitcast v67)) - (let (v69 (ptr u16)) (inttoptr v68)) - (let (v70 u16) (load v69)) - (let (v71 i32) (zext v70)) - (let (v72 u32) (bitcast v71)) - (let (v73 u16) (trunc v72)) - (let (v74 u32) (bitcast v57)) - (let (v75 (ptr u16)) (inttoptr v74)) - (store v75 v73) - (let (v76 i32) (const.i32 -4)) - (let (v77 i32) (add.wrapping v22 v76)) - (let (v78 i64) (const.i64 99999999)) - (let (v79 u64) (bitcast v26)) - (let (v80 u64) (bitcast v78)) - (let (v81 i1) (gt v79 v80)) - (let (v82 i32) (sext v81)) - (let (v83 i1) (neq v82 0)) - (condbr v83 (block 5 v19 v77 v31 v166 v170) (block 7))) - - (block 6 - (br (block 2 v31 v19 v77 v166 v170))) - - (block 7 - (br (block 6))) - - (block 8 - (param v125 i32) - (param v132 i32) - (param v135 i32) - (param v164 i32) - (param v168 i32) - (let (v126 i32) (const.i32 10)) - (let (v127 u32) (bitcast v125)) - (let (v128 u32) (bitcast v126)) - (let (v129 i1) (lt v127 v128)) - (let (v130 i32) (sext v129)) - (let (v131 i1) (neq v130 0)) - (condbr v131 (block 12) (block 13))) - - (block 9 - (let (v93 i32) (const.i32 9)) - (let (v94 i32) (add.wrapping v92 v93)) - (let (v96 i32) (const.i32 -2)) - (let (v97 i32) (add.wrapping v95 v96)) - (let (v98 i32) (add.wrapping v94 v97)) - (let (v99 i32) (trunc v84)) - (let (v100 i32) (const.i32 65535)) - (let (v101 i32) (band v99 v100)) - (let (v102 i32) (const.i32 100)) - (let (v103 u32) (bitcast v101)) - (let (v104 u32) (bitcast v102)) - (let (v105 u32) (div.unchecked v103 v104)) - (let (v106 i32) (bitcast v105)) - (let (v107 i32) (const.i32 100)) - (let (v108 i32) (mul.wrapping v106 v107)) - (let (v109 i32) (sub.wrapping v99 v108)) - (let (v110 i32) (const.i32 65535)) - (let (v111 i32) (band v109 v110)) - (let (v112 i32) (const.i32 1)) - (let (v113 u32) (bitcast v112)) - (let (v114 i32) (shl.wrapping v111 v113)) - (let (v115 i32) (const.i32 1049010)) - (let (v116 i32) (add.wrapping v114 v115)) - (let (v117 u32) (bitcast v116)) - (let (v118 (ptr u16)) (inttoptr v117)) - (let (v119 u16) (load v118)) - (let (v120 i32) (zext v119)) - (let (v121 u32) (bitcast v120)) - (let (v122 u16) (trunc v121)) - (let (v123 u32) (bitcast v98)) - (let (v124 (ptr u16)) (inttoptr v123)) - (store v124 v122) - (br (block 8 v106 v92 v97 v165 v169))) - - (block 10 - (let (v91 i32) (trunc v84)) - (br (block 8 v91 v92 v95 v165 v169))) - - (block 11 - (param v163 i32) - (param v167 i32) - (param v173 i32) - (param v176 i32) - (let (v171 i32) (const.i32 1)) - (let (v172 i32) (const.i32 0)) - (let (v174 i32) (const.i32 9)) - (let (v175 i32) (add.wrapping v173 v174)) - (let (v177 i32) (add.wrapping v175 v176)) - (let (v178 i32) (const.i32 39)) - (let (v179 i32) (sub.wrapping v178 v176)) - (let (v180 i32) (call #core::fmt::Formatter::pad_integral v163 v167 v171 v172 v177 v179)) - (let (v181 i32) (const.i32 48)) - (let (v182 i32) (add.wrapping v173 v181)) - (let (v183 (ptr i32)) (global.symbol #__stack_pointer)) - (store v183 v182) - (br (block 1 v180))) - - (block 12 - (let (v152 i32) (const.i32 9)) - (let (v153 i32) (add.wrapping v132 v152)) - (let (v154 i32) (const.i32 -1)) - (let (v155 i32) (add.wrapping v135 v154)) - (let (v156 i32) (add.wrapping v153 v155)) - (let (v157 i32) (const.i32 48)) - (let (v158 i32) (bor v125 v157)) - (let (v159 u32) (bitcast v158)) - (let (v160 u8) (trunc v159)) - (let (v161 u32) (bitcast v156)) - (let (v162 (ptr u8)) (inttoptr v161)) - (store v162 v160) - (br (block 11 v164 v168 v132 v155))) - - (block 13 - (let (v133 i32) (const.i32 9)) - (let (v134 i32) (add.wrapping v132 v133)) - (let (v136 i32) (const.i32 -2)) - (let (v137 i32) (add.wrapping v135 v136)) - (let (v138 i32) (add.wrapping v134 v137)) - (let (v139 i32) (const.i32 1)) - (let (v140 u32) (bitcast v139)) - (let (v141 i32) (shl.wrapping v125 v140)) - (let (v142 i32) (const.i32 1049010)) - (let (v143 i32) (add.wrapping v141 v142)) - (let (v144 u32) (bitcast v143)) - (let (v145 (ptr u16)) (inttoptr v144)) - (let (v146 u16) (load v145)) - (let (v147 i32) (zext v146)) - (let (v148 u32) (bitcast v147)) - (let (v149 u16) (trunc v148)) - (let (v150 u32) (bitcast v138)) - (let (v151 (ptr u16)) (inttoptr v150)) - (store v151 v149) - (br (block 11 v164 v168 v132 v137))) - ) - - (func (export #core::fmt::num::::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i64) (const.i64 0)) - (let (v5 i32) (const.i32 0)) - (let (v6 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v7 i32) (const.i32 128)) - (let (v8 i32) (sub.wrapping v6 v7)) - (let (v9 (ptr i32)) (global.symbol #__stack_pointer)) - (store v9 v8) - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 8)) - (assertz 250 v11) - (let (v12 (ptr i64)) (inttoptr v10)) - (let (v13 i64) (load v12)) - (let (v14 i32) (const.i32 0)) - (br (block 2 v8 v14 v13 v1))) - - (block 1 (param v2 i32) - (ret v2)) - - (block 2 - (param v15 i32) - (param v16 i32) - (param v20 i64) - (param v64 i32) - (let (v17 i32) (add.wrapping v15 v16)) - (let (v18 i32) (const.i32 127)) - (let (v19 i32) (add.wrapping v17 v18)) - (let (v21 i32) (trunc v20)) - (let (v22 i32) (const.i32 15)) - (let (v23 i32) (band v21 v22)) - (let (v24 i32) (const.i32 48)) - (let (v25 i32) (bor v23 v24)) - (let (v26 i32) (const.i32 87)) - (let (v27 i32) (add.wrapping v23 v26)) - (let (v28 i32) (const.i32 10)) - (let (v29 u32) (bitcast v23)) - (let (v30 u32) (bitcast v28)) - (let (v31 i1) (lt v29 v30)) - (let (v32 i32) (sext v31)) - (let (v33 i1) (neq v32 0)) - (let (v34 i32) (select v33 v25 v27)) - (let (v35 u32) (bitcast v34)) - (let (v36 u8) (trunc v35)) - (let (v37 u32) (bitcast v19)) - (let (v38 (ptr u8)) (inttoptr v37)) - (store v38 v36) - (let (v39 i32) (const.i32 -1)) - (let (v40 i32) (add.wrapping v16 v39)) - (let (v41 i64) (const.i64 16)) - (let (v42 u64) (bitcast v20)) - (let (v43 u64) (bitcast v41)) - (let (v44 i1) (lt v42 v43)) - (let (v45 i32) (sext v44)) - (let (v46 i64) (const.i64 4)) - (let (v47 u64) (bitcast v20)) - (let (v48 u32) (cast v46)) - (let (v49 u64) (shr.wrapping v47 v48)) - (let (v50 i64) (bitcast v49)) - (let (v51 i1) (eq v45 0)) - (let (v52 i32) (zext v51)) - (let (v53 i1) (neq v52 0)) - (condbr v53 (block 2 v15 v40 v50 v64) (block 4))) - - (block 3 - (let (v54 i32) (const.i32 128)) - (let (v55 i32) (add.wrapping v40 v54)) - (let (v56 i32) (const.i32 129)) - (let (v57 u32) (bitcast v55)) - (let (v58 u32) (bitcast v56)) - (let (v59 i1) (lt v57 v58)) - (let (v60 i32) (sext v59)) - (let (v61 i1) (neq v60 0)) - (condbr v61 (block 5) (block 6))) - - (block 4 - (br (block 3))) - - (block 5 - (let (v65 i32) (const.i32 1)) - (let (v66 i32) (const.i32 1049008)) - (let (v67 i32) (const.i32 2)) - (let (v68 i32) (add.wrapping v15 v40)) - (let (v69 i32) (const.i32 128)) - (let (v70 i32) (add.wrapping v68 v69)) - (let (v71 i32) (const.i32 0)) - (let (v72 i32) (sub.wrapping v71 v40)) - (let (v73 i32) (call #core::fmt::Formatter::pad_integral v64 v65 v66 v67 v70 v72)) - (let (v74 i32) (const.i32 128)) - (let (v75 i32) (add.wrapping v15 v74)) - (let (v76 (ptr i32)) (global.symbol #__stack_pointer)) - (store v76 v75) - (br (block 1 v73))) - - (block 6 - (let (v62 i32) (const.i32 128)) - (let (v63 i32) (const.i32 1048992)) - (call #core::slice::index::slice_start_index_len_fail v55 v62 v63) - (unreachable)) - ) - - (func (export #core::fmt::num::::fmt) - (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i64) (const.i64 0)) - (let (v5 i32) (const.i32 0)) - (let (v6 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v7 i32) (const.i32 128)) - (let (v8 i32) (sub.wrapping v6 v7)) - (let (v9 (ptr i32)) (global.symbol #__stack_pointer)) - (store v9 v8) - (let (v10 u32) (bitcast v0)) - (let (v11 u32) (mod.unchecked v10 8)) - (assertz 250 v11) - (let (v12 (ptr i64)) (inttoptr v10)) - (let (v13 i64) (load v12)) - (let (v14 i32) (const.i32 0)) - (br (block 2 v8 v14 v13 v1))) - - (block 1 (param v2 i32) - (ret v2)) - - (block 2 - (param v15 i32) - (param v16 i32) - (param v20 i64) - (param v64 i32) - (let (v17 i32) (add.wrapping v15 v16)) - (let (v18 i32) (const.i32 127)) - (let (v19 i32) (add.wrapping v17 v18)) - (let (v21 i32) (trunc v20)) - (let (v22 i32) (const.i32 15)) - (let (v23 i32) (band v21 v22)) - (let (v24 i32) (const.i32 48)) - (let (v25 i32) (bor v23 v24)) - (let (v26 i32) (const.i32 55)) - (let (v27 i32) (add.wrapping v23 v26)) - (let (v28 i32) (const.i32 10)) - (let (v29 u32) (bitcast v23)) - (let (v30 u32) (bitcast v28)) - (let (v31 i1) (lt v29 v30)) - (let (v32 i32) (sext v31)) - (let (v33 i1) (neq v32 0)) - (let (v34 i32) (select v33 v25 v27)) - (let (v35 u32) (bitcast v34)) - (let (v36 u8) (trunc v35)) - (let (v37 u32) (bitcast v19)) - (let (v38 (ptr u8)) (inttoptr v37)) - (store v38 v36) - (let (v39 i32) (const.i32 -1)) - (let (v40 i32) (add.wrapping v16 v39)) - (let (v41 i64) (const.i64 16)) - (let (v42 u64) (bitcast v20)) - (let (v43 u64) (bitcast v41)) - (let (v44 i1) (lt v42 v43)) - (let (v45 i32) (sext v44)) - (let (v46 i64) (const.i64 4)) - (let (v47 u64) (bitcast v20)) - (let (v48 u32) (cast v46)) - (let (v49 u64) (shr.wrapping v47 v48)) - (let (v50 i64) (bitcast v49)) - (let (v51 i1) (eq v45 0)) - (let (v52 i32) (zext v51)) - (let (v53 i1) (neq v52 0)) - (condbr v53 (block 2 v15 v40 v50 v64) (block 4))) - - (block 3 - (let (v54 i32) (const.i32 128)) - (let (v55 i32) (add.wrapping v40 v54)) - (let (v56 i32) (const.i32 129)) - (let (v57 u32) (bitcast v55)) - (let (v58 u32) (bitcast v56)) - (let (v59 i1) (lt v57 v58)) - (let (v60 i32) (sext v59)) - (let (v61 i1) (neq v60 0)) - (condbr v61 (block 5) (block 6))) - - (block 4 - (br (block 3))) - - (block 5 - (let (v65 i32) (const.i32 1)) - (let (v66 i32) (const.i32 1049008)) - (let (v67 i32) (const.i32 2)) - (let (v68 i32) (add.wrapping v15 v40)) - (let (v69 i32) (const.i32 128)) - (let (v70 i32) (add.wrapping v68 v69)) - (let (v71 i32) (const.i32 0)) - (let (v72 i32) (sub.wrapping v71 v40)) - (let (v73 i32) (call #core::fmt::Formatter::pad_integral v64 v65 v66 v67 v70 v72)) - (let (v74 i32) (const.i32 128)) - (let (v75 i32) (add.wrapping v15 v74)) - (let (v76 (ptr i32)) (global.symbol #__stack_pointer)) - (store v76 v75) - (br (block 1 v73))) - - (block 6 - (let (v62 i32) (const.i32 128)) - (let (v63 i32) (const.i32 1048992)) - (call #core::slice::index::slice_start_index_len_fail v55 v62 v63) - (unreachable)) - ) - - (func (export #cabi_realloc) - (param i32) (param i32) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) - (br (block 1 v5))) - - (block 1 (param v4 i32) - (ret v4)) - ) - - ;; Imports - (func (import #miden:base/account@1.0.0 #get_id) (result i64)) - (func (import #miden:base/core-types@1.0.0 #account_id_from_felt) - (param i64) (result i64)) - (func (import #miden:basic-wallet/basic-wallet@1.0.0 #receive_asset) - (param i64) (param i64) (param i64) (param i64)) - (func (import #wit-component:shim #indirect-miden:base/note@1.0.0-get-assets) - (param i32)) - (func (import #wit-component:shim #indirect-miden:base/note@1.0.0-get-inputs) - (param i32)) - ) - - (module #wit-component:fixups - - ) - -) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat deleted file mode 100644 index 2a2c61e42..000000000 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet_p2id_note.wat +++ /dev/null @@ -1,4035 +0,0 @@ -(component - (type (;0;) - (instance - (type (;0;) (record (field "inner" u64))) - (export (;1;) "felt" (type (eq 0))) - (type (;2;) (record (field "inner" 1))) - (export (;3;) "account-id" (type (eq 2))) - (type (;4;) (tuple 1 1 1 1)) - (export (;5;) "word" (type (eq 4))) - (type (;6;) (record (field "inner" 5))) - (export (;7;) "core-asset" (type (eq 6))) - (type (;8;) (func (param "felt" 1) (result 3))) - (export (;0;) "account-id-from-felt" (func (type 8))) - ) - ) - (import "miden:base/core-types@1.0.0" (instance (;0;) (type 0))) - (alias export 0 "account-id" (type (;1;))) - (type (;2;) - (instance - (alias outer 1 1 (type (;0;))) - (export (;1;) "account-id" (type (eq 0))) - (type (;2;) (func (result 1))) - (export (;0;) "get-id" (func (type 2))) - ) - ) - (import "miden:base/account@1.0.0" (instance (;1;) (type 2))) - (alias export 0 "felt" (type (;3;))) - (alias export 0 "core-asset" (type (;4;))) - (type (;5;) - (instance - (alias outer 1 3 (type (;0;))) - (export (;1;) "felt" (type (eq 0))) - (alias outer 1 4 (type (;2;))) - (export (;3;) "core-asset" (type (eq 2))) - (type (;4;) (list 1)) - (type (;5;) (func (result 4))) - (export (;0;) "get-inputs" (func (type 5))) - (type (;6;) (list 3)) - (type (;7;) (func (result 6))) - (export (;1;) "get-assets" (func (type 7))) - ) - ) - (import "miden:base/note@1.0.0" (instance (;2;) (type 5))) - (alias export 0 "core-asset" (type (;6;))) - (type (;7;) - (instance - (alias outer 1 6 (type (;0;))) - (export (;1;) "core-asset" (type (eq 0))) - (type (;2;) (func (param "core-asset" 1))) - (export (;0;) "receive-asset" (func (type 2))) - ) - ) - (import "miden:basic-wallet/basic-wallet@1.0.0" (instance (;3;) (type 7))) - (core module (;0;) - (type (;0;) (func (param i32 i32 i32) (result i32))) - (type (;1;) (func (param i32 i32) (result i32))) - (type (;2;) (func (param i32))) - (type (;3;) (func (param i64) (result i64))) - (type (;4;) (func (result i64))) - (type (;5;) (func (param i64 i64 i64 i64))) - (type (;6;) (func)) - (type (;7;) (func (param i32 i32 i32))) - (type (;8;) (func (param i32 i32 i32 i32) (result i32))) - (type (;9;) (func (param i32 i32 i32 i32))) - (type (;10;) (func (param i32 i32))) - (type (;11;) (func (param i32 i32 i32 i32 i32) (result i32))) - (type (;12;) (func (param i32 i32 i32 i32 i32 i32 i32))) - (type (;13;) (func (param i32) (result i32))) - (type (;14;) (func (param i32 i32 i32 i32 i32 i32) (result i32))) - (type (;15;) (func (param i64 i32 i32) (result i32))) - (import "miden:base/note@1.0.0" "get-inputs" (func $basic_wallet_p2id_note::bindings::miden::base::note::get_inputs::wit_import (;0;) (type 2))) - (import "miden:base/core-types@1.0.0" "account-id-from-felt" (func $basic_wallet_p2id_note::bindings::miden::base::core_types::account_id_from_felt::wit_import (;1;) (type 3))) - (import "miden:base/account@1.0.0" "get-id" (func $basic_wallet_p2id_note::bindings::miden::base::account::get_id::wit_import (;2;) (type 4))) - (import "miden:base/note@1.0.0" "get-assets" (func $basic_wallet_p2id_note::bindings::miden::base::note::get_assets::wit_import (;3;) (type 2))) - (import "miden:basic-wallet/basic-wallet@1.0.0" "receive-asset" (func $basic_wallet_p2id_note::bindings::miden::basic_wallet::basic_wallet::receive_asset::wit_import (;4;) (type 5))) - (func $__wasm_call_ctors (;5;) (type 6)) - (func $<&T as core::fmt::Debug>::fmt (;6;) (type 1) (param i32 i32) (result i32) - (local i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 2 - global.set $__stack_pointer - local.get 0 - i32.load - local.set 0 - local.get 2 - i32.const 8 - i32.add - local.get 1 - i32.const 1048621 - i32.const 9 - call $core::fmt::Formatter::debug_struct - local.get 2 - i32.const 8 - i32.add - i32.const 1048616 - i32.const 5 - local.get 0 - i32.const 1048632 - call $core::fmt::builders::DebugStruct::field - call $core::fmt::builders::DebugStruct::finish - local.set 0 - local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 0 - ) - (func $core::fmt::num::::fmt (;7;) (type 1) (param i32 i32) (result i32) - (local i32) - block ;; label = @1 - local.get 1 - i32.load offset=28 - local.tee 2 - i32.const 16 - i32.and - br_if 0 (;@1;) - block ;; label = @2 - local.get 2 - i32.const 32 - i32.and - br_if 0 (;@2;) - local.get 0 - local.get 1 - call $core::fmt::num::imp::::fmt - return - end - local.get 0 - local.get 1 - call $core::fmt::num::::fmt - return - end - local.get 0 - local.get 1 - call $core::fmt::num::::fmt - ) - (func $core::panicking::assert_failed (;8;) (type 7) (param i32 i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - local.get 1 - i32.store offset=12 - local.get 3 - local.get 0 - i32.store offset=8 - i32.const 0 - local.get 3 - i32.const 8 - i32.add - i32.const 1048576 - local.get 3 - i32.const 12 - i32.add - i32.const 1048576 - local.get 2 - i32.const 1048696 - call $core::panicking::assert_failed_inner - unreachable - ) - (func $rust_begin_unwind (;9;) (type 2) (param i32) - loop ;; label = @1 - br 0 (;@1;) - end - ) - (func $::fmt (;10;) (type 1) (param i32 i32) (result i32) - (local i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 2 - global.set $__stack_pointer - local.get 2 - i32.const 8 - i32.add - local.get 1 - i32.const 1048596 - i32.const 4 - call $core::fmt::Formatter::debug_struct - local.get 2 - i32.const 8 - i32.add - i32.const 1048616 - i32.const 5 - local.get 0 - i32.const 1048600 - call $core::fmt::builders::DebugStruct::field - call $core::fmt::builders::DebugStruct::finish - local.set 1 - local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 1 - ) - (func $basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports (;11;) (type 6)) - (func $__rust_alloc (;12;) (type 1) (param i32 i32) (result i32) - i32.const 1049280 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;13;) (type 8) (param i32 i32 i32 i32) (result i32) - (local i32) - block ;; label = @1 - i32.const 1049280 - local.get 2 - local.get 3 - call $::alloc - local.tee 4 - i32.eqz - br_if 0 (;@1;) - local.get 4 - local.get 0 - local.get 1 - local.get 3 - local.get 1 - local.get 3 - i32.lt_u - select - memory.copy - i32.const 1049280 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc - end - local.get 4 - ) - (func $miden:base/note-script@1.0.0#note-script (;14;) (type 6) - (local i32 i32 i32 i64 i64 i32 i32 i32 i32) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 0 - global.set $__stack_pointer - call $wit_bindgen_rt::run_ctors_once - local.get 0 - i64.const 0 - i64.store offset=24 - local.get 0 - i32.const 24 - i32.add - call $basic_wallet_p2id_note::bindings::miden::base::note::get_inputs::wit_import - block ;; label = @1 - block ;; label = @2 - local.get 0 - i32.load offset=28 - local.tee 1 - i32.eqz - br_if 0 (;@2;) - local.get 0 - local.get 0 - i32.load offset=24 - local.tee 2 - i64.load - call $basic_wallet_p2id_note::bindings::miden::base::core_types::account_id_from_felt::wit_import - local.tee 3 - i64.store offset=8 - local.get 0 - call $basic_wallet_p2id_note::bindings::miden::base::account::get_id::wit_import - local.tee 4 - i64.store offset=16 - local.get 4 - local.get 3 - i64.ne - br_if 1 (;@1;) - local.get 0 - i64.const 0 - i64.store offset=24 - local.get 0 - i32.const 24 - i32.add - call $basic_wallet_p2id_note::bindings::miden::base::note::get_assets::wit_import - block ;; label = @3 - local.get 0 - i32.load offset=28 - local.tee 5 - i32.eqz - br_if 0 (;@3;) - local.get 0 - i32.load offset=24 - local.tee 6 - local.get 5 - i32.const 5 - i32.shl - i32.add - local.set 7 - local.get 6 - local.set 8 - loop ;; label = @4 - local.get 8 - i64.load - local.get 8 - i64.load offset=8 - local.get 8 - i64.load offset=16 - local.get 8 - i64.load offset=24 - call $basic_wallet_p2id_note::bindings::miden::basic_wallet::basic_wallet::receive_asset::wit_import - local.get 8 - i32.const 32 - i32.add - local.tee 8 - local.get 7 - i32.ne - br_if 0 (;@4;) - end - i32.const 1049280 - local.get 6 - i32.const 8 - local.get 5 - i32.const 5 - i32.shl - call $::dealloc - end - i32.const 1049280 - local.get 2 - i32.const 8 - local.get 1 - i32.const 3 - i32.shl - call $::dealloc - local.get 0 - i32.const 48 - i32.add - global.set $__stack_pointer - return - end - i32.const 0 - i32.const 0 - i32.const 1048680 - call $core::panicking::panic_bounds_check - unreachable - end - local.get 0 - i32.const 0 - i32.store offset=24 - local.get 0 - i32.const 16 - i32.add - local.get 0 - i32.const 8 - i32.add - local.get 0 - i32.const 24 - i32.add - call $core::panicking::assert_failed - unreachable - ) - (func $wit_bindgen_rt::cabi_realloc (;15;) (type 8) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 1 - br_if 0 (;@3;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - i32.const 0 - i32.load8_u offset=1049284 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@2;) - end - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rust_realloc - local.set 2 - end - local.get 2 - br_if 0 (;@1;) - unreachable - end - local.get 2 - ) - (func $wit_bindgen_rt::run_ctors_once (;16;) (type 6) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1049285 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1049285 - end - ) - (func $wee_alloc::alloc_first_fit (;17;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 2 - i32.load - local.tee 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 1 - i32.const -1 - i32.add - local.set 4 - i32.const 0 - local.get 1 - i32.sub - local.set 5 - local.get 0 - i32.const 2 - i32.shl - local.set 6 - loop ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - local.get 3 - i32.const 8 - i32.add - local.set 0 - br 1 (;@2;) - end - loop ;; label = @3 - local.get 3 - local.get 1 - i32.const -2 - i32.and - i32.store offset=8 - block ;; label = @4 - block ;; label = @5 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@5;) - i32.const 0 - local.set 8 - br 1 (;@4;) - end - i32.const 0 - local.get 0 - local.get 0 - i32.load8_u - i32.const 1 - i32.and - select - local.set 8 - end - block ;; label = @4 - local.get 3 - i32.load - local.tee 1 - i32.const -4 - i32.and - local.tee 9 - i32.eqz - br_if 0 (;@4;) - local.get 1 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 9 - local.get 9 - i32.load offset=4 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.set 0 - local.get 3 - i32.load - local.set 1 - end - block ;; label = @4 - local.get 0 - i32.eqz - br_if 0 (;@4;) - local.get 0 - local.get 0 - i32.load - i32.const 3 - i32.and - local.get 1 - i32.const -4 - i32.and - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 1 - end - local.get 3 - local.get 7 - i32.const 3 - i32.and - i32.store offset=4 - local.get 3 - local.get 1 - i32.const 3 - i32.and - i32.store - block ;; label = @4 - local.get 1 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 - local.get 8 - i32.store - local.get 8 - local.set 3 - local.get 8 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - end - local.get 8 - i32.const 8 - i32.add - local.set 0 - local.get 8 - local.set 3 - end - block ;; label = @2 - local.get 3 - i32.load - i32.const -4 - i32.and - local.tee 8 - local.get 0 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.const 72 - i32.add - local.get 8 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 8 - i32.le_u - br_if 0 (;@4;) - local.get 4 - local.get 0 - i32.and - br_if 2 (;@2;) - local.get 2 - local.get 1 - i32.const -4 - i32.and - i32.store - local.get 3 - i32.load - local.set 0 - local.get 3 - local.set 1 - br 1 (;@3;) - end - i32.const 0 - local.set 7 - local.get 8 - i32.const 0 - i32.store - local.get 8 - i32.const -8 - i32.add - local.tee 1 - i64.const 0 - i64.store align=4 - local.get 1 - local.get 3 - i32.load - i32.const -4 - i32.and - i32.store - block ;; label = @4 - local.get 3 - i32.load - local.tee 9 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@4;) - local.get 9 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 1 - i32.load offset=4 - i32.const 3 - i32.and - local.set 7 - end - local.get 1 - local.get 7 - local.get 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 0 - i32.load - i32.const -2 - i32.and - i32.store - local.get 3 - local.get 3 - i32.load - local.tee 0 - i32.const 3 - i32.and - local.get 1 - i32.or - local.tee 8 - i32.store - block ;; label = @4 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 1 - i32.load - local.set 0 - br 1 (;@3;) - end - local.get 3 - local.get 8 - i32.const -3 - i32.and - i32.store - local.get 1 - i32.load - i32.const 2 - i32.or - local.set 0 - end - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store - local.get 1 - i32.const 8 - i32.add - return - end - local.get 2 - local.get 1 - i32.store - local.get 1 - local.set 3 - local.get 1 - br_if 0 (;@1;) - end - i32.const 0 - ) - (func $::alloc (;18;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 3 - global.set $__stack_pointer - block ;; label = @1 - block ;; label = @2 - local.get 2 - br_if 0 (;@2;) - local.get 1 - local.set 2 - br 1 (;@1;) - end - local.get 3 - local.get 0 - i32.load - i32.store offset=12 - block ;; label = @2 - local.get 2 - i32.const 3 - i32.add - local.tee 4 - i32.const 2 - i32.shr_u - local.tee 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.tee 2 - br_if 0 (;@2;) - block ;; label = @3 - local.get 4 - i32.const -4 - i32.and - local.tee 2 - local.get 1 - i32.const 3 - i32.shl - i32.const 512 - i32.add - local.tee 4 - local.get 2 - local.get 4 - i32.gt_u - select - i32.const 65543 - i32.add - local.tee 4 - i32.const 16 - i32.shr_u - memory.grow - local.tee 2 - i32.const -1 - i32.ne - br_if 0 (;@3;) - i32.const 0 - local.set 2 - br 1 (;@2;) - end - local.get 2 - i32.const 16 - i32.shl - local.tee 2 - i32.const 0 - i32.store offset=4 - local.get 2 - local.get 3 - i32.load offset=12 - i32.store offset=8 - local.get 2 - local.get 2 - local.get 4 - i32.const -65536 - i32.and - i32.add - i32.const 2 - i32.or - i32.store - local.get 3 - local.get 2 - i32.store offset=12 - local.get 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.set 2 - end - local.get 0 - local.get 3 - i32.load offset=12 - i32.store - end - local.get 3 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 2 - ) - (func $::dealloc (;19;) (type 9) (param i32 i32 i32 i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 1 - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.eqz - br_if 0 (;@1;) - local.get 0 - i32.load - local.set 4 - local.get 1 - i32.const 0 - i32.store - local.get 1 - i32.const -8 - i32.add - local.tee 3 - local.get 3 - i32.load - local.tee 5 - i32.const -2 - i32.and - local.tee 6 - i32.store - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - local.get 1 - i32.const -4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - br_if 0 (;@5;) - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 5 - i32.const -4 - i32.and - local.tee 10 - br_if 0 (;@8;) - local.get 8 - local.set 1 - br 1 (;@7;) - end - local.get 8 - local.set 1 - local.get 5 - i32.const 2 - i32.and - br_if 0 (;@7;) - local.get 10 - local.get 10 - i32.load offset=4 - i32.const 3 - i32.and - local.get 8 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 6 - local.get 7 - i32.load - local.tee 5 - i32.const -4 - i32.and - local.tee 1 - i32.eqz - br_if 1 (;@6;) - local.get 1 - i32.load - local.set 9 - end - local.get 1 - local.get 6 - i32.const -4 - i32.and - local.get 9 - i32.const 3 - i32.and - i32.or - i32.store - local.get 7 - i32.load - local.set 5 - local.get 3 - i32.load - local.set 6 - end - local.get 7 - local.get 5 - i32.const 3 - i32.and - i32.store - local.get 3 - local.get 6 - i32.const 3 - i32.and - i32.store - local.get 6 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - br 1 (;@4;) - end - local.get 5 - i32.const 2 - i32.and - br_if 1 (;@3;) - local.get 5 - i32.const -4 - i32.and - local.tee 5 - i32.eqz - br_if 1 (;@3;) - local.get 5 - i32.load8_u - i32.const 1 - i32.and - br_if 1 (;@3;) - local.get 1 - local.get 5 - i32.load offset=8 - i32.const -4 - i32.and - i32.store - local.get 5 - local.get 3 - i32.const 1 - i32.or - i32.store offset=8 - end - local.get 4 - local.set 3 - br 1 (;@2;) - end - local.get 1 - local.get 4 - i32.store - end - local.get 0 - local.get 3 - i32.store - end - ) - (func $core::panicking::panic_fmt (;20;) (type 10) (param i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 32 - i32.sub - local.tee 2 - global.set $__stack_pointer - local.get 2 - i32.const 16 - i32.add - local.get 0 - i32.const 16 - i32.add - i64.load align=4 - i64.store - local.get 2 - i32.const 8 - i32.add - local.get 0 - i32.const 8 - i32.add - i64.load align=4 - i64.store - local.get 2 - i32.const 1 - i32.store16 offset=28 - local.get 2 - local.get 1 - i32.store offset=24 - local.get 2 - local.get 0 - i64.load align=4 - i64.store - local.get 2 - call $rust_begin_unwind - unreachable - ) - (func $core::slice::index::slice_start_index_len_fail (;21;) (type 7) (param i32 i32 i32) - (local i32 i64) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - local.get 0 - i32.store - local.get 3 - local.get 1 - i32.store offset=4 - local.get 3 - i32.const 2 - i32.store offset=12 - local.get 3 - i32.const 1049264 - i32.store offset=8 - local.get 3 - i64.const 2 - i64.store offset=20 align=4 - local.get 3 - i32.const 6 - i64.extend_i32_u - i64.const 32 - i64.shl - local.tee 4 - local.get 3 - i32.const 4 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=40 - local.get 3 - local.get 4 - local.get 3 - i64.extend_i32_u - i64.or - i64.store offset=32 - local.get 3 - local.get 3 - i32.const 32 - i32.add - i32.store offset=16 - local.get 3 - i32.const 8 - i32.add - local.get 2 - call $core::panicking::panic_fmt - unreachable - ) - (func $core::panicking::panic_bounds_check (;22;) (type 7) (param i32 i32 i32) - (local i32 i64) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - local.get 1 - i32.store offset=4 - local.get 3 - local.get 0 - i32.store - local.get 3 - i32.const 2 - i32.store offset=12 - local.get 3 - i32.const 1048768 - i32.store offset=8 - local.get 3 - i64.const 2 - i64.store offset=20 align=4 - local.get 3 - i32.const 6 - i64.extend_i32_u - i64.const 32 - i64.shl - local.tee 4 - local.get 3 - i64.extend_i32_u - i64.or - i64.store offset=40 - local.get 3 - local.get 4 - local.get 3 - i32.const 4 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=32 - local.get 3 - local.get 3 - i32.const 32 - i32.add - i32.store offset=16 - local.get 3 - i32.const 8 - i32.add - local.get 2 - call $core::panicking::panic_fmt - unreachable - ) - (func $core::fmt::Formatter::pad (;23;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32) - local.get 0 - i32.load offset=8 - local.set 3 - block ;; label = @1 - block ;; label = @2 - local.get 0 - i32.load - local.tee 4 - br_if 0 (;@2;) - local.get 3 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@1;) - end - block ;; label = @2 - local.get 3 - i32.const 1 - i32.and - i32.eqz - br_if 0 (;@2;) - local.get 1 - local.get 2 - i32.add - local.set 5 - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.load offset=12 - local.tee 6 - br_if 0 (;@4;) - i32.const 0 - local.set 7 - local.get 1 - local.set 8 - br 1 (;@3;) - end - i32.const 0 - local.set 7 - local.get 1 - local.set 8 - loop ;; label = @4 - local.get 8 - local.tee 3 - local.get 5 - i32.eq - br_if 2 (;@2;) - block ;; label = @5 - block ;; label = @6 - local.get 3 - i32.load8_s - local.tee 8 - i32.const -1 - i32.le_s - br_if 0 (;@6;) - local.get 3 - i32.const 1 - i32.add - local.set 8 - br 1 (;@5;) - end - block ;; label = @6 - local.get 8 - i32.const -32 - i32.ge_u - br_if 0 (;@6;) - local.get 3 - i32.const 2 - i32.add - local.set 8 - br 1 (;@5;) - end - block ;; label = @6 - local.get 8 - i32.const -16 - i32.ge_u - br_if 0 (;@6;) - local.get 3 - i32.const 3 - i32.add - local.set 8 - br 1 (;@5;) - end - local.get 3 - i32.const 4 - i32.add - local.set 8 - end - local.get 8 - local.get 3 - i32.sub - local.get 7 - i32.add - local.set 7 - local.get 6 - i32.const -1 - i32.add - local.tee 6 - br_if 0 (;@4;) - end - end - local.get 8 - local.get 5 - i32.eq - br_if 0 (;@2;) - block ;; label = @3 - local.get 8 - i32.load8_s - local.tee 3 - i32.const -1 - i32.gt_s - br_if 0 (;@3;) - local.get 3 - i32.const -32 - i32.lt_u - drop - end - block ;; label = @3 - block ;; label = @4 - local.get 7 - i32.eqz - br_if 0 (;@4;) - block ;; label = @5 - local.get 7 - local.get 2 - i32.ge_u - br_if 0 (;@5;) - local.get 1 - local.get 7 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - br_if 1 (;@4;) - i32.const 0 - local.set 3 - br 2 (;@3;) - end - local.get 7 - local.get 2 - i32.eq - br_if 0 (;@4;) - i32.const 0 - local.set 3 - br 1 (;@3;) - end - local.get 1 - local.set 3 - end - local.get 7 - local.get 2 - local.get 3 - select - local.set 2 - local.get 3 - local.get 1 - local.get 3 - select - local.set 1 - end - block ;; label = @2 - local.get 4 - br_if 0 (;@2;) - local.get 0 - i32.load offset=20 - local.get 1 - local.get 2 - local.get 0 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - return - end - local.get 0 - i32.load offset=4 - local.set 4 - block ;; label = @2 - block ;; label = @3 - local.get 2 - i32.const 16 - i32.lt_u - br_if 0 (;@3;) - local.get 1 - local.get 2 - call $core::str::count::do_count_chars - local.set 3 - br 1 (;@2;) - end - block ;; label = @3 - local.get 2 - br_if 0 (;@3;) - i32.const 0 - local.set 3 - br 1 (;@2;) - end - local.get 2 - i32.const 3 - i32.and - local.set 6 - block ;; label = @3 - block ;; label = @4 - local.get 2 - i32.const 4 - i32.ge_u - br_if 0 (;@4;) - i32.const 0 - local.set 3 - i32.const 0 - local.set 7 - br 1 (;@3;) - end - local.get 2 - i32.const 12 - i32.and - local.set 5 - i32.const 0 - local.set 3 - i32.const 0 - local.set 7 - loop ;; label = @4 - local.get 3 - local.get 1 - local.get 7 - i32.add - local.tee 8 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 8 - i32.const 1 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 8 - i32.const 2 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 8 - i32.const 3 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 3 - local.get 5 - local.get 7 - i32.const 4 - i32.add - local.tee 7 - i32.ne - br_if 0 (;@4;) - end - end - local.get 6 - i32.eqz - br_if 0 (;@2;) - local.get 1 - local.get 7 - i32.add - local.set 8 - loop ;; label = @3 - local.get 3 - local.get 8 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 3 - local.get 8 - i32.const 1 - i32.add - local.set 8 - local.get 6 - i32.const -1 - i32.add - local.tee 6 - br_if 0 (;@3;) - end - end - block ;; label = @2 - block ;; label = @3 - local.get 4 - local.get 3 - i32.le_u - br_if 0 (;@3;) - local.get 4 - local.get 3 - i32.sub - local.set 5 - i32.const 0 - local.set 3 - block ;; label = @4 - block ;; label = @5 - block ;; label = @6 - local.get 0 - i32.load8_u offset=32 - br_table 2 (;@4;) 0 (;@6;) 1 (;@5;) 2 (;@4;) 2 (;@4;) - end - local.get 5 - local.set 3 - i32.const 0 - local.set 5 - br 1 (;@4;) - end - local.get 5 - i32.const 1 - i32.shr_u - local.set 3 - local.get 5 - i32.const 1 - i32.add - i32.const 1 - i32.shr_u - local.set 5 - end - local.get 3 - i32.const 1 - i32.add - local.set 3 - local.get 0 - i32.load offset=16 - local.set 6 - local.get 0 - i32.load offset=24 - local.set 8 - local.get 0 - i32.load offset=20 - local.set 7 - loop ;; label = @4 - local.get 3 - i32.const -1 - i32.add - local.tee 3 - i32.eqz - br_if 2 (;@2;) - local.get 7 - local.get 6 - local.get 8 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@4;) - end - i32.const 1 - return - end - local.get 0 - i32.load offset=20 - local.get 1 - local.get 2 - local.get 0 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - return - end - block ;; label = @2 - local.get 7 - local.get 1 - local.get 2 - local.get 8 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 0 (;@2;) - i32.const 1 - return - end - i32.const 0 - local.set 3 - loop ;; label = @2 - block ;; label = @3 - local.get 5 - local.get 3 - i32.ne - br_if 0 (;@3;) - local.get 5 - local.get 5 - i32.lt_u - return - end - local.get 3 - i32.const 1 - i32.add - local.set 3 - local.get 7 - local.get 6 - local.get 8 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@2;) - end - local.get 3 - i32.const -1 - i32.add - local.get 5 - i32.lt_u - return - end - local.get 0 - i32.load offset=20 - local.get 1 - local.get 2 - local.get 0 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - ) - (func $core::fmt::num::imp::::fmt (;24;) (type 1) (param i32 i32) (result i32) - local.get 0 - i64.load32_u - i32.const 1 - local.get 1 - call $core::fmt::num::imp::fmt_u64 - ) - (func $core::fmt::write (;25;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - i32.const 3 - i32.store8 offset=44 - local.get 3 - i32.const 32 - i32.store offset=28 - i32.const 0 - local.set 4 - local.get 3 - i32.const 0 - i32.store offset=40 - local.get 3 - local.get 1 - i32.store offset=36 - local.get 3 - local.get 0 - i32.store offset=32 - local.get 3 - i32.const 0 - i32.store offset=20 - local.get 3 - i32.const 0 - i32.store offset=12 - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - local.get 2 - i32.load offset=16 - local.tee 5 - br_if 0 (;@5;) - local.get 2 - i32.load offset=12 - local.tee 0 - i32.eqz - br_if 1 (;@4;) - local.get 2 - i32.load offset=8 - local.set 1 - local.get 0 - i32.const 3 - i32.shl - local.set 6 - local.get 0 - i32.const -1 - i32.add - i32.const 536870911 - i32.and - i32.const 1 - i32.add - local.set 4 - local.get 2 - i32.load - local.set 0 - loop ;; label = @6 - block ;; label = @7 - local.get 0 - i32.const 4 - i32.add - i32.load - local.tee 7 - i32.eqz - br_if 0 (;@7;) - local.get 3 - i32.load offset=32 - local.get 0 - i32.load - local.get 7 - local.get 3 - i32.load offset=36 - i32.load offset=12 - call_indirect (type 0) - br_if 4 (;@3;) - end - local.get 1 - i32.load - local.get 3 - i32.const 12 - i32.add - local.get 1 - i32.load offset=4 - call_indirect (type 1) - br_if 3 (;@3;) - local.get 1 - i32.const 8 - i32.add - local.set 1 - local.get 0 - i32.const 8 - i32.add - local.set 0 - local.get 6 - i32.const -8 - i32.add - local.tee 6 - br_if 0 (;@6;) - br 2 (;@4;) - end - end - local.get 2 - i32.load offset=20 - local.tee 1 - i32.eqz - br_if 0 (;@4;) - local.get 1 - i32.const 5 - i32.shl - local.set 8 - local.get 1 - i32.const -1 - i32.add - i32.const 134217727 - i32.and - i32.const 1 - i32.add - local.set 4 - local.get 2 - i32.load offset=8 - local.set 9 - local.get 2 - i32.load - local.set 0 - i32.const 0 - local.set 6 - loop ;; label = @5 - block ;; label = @6 - local.get 0 - i32.const 4 - i32.add - i32.load - local.tee 1 - i32.eqz - br_if 0 (;@6;) - local.get 3 - i32.load offset=32 - local.get 0 - i32.load - local.get 1 - local.get 3 - i32.load offset=36 - i32.load offset=12 - call_indirect (type 0) - br_if 3 (;@3;) - end - local.get 3 - local.get 5 - local.get 6 - i32.add - local.tee 1 - i32.const 16 - i32.add - i32.load - i32.store offset=28 - local.get 3 - local.get 1 - i32.const 28 - i32.add - i32.load8_u - i32.store8 offset=44 - local.get 3 - local.get 1 - i32.const 24 - i32.add - i32.load - i32.store offset=40 - local.get 1 - i32.const 12 - i32.add - i32.load - local.set 7 - i32.const 0 - local.set 10 - i32.const 0 - local.set 11 - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 1 - i32.const 8 - i32.add - i32.load - br_table 1 (;@7;) 0 (;@8;) 2 (;@6;) 1 (;@7;) - end - local.get 7 - i32.const 3 - i32.shl - local.set 12 - i32.const 0 - local.set 11 - local.get 9 - local.get 12 - i32.add - local.tee 12 - i32.load offset=4 - br_if 1 (;@6;) - local.get 12 - i32.load - local.set 7 - end - i32.const 1 - local.set 11 - end - local.get 3 - local.get 7 - i32.store offset=16 - local.get 3 - local.get 11 - i32.store offset=12 - local.get 1 - i32.const 4 - i32.add - i32.load - local.set 7 - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 1 - i32.load - br_table 1 (;@7;) 0 (;@8;) 2 (;@6;) 1 (;@7;) - end - local.get 7 - i32.const 3 - i32.shl - local.set 11 - local.get 9 - local.get 11 - i32.add - local.tee 11 - i32.load offset=4 - br_if 1 (;@6;) - local.get 11 - i32.load - local.set 7 - end - i32.const 1 - local.set 10 - end - local.get 3 - local.get 7 - i32.store offset=24 - local.get 3 - local.get 10 - i32.store offset=20 - local.get 9 - local.get 1 - i32.const 20 - i32.add - i32.load - i32.const 3 - i32.shl - i32.add - local.tee 1 - i32.load - local.get 3 - i32.const 12 - i32.add - local.get 1 - i32.load offset=4 - call_indirect (type 1) - br_if 2 (;@3;) - local.get 0 - i32.const 8 - i32.add - local.set 0 - local.get 8 - local.get 6 - i32.const 32 - i32.add - local.tee 6 - i32.ne - br_if 0 (;@5;) - end - end - local.get 4 - local.get 2 - i32.load offset=4 - i32.ge_u - br_if 1 (;@2;) - local.get 3 - i32.load offset=32 - local.get 2 - i32.load - local.get 4 - i32.const 3 - i32.shl - i32.add - local.tee 1 - i32.load - local.get 1 - i32.load offset=4 - local.get 3 - i32.load offset=36 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 1 (;@2;) - end - i32.const 1 - local.set 1 - br 1 (;@1;) - end - i32.const 0 - local.set 1 - end - local.get 3 - i32.const 48 - i32.add - global.set $__stack_pointer - local.get 1 - ) - (func $core::fmt::builders::DebugStruct::field (;26;) (type 11) (param i32 i32 i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i64) - global.get $__stack_pointer - i32.const 64 - i32.sub - local.tee 5 - global.set $__stack_pointer - i32.const 1 - local.set 6 - block ;; label = @1 - local.get 0 - i32.load8_u offset=4 - br_if 0 (;@1;) - local.get 0 - i32.load8_u offset=5 - local.set 7 - block ;; label = @2 - local.get 0 - i32.load - local.tee 8 - i32.load offset=28 - local.tee 9 - i32.const 4 - i32.and - br_if 0 (;@2;) - i32.const 1 - local.set 6 - local.get 8 - i32.load offset=20 - i32.const 1048963 - i32.const 1048960 - local.get 7 - i32.const 1 - i32.and - local.tee 7 - select - i32.const 2 - i32.const 3 - local.get 7 - select - local.get 8 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - br_if 1 (;@1;) - local.get 8 - i32.load offset=20 - local.get 1 - local.get 2 - local.get 8 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - br_if 1 (;@1;) - local.get 8 - i32.load offset=20 - i32.const 1048928 - i32.const 2 - local.get 8 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - br_if 1 (;@1;) - local.get 3 - local.get 8 - local.get 4 - i32.load offset=12 - call_indirect (type 1) - local.set 6 - br 1 (;@1;) - end - i32.const 1 - local.set 6 - block ;; label = @2 - local.get 7 - i32.const 1 - i32.and - br_if 0 (;@2;) - local.get 8 - i32.load offset=20 - i32.const 1048965 - i32.const 3 - local.get 8 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - br_if 1 (;@1;) - local.get 8 - i32.load offset=28 - local.set 9 - end - i32.const 1 - local.set 6 - local.get 5 - i32.const 1 - i32.store8 offset=27 - local.get 5 - local.get 8 - i64.load offset=20 align=4 - i64.store offset=12 align=4 - local.get 5 - i32.const 1048932 - i32.store offset=52 - local.get 5 - local.get 5 - i32.const 27 - i32.add - i32.store offset=20 - local.get 5 - local.get 8 - i64.load offset=8 align=4 - i64.store offset=36 align=4 - local.get 8 - i64.load align=4 - local.set 10 - local.get 5 - local.get 9 - i32.store offset=56 - local.get 5 - local.get 8 - i32.load offset=16 - i32.store offset=44 - local.get 5 - local.get 8 - i32.load8_u offset=32 - i32.store8 offset=60 - local.get 5 - local.get 10 - i64.store offset=28 align=4 - local.get 5 - local.get 5 - i32.const 12 - i32.add - i32.store offset=48 - local.get 5 - i32.const 12 - i32.add - local.get 1 - local.get 2 - call $::write_str - br_if 0 (;@1;) - local.get 5 - i32.const 12 - i32.add - i32.const 1048928 - i32.const 2 - call $::write_str - br_if 0 (;@1;) - local.get 3 - local.get 5 - i32.const 28 - i32.add - local.get 4 - i32.load offset=12 - call_indirect (type 1) - br_if 0 (;@1;) - local.get 5 - i32.load offset=48 - i32.const 1048968 - i32.const 2 - local.get 5 - i32.load offset=52 - i32.load offset=12 - call_indirect (type 0) - local.set 6 - end - local.get 0 - i32.const 1 - i32.store8 offset=5 - local.get 0 - local.get 6 - i32.store8 offset=4 - local.get 5 - i32.const 64 - i32.add - global.set $__stack_pointer - local.get 0 - ) - (func $<&T as core::fmt::Display>::fmt (;27;) (type 1) (param i32 i32) (result i32) - local.get 1 - local.get 0 - i32.load - local.get 0 - i32.load offset=4 - call $core::fmt::Formatter::pad - ) - (func $core::panicking::assert_failed_inner (;28;) (type 12) (param i32 i32 i32 i32 i32 i32 i32) - (local i32 i64) - global.get $__stack_pointer - i32.const 112 - i32.sub - local.tee 7 - global.set $__stack_pointer - local.get 7 - local.get 2 - i32.store offset=12 - local.get 7 - local.get 1 - i32.store offset=8 - local.get 7 - local.get 4 - i32.store offset=20 - local.get 7 - local.get 3 - i32.store offset=16 - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.const 255 - i32.and - br_table 0 (;@4;) 1 (;@3;) 2 (;@2;) 0 (;@4;) - end - local.get 7 - i32.const 1048784 - i32.store offset=24 - i32.const 2 - local.set 2 - br 2 (;@1;) - end - local.get 7 - i32.const 1048786 - i32.store offset=24 - i32.const 2 - local.set 2 - br 1 (;@1;) - end - local.get 7 - i32.const 1048788 - i32.store offset=24 - i32.const 7 - local.set 2 - end - local.get 7 - local.get 2 - i32.store offset=28 - block ;; label = @1 - local.get 5 - i32.load - br_if 0 (;@1;) - local.get 7 - i32.const 3 - i32.store offset=92 - local.get 7 - i32.const 1048844 - i32.store offset=88 - local.get 7 - i64.const 3 - i64.store offset=100 align=4 - local.get 7 - i32.const 7 - i64.extend_i32_u - i64.const 32 - i64.shl - local.tee 8 - local.get 7 - i32.const 16 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=72 - local.get 7 - local.get 8 - local.get 7 - i32.const 8 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=64 - local.get 7 - i32.const 8 - i64.extend_i32_u - i64.const 32 - i64.shl - local.get 7 - i32.const 24 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=56 - local.get 7 - local.get 7 - i32.const 56 - i32.add - i32.store offset=96 - local.get 7 - i32.const 88 - i32.add - local.get 6 - call $core::panicking::panic_fmt - unreachable - end - local.get 7 - i32.const 32 - i32.add - i32.const 16 - i32.add - local.get 5 - i32.const 16 - i32.add - i64.load align=4 - i64.store - local.get 7 - i32.const 32 - i32.add - i32.const 8 - i32.add - local.get 5 - i32.const 8 - i32.add - i64.load align=4 - i64.store - local.get 7 - local.get 5 - i64.load align=4 - i64.store offset=32 - local.get 7 - i32.const 4 - i32.store offset=92 - local.get 7 - i32.const 1048896 - i32.store offset=88 - local.get 7 - i64.const 4 - i64.store offset=100 align=4 - local.get 7 - i32.const 7 - i64.extend_i32_u - i64.const 32 - i64.shl - local.tee 8 - local.get 7 - i32.const 16 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=80 - local.get 7 - local.get 8 - local.get 7 - i32.const 8 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=72 - local.get 7 - i32.const 9 - i64.extend_i32_u - i64.const 32 - i64.shl - local.get 7 - i32.const 32 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=64 - local.get 7 - i32.const 8 - i64.extend_i32_u - i64.const 32 - i64.shl - local.get 7 - i32.const 24 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=56 - local.get 7 - local.get 7 - i32.const 56 - i32.add - i32.store offset=96 - local.get 7 - i32.const 88 - i32.add - local.get 6 - call $core::panicking::panic_fmt - unreachable - ) - (func $<&T as core::fmt::Debug>::fmt (;29;) (type 1) (param i32 i32) (result i32) - local.get 0 - i32.load - local.get 1 - local.get 0 - i32.load offset=4 - i32.load offset=12 - call_indirect (type 1) - ) - (func $::fmt (;30;) (type 1) (param i32 i32) (result i32) - local.get 1 - i32.load offset=20 - local.get 1 - i32.load offset=24 - local.get 0 - call $core::fmt::write - ) - (func $::write_str (;31;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) - local.get 1 - i32.const -1 - i32.add - local.set 3 - local.get 0 - i32.load offset=4 - local.set 4 - local.get 0 - i32.load - local.set 5 - local.get 0 - i32.load offset=8 - local.set 6 - i32.const 0 - local.set 7 - i32.const 0 - local.set 8 - i32.const 0 - local.set 9 - i32.const 0 - local.set 10 - block ;; label = @1 - loop ;; label = @2 - local.get 10 - i32.const 1 - i32.and - br_if 1 (;@1;) - block ;; label = @3 - block ;; label = @4 - local.get 9 - local.get 2 - i32.gt_u - br_if 0 (;@4;) - loop ;; label = @5 - local.get 1 - local.get 9 - i32.add - local.set 11 - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - block ;; label = @9 - local.get 2 - local.get 9 - i32.sub - local.tee 12 - i32.const 7 - i32.gt_u - br_if 0 (;@9;) - local.get 2 - local.get 9 - i32.ne - br_if 1 (;@8;) - local.get 2 - local.set 9 - br 5 (;@4;) - end - block ;; label = @9 - block ;; label = @10 - local.get 11 - i32.const 3 - i32.add - i32.const -4 - i32.and - local.tee 13 - local.get 11 - i32.sub - local.tee 14 - i32.eqz - br_if 0 (;@10;) - i32.const 0 - local.set 0 - loop ;; label = @11 - local.get 11 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - br_if 5 (;@6;) - local.get 14 - local.get 0 - i32.const 1 - i32.add - local.tee 0 - i32.ne - br_if 0 (;@11;) - end - local.get 14 - local.get 12 - i32.const -8 - i32.add - local.tee 15 - i32.le_u - br_if 1 (;@9;) - br 3 (;@7;) - end - local.get 12 - i32.const -8 - i32.add - local.set 15 - end - loop ;; label = @9 - i32.const 16843008 - local.get 13 - i32.load - local.tee 0 - i32.const 168430090 - i32.xor - i32.sub - local.get 0 - i32.or - i32.const 16843008 - local.get 13 - i32.const 4 - i32.add - i32.load - local.tee 0 - i32.const 168430090 - i32.xor - i32.sub - local.get 0 - i32.or - i32.and - i32.const -2139062144 - i32.and - i32.const -2139062144 - i32.ne - br_if 2 (;@7;) - local.get 13 - i32.const 8 - i32.add - local.set 13 - local.get 14 - i32.const 8 - i32.add - local.tee 14 - local.get 15 - i32.le_u - br_if 0 (;@9;) - br 2 (;@7;) - end - end - i32.const 0 - local.set 0 - loop ;; label = @8 - local.get 11 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - br_if 2 (;@6;) - local.get 12 - local.get 0 - i32.const 1 - i32.add - local.tee 0 - i32.ne - br_if 0 (;@8;) - end - local.get 2 - local.set 9 - br 3 (;@4;) - end - block ;; label = @7 - local.get 14 - local.get 12 - i32.ne - br_if 0 (;@7;) - local.get 2 - local.set 9 - br 3 (;@4;) - end - loop ;; label = @7 - block ;; label = @8 - local.get 11 - local.get 14 - i32.add - i32.load8_u - i32.const 10 - i32.ne - br_if 0 (;@8;) - local.get 14 - local.set 0 - br 2 (;@6;) - end - local.get 12 - local.get 14 - i32.const 1 - i32.add - local.tee 14 - i32.ne - br_if 0 (;@7;) - end - local.get 2 - local.set 9 - br 2 (;@4;) - end - local.get 0 - local.get 9 - i32.add - local.tee 14 - i32.const 1 - i32.add - local.set 9 - block ;; label = @6 - local.get 14 - local.get 2 - i32.ge_u - br_if 0 (;@6;) - local.get 11 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.ne - br_if 0 (;@6;) - local.get 9 - local.set 11 - local.get 9 - local.set 0 - br 3 (;@3;) - end - local.get 9 - local.get 2 - i32.le_u - br_if 0 (;@5;) - end - end - i32.const 1 - local.set 10 - local.get 8 - local.set 11 - local.get 2 - local.set 0 - local.get 8 - local.get 2 - i32.eq - br_if 2 (;@1;) - end - block ;; label = @3 - block ;; label = @4 - local.get 6 - i32.load8_u - i32.eqz - br_if 0 (;@4;) - local.get 5 - i32.const 1048956 - i32.const 4 - local.get 4 - i32.load offset=12 - call_indirect (type 0) - br_if 1 (;@3;) - end - local.get 0 - local.get 8 - i32.sub - local.set 13 - i32.const 0 - local.set 14 - block ;; label = @4 - local.get 0 - local.get 8 - i32.eq - br_if 0 (;@4;) - local.get 3 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - local.set 14 - end - local.get 1 - local.get 8 - i32.add - local.set 0 - local.get 6 - local.get 14 - i32.store8 - local.get 11 - local.set 8 - local.get 5 - local.get 0 - local.get 13 - local.get 4 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 1 (;@2;) - end - end - i32.const 1 - local.set 7 - end - local.get 7 - ) - (func $::write_char (;32;) (type 1) (param i32 i32) (result i32) - (local i32 i32) - local.get 0 - i32.load offset=4 - local.set 2 - local.get 0 - i32.load - local.set 3 - block ;; label = @1 - local.get 0 - i32.load offset=8 - local.tee 0 - i32.load8_u - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.const 1048956 - i32.const 4 - local.get 2 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 0 (;@1;) - i32.const 1 - return - end - local.get 0 - local.get 1 - i32.const 10 - i32.eq - i32.store8 - local.get 3 - local.get 1 - local.get 2 - i32.load offset=16 - call_indirect (type 1) - ) - (func $core::fmt::builders::DebugStruct::finish (;33;) (type 13) (param i32) (result i32) - (local i32 i32) - local.get 0 - i32.load8_u offset=4 - local.tee 1 - local.set 2 - block ;; label = @1 - local.get 0 - i32.load8_u offset=5 - i32.eqz - br_if 0 (;@1;) - i32.const 1 - local.set 2 - block ;; label = @2 - local.get 1 - i32.const 1 - i32.and - br_if 0 (;@2;) - block ;; label = @3 - local.get 0 - i32.load - local.tee 2 - i32.load8_u offset=28 - i32.const 4 - i32.and - br_if 0 (;@3;) - local.get 2 - i32.load offset=20 - i32.const 1048971 - i32.const 2 - local.get 2 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - local.set 2 - br 1 (;@2;) - end - local.get 2 - i32.load offset=20 - i32.const 1048970 - i32.const 1 - local.get 2 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - local.set 2 - end - local.get 0 - local.get 2 - i32.store8 offset=4 - end - local.get 2 - i32.const 1 - i32.and - ) - (func $core::fmt::Formatter::pad_integral (;34;) (type 14) (param i32 i32 i32 i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - block ;; label = @2 - local.get 1 - br_if 0 (;@2;) - local.get 5 - i32.const 1 - i32.add - local.set 6 - local.get 0 - i32.load offset=28 - local.set 7 - i32.const 45 - local.set 8 - br 1 (;@1;) - end - i32.const 43 - i32.const 1114112 - local.get 0 - i32.load offset=28 - local.tee 7 - i32.const 1 - i32.and - local.tee 1 - select - local.set 8 - local.get 1 - local.get 5 - i32.add - local.set 6 - end - block ;; label = @1 - block ;; label = @2 - local.get 7 - i32.const 4 - i32.and - br_if 0 (;@2;) - i32.const 0 - local.set 2 - br 1 (;@1;) - end - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.const 16 - i32.lt_u - br_if 0 (;@3;) - local.get 2 - local.get 3 - call $core::str::count::do_count_chars - local.set 1 - br 1 (;@2;) - end - block ;; label = @3 - local.get 3 - br_if 0 (;@3;) - i32.const 0 - local.set 1 - br 1 (;@2;) - end - local.get 3 - i32.const 3 - i32.and - local.set 9 - block ;; label = @3 - block ;; label = @4 - local.get 3 - i32.const 4 - i32.ge_u - br_if 0 (;@4;) - i32.const 0 - local.set 1 - i32.const 0 - local.set 10 - br 1 (;@3;) - end - local.get 3 - i32.const 12 - i32.and - local.set 11 - i32.const 0 - local.set 1 - i32.const 0 - local.set 10 - loop ;; label = @4 - local.get 1 - local.get 2 - local.get 10 - i32.add - local.tee 12 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 12 - i32.const 1 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 12 - i32.const 2 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 12 - i32.const 3 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 1 - local.get 11 - local.get 10 - i32.const 4 - i32.add - local.tee 10 - i32.ne - br_if 0 (;@4;) - end - end - local.get 9 - i32.eqz - br_if 0 (;@2;) - local.get 2 - local.get 10 - i32.add - local.set 12 - loop ;; label = @3 - local.get 1 - local.get 12 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 1 - local.get 12 - i32.const 1 - i32.add - local.set 12 - local.get 9 - i32.const -1 - i32.add - local.tee 9 - br_if 0 (;@3;) - end - end - local.get 1 - local.get 6 - i32.add - local.set 6 - end - block ;; label = @1 - local.get 0 - i32.load - br_if 0 (;@1;) - block ;; label = @2 - local.get 0 - i32.load offset=20 - local.tee 1 - local.get 0 - i32.load offset=24 - local.tee 12 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - i32.eqz - br_if 0 (;@2;) - i32.const 1 - return - end - local.get 1 - local.get 4 - local.get 5 - local.get 12 - i32.load offset=12 - call_indirect (type 0) - return - end - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.load offset=4 - local.tee 1 - local.get 6 - i32.gt_u - br_if 0 (;@4;) - local.get 0 - i32.load offset=20 - local.tee 1 - local.get 0 - i32.load offset=24 - local.tee 12 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - i32.eqz - br_if 1 (;@3;) - i32.const 1 - return - end - local.get 7 - i32.const 8 - i32.and - i32.eqz - br_if 1 (;@2;) - local.get 0 - i32.load offset=16 - local.set 9 - local.get 0 - i32.const 48 - i32.store offset=16 - local.get 0 - i32.load8_u offset=32 - local.set 7 - i32.const 1 - local.set 11 - local.get 0 - i32.const 1 - i32.store8 offset=32 - local.get 0 - i32.load offset=20 - local.tee 12 - local.get 0 - i32.load offset=24 - local.tee 10 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - br_if 2 (;@1;) - local.get 1 - local.get 6 - i32.sub - i32.const 1 - i32.add - local.set 1 - block ;; label = @4 - loop ;; label = @5 - local.get 1 - i32.const -1 - i32.add - local.tee 1 - i32.eqz - br_if 1 (;@4;) - local.get 12 - i32.const 48 - local.get 10 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@5;) - end - i32.const 1 - return - end - block ;; label = @4 - local.get 12 - local.get 4 - local.get 5 - local.get 10 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 0 (;@4;) - i32.const 1 - return - end - local.get 0 - local.get 7 - i32.store8 offset=32 - local.get 0 - local.get 9 - i32.store offset=16 - i32.const 0 - return - end - local.get 1 - local.get 4 - local.get 5 - local.get 12 - i32.load offset=12 - call_indirect (type 0) - local.set 11 - br 1 (;@1;) - end - local.get 1 - local.get 6 - i32.sub - local.set 6 - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.load8_u offset=32 - local.tee 1 - br_table 2 (;@2;) 0 (;@4;) 1 (;@3;) 0 (;@4;) 2 (;@2;) - end - local.get 6 - local.set 1 - i32.const 0 - local.set 6 - br 1 (;@2;) - end - local.get 6 - i32.const 1 - i32.shr_u - local.set 1 - local.get 6 - i32.const 1 - i32.add - i32.const 1 - i32.shr_u - local.set 6 - end - local.get 1 - i32.const 1 - i32.add - local.set 1 - local.get 0 - i32.load offset=16 - local.set 9 - local.get 0 - i32.load offset=24 - local.set 12 - local.get 0 - i32.load offset=20 - local.set 10 - block ;; label = @2 - loop ;; label = @3 - local.get 1 - i32.const -1 - i32.add - local.tee 1 - i32.eqz - br_if 1 (;@2;) - local.get 10 - local.get 9 - local.get 12 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@3;) - end - i32.const 1 - return - end - i32.const 1 - local.set 11 - local.get 10 - local.get 12 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - br_if 0 (;@1;) - local.get 10 - local.get 4 - local.get 5 - local.get 12 - i32.load offset=12 - call_indirect (type 0) - br_if 0 (;@1;) - i32.const 0 - local.set 1 - loop ;; label = @2 - block ;; label = @3 - local.get 6 - local.get 1 - i32.ne - br_if 0 (;@3;) - local.get 6 - local.get 6 - i32.lt_u - return - end - local.get 1 - i32.const 1 - i32.add - local.set 1 - local.get 10 - local.get 9 - local.get 12 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@2;) - end - local.get 1 - i32.const -1 - i32.add - local.get 6 - i32.lt_u - return - end - local.get 11 - ) - (func $core::fmt::Write::write_fmt (;35;) (type 1) (param i32 i32) (result i32) - local.get 0 - i32.const 1048932 - local.get 1 - call $core::fmt::write - ) - (func $core::str::count::do_count_chars (;36;) (type 1) (param i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - block ;; label = @2 - local.get 1 - local.get 0 - i32.const 3 - i32.add - i32.const -4 - i32.and - local.tee 2 - local.get 0 - i32.sub - local.tee 3 - i32.lt_u - br_if 0 (;@2;) - local.get 1 - local.get 3 - i32.sub - local.tee 4 - i32.const 4 - i32.lt_u - br_if 0 (;@2;) - local.get 4 - i32.const 3 - i32.and - local.set 5 - i32.const 0 - local.set 6 - i32.const 0 - local.set 1 - block ;; label = @3 - local.get 2 - local.get 0 - i32.eq - local.tee 7 - br_if 0 (;@3;) - i32.const 0 - local.set 1 - block ;; label = @4 - block ;; label = @5 - local.get 0 - local.get 2 - i32.sub - local.tee 8 - i32.const -4 - i32.le_u - br_if 0 (;@5;) - i32.const 0 - local.set 9 - br 1 (;@4;) - end - i32.const 0 - local.set 9 - loop ;; label = @5 - local.get 1 - local.get 0 - local.get 9 - i32.add - local.tee 2 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 2 - i32.const 1 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 2 - i32.const 2 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 2 - i32.const 3 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 1 - local.get 9 - i32.const 4 - i32.add - local.tee 9 - br_if 0 (;@5;) - end - end - local.get 7 - br_if 0 (;@3;) - local.get 0 - local.get 9 - i32.add - local.set 2 - loop ;; label = @4 - local.get 1 - local.get 2 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 1 - local.get 2 - i32.const 1 - i32.add - local.set 2 - local.get 8 - i32.const 1 - i32.add - local.tee 8 - br_if 0 (;@4;) - end - end - local.get 0 - local.get 3 - i32.add - local.set 9 - block ;; label = @3 - local.get 5 - i32.eqz - br_if 0 (;@3;) - local.get 9 - local.get 4 - i32.const -4 - i32.and - i32.add - local.tee 2 - i32.load8_s - i32.const -65 - i32.gt_s - local.set 6 - local.get 5 - i32.const 1 - i32.eq - br_if 0 (;@3;) - local.get 6 - local.get 2 - i32.load8_s offset=1 - i32.const -65 - i32.gt_s - i32.add - local.set 6 - local.get 5 - i32.const 2 - i32.eq - br_if 0 (;@3;) - local.get 6 - local.get 2 - i32.load8_s offset=2 - i32.const -65 - i32.gt_s - i32.add - local.set 6 - end - local.get 4 - i32.const 2 - i32.shr_u - local.set 3 - local.get 6 - local.get 1 - i32.add - local.set 8 - loop ;; label = @3 - local.get 9 - local.set 4 - local.get 3 - i32.eqz - br_if 2 (;@1;) - local.get 3 - i32.const 192 - local.get 3 - i32.const 192 - i32.lt_u - select - local.tee 6 - i32.const 3 - i32.and - local.set 7 - local.get 6 - i32.const 2 - i32.shl - local.set 5 - i32.const 0 - local.set 2 - block ;; label = @4 - local.get 3 - i32.const 4 - i32.lt_u - br_if 0 (;@4;) - local.get 4 - local.get 5 - i32.const 1008 - i32.and - i32.add - local.set 0 - i32.const 0 - local.set 2 - local.get 4 - local.set 1 - loop ;; label = @5 - local.get 1 - i32.load offset=12 - local.tee 9 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 9 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.get 1 - i32.load offset=8 - local.tee 9 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 9 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.get 1 - i32.load offset=4 - local.tee 9 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 9 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.get 1 - i32.load - local.tee 9 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 9 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.get 2 - i32.add - i32.add - i32.add - i32.add - local.set 2 - local.get 1 - i32.const 16 - i32.add - local.tee 1 - local.get 0 - i32.ne - br_if 0 (;@5;) - end - end - local.get 3 - local.get 6 - i32.sub - local.set 3 - local.get 4 - local.get 5 - i32.add - local.set 9 - local.get 2 - i32.const 8 - i32.shr_u - i32.const 16711935 - i32.and - local.get 2 - i32.const 16711935 - i32.and - i32.add - i32.const 65537 - i32.mul - i32.const 16 - i32.shr_u - local.get 8 - i32.add - local.set 8 - local.get 7 - i32.eqz - br_if 0 (;@3;) - end - local.get 4 - local.get 6 - i32.const 252 - i32.and - i32.const 2 - i32.shl - i32.add - local.tee 2 - i32.load - local.tee 1 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 1 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.set 1 - block ;; label = @3 - local.get 7 - i32.const 1 - i32.eq - br_if 0 (;@3;) - local.get 2 - i32.load offset=4 - local.tee 9 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 9 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.get 1 - i32.add - local.set 1 - local.get 7 - i32.const 2 - i32.eq - br_if 0 (;@3;) - local.get 2 - i32.load offset=8 - local.tee 2 - i32.const -1 - i32.xor - i32.const 7 - i32.shr_u - local.get 2 - i32.const 6 - i32.shr_u - i32.or - i32.const 16843009 - i32.and - local.get 1 - i32.add - local.set 1 - end - local.get 1 - i32.const 8 - i32.shr_u - i32.const 459007 - i32.and - local.get 1 - i32.const 16711935 - i32.and - i32.add - i32.const 65537 - i32.mul - i32.const 16 - i32.shr_u - local.get 8 - i32.add - return - end - block ;; label = @2 - local.get 1 - br_if 0 (;@2;) - i32.const 0 - return - end - local.get 1 - i32.const 3 - i32.and - local.set 9 - block ;; label = @2 - block ;; label = @3 - local.get 1 - i32.const 4 - i32.ge_u - br_if 0 (;@3;) - i32.const 0 - local.set 8 - i32.const 0 - local.set 2 - br 1 (;@2;) - end - local.get 1 - i32.const -4 - i32.and - local.set 3 - i32.const 0 - local.set 8 - i32.const 0 - local.set 2 - loop ;; label = @3 - local.get 8 - local.get 0 - local.get 2 - i32.add - local.tee 1 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 1 - i32.const 1 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 1 - i32.const 2 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.get 1 - i32.const 3 - i32.add - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 8 - local.get 3 - local.get 2 - i32.const 4 - i32.add - local.tee 2 - i32.ne - br_if 0 (;@3;) - end - end - local.get 9 - i32.eqz - br_if 0 (;@1;) - local.get 0 - local.get 2 - i32.add - local.set 1 - loop ;; label = @2 - local.get 8 - local.get 1 - i32.load8_s - i32.const -65 - i32.gt_s - i32.add - local.set 8 - local.get 1 - i32.const 1 - i32.add - local.set 1 - local.get 9 - i32.const -1 - i32.add - local.tee 9 - br_if 0 (;@2;) - end - end - local.get 8 - ) - (func $core::fmt::Formatter::pad_integral::write_prefix (;37;) (type 11) (param i32 i32 i32 i32 i32) (result i32) - block ;; label = @1 - local.get 2 - i32.const 1114112 - i32.eq - br_if 0 (;@1;) - local.get 0 - local.get 2 - local.get 1 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@1;) - i32.const 1 - return - end - block ;; label = @1 - local.get 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 0 - local.get 3 - local.get 4 - local.get 1 - i32.load offset=12 - call_indirect (type 0) - ) - (func $core::fmt::Formatter::debug_struct (;38;) (type 9) (param i32 i32 i32 i32) - local.get 1 - i32.load offset=20 - local.get 2 - local.get 3 - local.get 1 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - local.set 3 - local.get 0 - i32.const 0 - i32.store8 offset=5 - local.get 0 - local.get 3 - i32.store8 offset=4 - local.get 0 - local.get 1 - i32.store - ) - (func $core::fmt::num::imp::::fmt (;39;) (type 1) (param i32 i32) (result i32) - local.get 0 - i64.load - i32.const 1 - local.get 1 - call $core::fmt::num::imp::fmt_u64 - ) - (func $core::fmt::num::imp::fmt_u64 (;40;) (type 15) (param i64 i32 i32) (result i32) - (local i32 i32 i64 i32 i32 i32) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 3 - global.set $__stack_pointer - i32.const 39 - local.set 4 - block ;; label = @1 - block ;; label = @2 - local.get 0 - i64.const 10000 - i64.ge_u - br_if 0 (;@2;) - local.get 0 - local.set 5 - br 1 (;@1;) - end - i32.const 39 - local.set 4 - loop ;; label = @2 - local.get 3 - i32.const 9 - i32.add - local.get 4 - i32.add - local.tee 6 - i32.const -4 - i32.add - local.get 0 - local.get 0 - i64.const 10000 - i64.div_u - local.tee 5 - i64.const 10000 - i64.mul - i64.sub - i32.wrap_i64 - local.tee 7 - i32.const 65535 - i32.and - i32.const 100 - i32.div_u - local.tee 8 - i32.const 1 - i32.shl - i32.const 1049010 - i32.add - i32.load16_u align=1 - i32.store16 align=1 - local.get 6 - i32.const -2 - i32.add - local.get 7 - local.get 8 - i32.const 100 - i32.mul - i32.sub - i32.const 65535 - i32.and - i32.const 1 - i32.shl - i32.const 1049010 - i32.add - i32.load16_u align=1 - i32.store16 align=1 - local.get 4 - i32.const -4 - i32.add - local.set 4 - local.get 0 - i64.const 99999999 - i64.gt_u - local.set 6 - local.get 5 - local.set 0 - local.get 6 - br_if 0 (;@2;) - end - end - block ;; label = @1 - block ;; label = @2 - local.get 5 - i64.const 99 - i64.gt_u - br_if 0 (;@2;) - local.get 5 - i32.wrap_i64 - local.set 6 - br 1 (;@1;) - end - local.get 3 - i32.const 9 - i32.add - local.get 4 - i32.const -2 - i32.add - local.tee 4 - i32.add - local.get 5 - i32.wrap_i64 - local.tee 6 - local.get 6 - i32.const 65535 - i32.and - i32.const 100 - i32.div_u - local.tee 6 - i32.const 100 - i32.mul - i32.sub - i32.const 65535 - i32.and - i32.const 1 - i32.shl - i32.const 1049010 - i32.add - i32.load16_u align=1 - i32.store16 align=1 - end - block ;; label = @1 - block ;; label = @2 - local.get 6 - i32.const 10 - i32.lt_u - br_if 0 (;@2;) - local.get 3 - i32.const 9 - i32.add - local.get 4 - i32.const -2 - i32.add - local.tee 4 - i32.add - local.get 6 - i32.const 1 - i32.shl - i32.const 1049010 - i32.add - i32.load16_u align=1 - i32.store16 align=1 - br 1 (;@1;) - end - local.get 3 - i32.const 9 - i32.add - local.get 4 - i32.const -1 - i32.add - local.tee 4 - i32.add - local.get 6 - i32.const 48 - i32.or - i32.store8 - end - local.get 2 - local.get 1 - i32.const 1 - i32.const 0 - local.get 3 - i32.const 9 - i32.add - local.get 4 - i32.add - i32.const 39 - local.get 4 - i32.sub - call $core::fmt::Formatter::pad_integral - local.set 4 - local.get 3 - i32.const 48 - i32.add - global.set $__stack_pointer - local.get 4 - ) - (func $core::fmt::num::::fmt (;41;) (type 1) (param i32 i32) (result i32) - (local i32 i64 i32) - global.get $__stack_pointer - i32.const 128 - i32.sub - local.tee 2 - global.set $__stack_pointer - local.get 0 - i64.load - local.set 3 - i32.const 0 - local.set 0 - loop ;; label = @1 - local.get 2 - local.get 0 - i32.add - i32.const 127 - i32.add - local.get 3 - i32.wrap_i64 - i32.const 15 - i32.and - local.tee 4 - i32.const 48 - i32.or - local.get 4 - i32.const 87 - i32.add - local.get 4 - i32.const 10 - i32.lt_u - select - i32.store8 - local.get 0 - i32.const -1 - i32.add - local.set 0 - local.get 3 - i64.const 16 - i64.lt_u - local.set 4 - local.get 3 - i64.const 4 - i64.shr_u - local.set 3 - local.get 4 - i32.eqz - br_if 0 (;@1;) - end - block ;; label = @1 - local.get 0 - i32.const 128 - i32.add - local.tee 4 - i32.const 129 - i32.lt_u - br_if 0 (;@1;) - local.get 4 - i32.const 128 - i32.const 1048992 - call $core::slice::index::slice_start_index_len_fail - unreachable - end - local.get 1 - i32.const 1 - i32.const 1049008 - i32.const 2 - local.get 2 - local.get 0 - i32.add - i32.const 128 - i32.add - i32.const 0 - local.get 0 - i32.sub - call $core::fmt::Formatter::pad_integral - local.set 0 - local.get 2 - i32.const 128 - i32.add - global.set $__stack_pointer - local.get 0 - ) - (func $core::fmt::num::::fmt (;42;) (type 1) (param i32 i32) (result i32) - (local i32 i64 i32) - global.get $__stack_pointer - i32.const 128 - i32.sub - local.tee 2 - global.set $__stack_pointer - local.get 0 - i64.load - local.set 3 - i32.const 0 - local.set 0 - loop ;; label = @1 - local.get 2 - local.get 0 - i32.add - i32.const 127 - i32.add - local.get 3 - i32.wrap_i64 - i32.const 15 - i32.and - local.tee 4 - i32.const 48 - i32.or - local.get 4 - i32.const 55 - i32.add - local.get 4 - i32.const 10 - i32.lt_u - select - i32.store8 - local.get 0 - i32.const -1 - i32.add - local.set 0 - local.get 3 - i64.const 16 - i64.lt_u - local.set 4 - local.get 3 - i64.const 4 - i64.shr_u - local.set 3 - local.get 4 - i32.eqz - br_if 0 (;@1;) - end - block ;; label = @1 - local.get 0 - i32.const 128 - i32.add - local.tee 4 - i32.const 129 - i32.lt_u - br_if 0 (;@1;) - local.get 4 - i32.const 128 - i32.const 1048992 - call $core::slice::index::slice_start_index_len_fail - unreachable - end - local.get 1 - i32.const 1 - i32.const 1049008 - i32.const 2 - local.get 2 - local.get 0 - i32.add - i32.const 128 - i32.add - i32.const 0 - local.get 0 - i32.sub - call $core::fmt::Formatter::pad_integral - local.set 0 - local.get 2 - i32.const 128 - i32.add - global.set $__stack_pointer - local.get 0 - ) - (func $cabi_realloc (;43;) (type 8) (param i32 i32 i32 i32) (result i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $wit_bindgen_rt::cabi_realloc - ) - (table (;0;) 13 13 funcref) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "miden:base/note-script@1.0.0#note-script" (func $miden:base/note-script@1.0.0#note-script)) - (export "cabi_realloc" (func $cabi_realloc)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $<&T as core::fmt::Debug>::fmt $basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports $core::fmt::num::::fmt $::fmt $cabi_realloc $core::fmt::num::imp::::fmt $<&T as core::fmt::Debug>::fmt $<&T as core::fmt::Display>::fmt $::fmt $::write_str $::write_char $core::fmt::Write::write_fmt) - (data $.rodata (;0;) (i32.const 1048576) "\00\00\00\00\04\00\00\00\04\00\00\00\01\00\00\00\02\00\00\00Felt\00\00\00\00\08\00\00\00\08\00\00\00\03\00\00\00innerAccountId\00\00\00\00\00\00\08\00\00\00\08\00\00\00\04\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00src/lib.rs\00\00\5c\00\10\00\0a\00\00\00!\00\00\00,\00\00\00\5c\00\10\00\0a\00\00\00$\00\00\00\09\00\00\00\05\00\00\00index out of bounds: the len is but the index is \00\00\8c\00\10\00 \00\00\00\ac\00\10\00\12\00\00\00==!=matchesassertion `left right` failed\0a left: \0a right: \00\db\00\10\00\10\00\00\00\eb\00\10\00\17\00\00\00\02\01\10\00\09\00\00\00 right` failed: \0a left: \00\00\00\db\00\10\00\10\00\00\00$\01\10\00\10\00\00\004\01\10\00\09\00\00\00\02\01\10\00\09\00\00\00: \00\00\00\00\00\00\0c\00\00\00\04\00\00\00\0a\00\00\00\0b\00\00\00\0c\00\00\00 { , {\0a,\0a} }core/src/fmt/num.rs\8d\01\10\00\13\00\00\00f\00\00\00\17\00\00\000x00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899range start index out of range for slice of length \00\00z\02\10\00\12\00\00\00\8c\02\10\00\22\00\00\00") - ) - (core module (;1;) - (type (;0;) (func (param i32))) - (func $indirect-miden:base/note@1.0.0-get-inputs (;0;) (type 0) (param i32) - local.get 0 - i32.const 0 - call_indirect (type 0) - ) - (func $indirect-miden:base/note@1.0.0-get-assets (;1;) (type 0) (param i32) - local.get 0 - i32.const 1 - call_indirect (type 0) - ) - (table (;0;) 2 2 funcref) - (export "0" (func $indirect-miden:base/note@1.0.0-get-inputs)) - (export "1" (func $indirect-miden:base/note@1.0.0-get-assets)) - (export "$imports" (table 0)) - ) - (core module (;2;) - (type (;0;) (func (param i32))) - (import "" "0" (func (;0;) (type 0))) - (import "" "1" (func (;1;) (type 0))) - (import "" "$imports" (table (;0;) 2 2 funcref)) - (elem (;0;) (i32.const 0) func 0 1) - ) - (core instance (;0;) (instantiate 1)) - (alias core export 0 "0" (core func (;0;))) - (alias core export 0 "1" (core func (;1;))) - (core instance (;1;) - (export "get-inputs" (func 0)) - (export "get-assets" (func 1)) - ) - (alias export 0 "account-id-from-felt" (func (;0;))) - (core func (;2;) (canon lower (func 0))) - (core instance (;2;) - (export "account-id-from-felt" (func 2)) - ) - (alias export 1 "get-id" (func (;1;))) - (core func (;3;) (canon lower (func 1))) - (core instance (;3;) - (export "get-id" (func 3)) - ) - (alias export 3 "receive-asset" (func (;2;))) - (core func (;4;) (canon lower (func 2))) - (core instance (;4;) - (export "receive-asset" (func 4)) - ) - (core instance (;5;) (instantiate 0 - (with "miden:base/note@1.0.0" (instance 1)) - (with "miden:base/core-types@1.0.0" (instance 2)) - (with "miden:base/account@1.0.0" (instance 3)) - (with "miden:basic-wallet/basic-wallet@1.0.0" (instance 4)) - ) - ) - (alias core export 5 "memory" (core memory (;0;))) - (alias core export 5 "cabi_realloc" (core func (;5;))) - (alias core export 0 "$imports" (core table (;0;))) - (alias export 2 "get-inputs" (func (;3;))) - (core func (;6;) (canon lower (func 3) (memory 0) (realloc 5))) - (alias export 2 "get-assets" (func (;4;))) - (core func (;7;) (canon lower (func 4) (memory 0) (realloc 5))) - (core instance (;6;) - (export "$imports" (table 0)) - (export "0" (func 6)) - (export "1" (func 7)) - ) - (core instance (;7;) (instantiate 2 - (with "" (instance 6)) - ) - ) - (type (;8;) (func)) - (alias core export 5 "miden:base/note-script@1.0.0#note-script" (core func (;8;))) - (func (;5;) (type 8) (canon lift (core func 8))) - (component (;0;) - (type (;0;) (func)) - (import "import-func-note-script" (func (;0;) (type 0))) - (type (;1;) (func)) - (export (;1;) "note-script" (func 0) (func (type 1))) - ) - (instance (;4;) (instantiate 0 - (with "import-func-note-script" (func 5)) - ) - ) - (export (;5;) "miden:base/note-script@1.0.0" (instance 4)) -) \ No newline at end of file diff --git a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat b/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat deleted file mode 100644 index 1c738a7ab..000000000 --- a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat +++ /dev/null @@ -1,898 +0,0 @@ -(component - (core module (;0;) - (type (;0;) (func)) - (type (;1;) (func (param i32))) - (type (;2;) (func (param i32 i32) (result i32))) - (type (;3;) (func (param i32 i32 i32 i32) (result i32))) - (type (;4;) (func (param i64) (result i64))) - (type (;5;) (func (param i64 i64 i64 i64) (result i32))) - (type (;6;) (func (param i32 i64 i64 i64 i64) (result i32))) - (type (;7;) (func (param i32 i32 i32) (result i32))) - (type (;8;) (func (param i32 i32 i32 i32))) - (type (;9;) (func (param i32 i32))) - (type (;10;) (func (param i32 i32 i32))) - (func $__wasm_call_ctors (;0;) (type 0)) - (func $rust_begin_unwind (;1;) (type 1) (param i32) - loop ;; label = @1 - br 0 (;@1;) - end - ) - (func $miden_sdk::bindings::__link_custom_section_describing_imports (;2;) (type 0)) - (func $__rust_alloc (;3;) (type 2) (param i32 i32) (result i32) - i32.const 1048652 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;4;) (type 3) (param i32 i32 i32 i32) (result i32) - (local i32) - block ;; label = @1 - i32.const 1048652 - local.get 2 - local.get 3 - call $::alloc - local.tee 4 - i32.eqz - br_if 0 (;@1;) - local.get 4 - local.get 0 - local.get 1 - local.get 3 - local.get 1 - local.get 3 - i32.lt_u - select - memory.copy - i32.const 1048652 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc - end - local.get 4 - ) - (func $miden:base/core-types@1.0.0#account-id-from-felt (;5;) (type 4) (param i64) (result i64) - call $wit_bindgen_rt::run_ctors_once - local.get 0 - ) - (func $miden:base/types@1.0.0#from-core-asset (;6;) (type 5) (param i64 i64 i64 i64) (result i32) - call $wit_bindgen_rt::run_ctors_once - i32.const 1048584 - i32.const 19 - i32.const 1048616 - call $core::panicking::panic - unreachable - ) - (func $miden:base/types@1.0.0#to-core-asset (;7;) (type 6) (param i32 i64 i64 i64 i64) (result i32) - call $wit_bindgen_rt::run_ctors_once - i32.const 1048584 - i32.const 19 - i32.const 1048632 - call $core::panicking::panic - unreachable - ) - (func $wit_bindgen_rt::cabi_realloc (;8;) (type 3) (param i32 i32 i32 i32) (result i32) - block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 1 - br_if 0 (;@3;) - local.get 3 - i32.eqz - br_if 2 (;@1;) - i32.const 0 - i32.load8_u offset=1048656 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@2;) - end - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $__rust_realloc - local.set 2 - end - local.get 2 - br_if 0 (;@1;) - unreachable - end - local.get 2 - ) - (func $wit_bindgen_rt::run_ctors_once (;9;) (type 0) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048657 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048657 - end - ) - (func $wee_alloc::alloc_first_fit (;10;) (type 7) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 2 - i32.load - local.tee 3 - br_if 0 (;@1;) - i32.const 0 - return - end - local.get 1 - i32.const -1 - i32.add - local.set 4 - i32.const 0 - local.get 1 - i32.sub - local.set 5 - local.get 0 - i32.const 2 - i32.shl - local.set 6 - loop ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 3 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - local.get 3 - i32.const 8 - i32.add - local.set 0 - br 1 (;@2;) - end - loop ;; label = @3 - local.get 3 - local.get 1 - i32.const -2 - i32.and - i32.store offset=8 - block ;; label = @4 - block ;; label = @5 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@5;) - i32.const 0 - local.set 8 - br 1 (;@4;) - end - i32.const 0 - local.get 0 - local.get 0 - i32.load8_u - i32.const 1 - i32.and - select - local.set 8 - end - block ;; label = @4 - local.get 3 - i32.load - local.tee 1 - i32.const -4 - i32.and - local.tee 9 - i32.eqz - br_if 0 (;@4;) - local.get 1 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 9 - local.get 9 - i32.load offset=4 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.set 0 - local.get 3 - i32.load - local.set 1 - end - block ;; label = @4 - local.get 0 - i32.eqz - br_if 0 (;@4;) - local.get 0 - local.get 0 - i32.load - i32.const 3 - i32.and - local.get 1 - i32.const -4 - i32.and - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 1 - end - local.get 3 - local.get 7 - i32.const 3 - i32.and - i32.store offset=4 - local.get 3 - local.get 1 - i32.const 3 - i32.and - i32.store - block ;; label = @4 - local.get 1 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 - local.get 8 - i32.store - local.get 8 - local.set 3 - local.get 8 - i32.load offset=8 - local.tee 1 - i32.const 1 - i32.and - br_if 0 (;@3;) - end - local.get 8 - i32.const 8 - i32.add - local.set 0 - local.get 8 - local.set 3 - end - block ;; label = @2 - local.get 3 - i32.load - i32.const -4 - i32.and - local.tee 8 - local.get 0 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@2;) - block ;; label = @3 - block ;; label = @4 - local.get 0 - i32.const 72 - i32.add - local.get 8 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 8 - i32.le_u - br_if 0 (;@4;) - local.get 4 - local.get 0 - i32.and - br_if 2 (;@2;) - local.get 2 - local.get 1 - i32.const -4 - i32.and - i32.store - local.get 3 - i32.load - local.set 0 - local.get 3 - local.set 1 - br 1 (;@3;) - end - i32.const 0 - local.set 7 - local.get 8 - i32.const 0 - i32.store - local.get 8 - i32.const -8 - i32.add - local.tee 1 - i64.const 0 - i64.store align=4 - local.get 1 - local.get 3 - i32.load - i32.const -4 - i32.and - i32.store - block ;; label = @4 - local.get 3 - i32.load - local.tee 9 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@4;) - local.get 9 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 1 - i32.load offset=4 - i32.const 3 - i32.and - local.set 7 - end - local.get 1 - local.get 7 - local.get 3 - i32.or - i32.store offset=4 - local.get 0 - local.get 0 - i32.load - i32.const -2 - i32.and - i32.store - local.get 3 - local.get 3 - i32.load - local.tee 0 - i32.const 3 - i32.and - local.get 1 - i32.or - local.tee 8 - i32.store - block ;; label = @4 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@4;) - local.get 1 - i32.load - local.set 0 - br 1 (;@3;) - end - local.get 3 - local.get 8 - i32.const -3 - i32.and - i32.store - local.get 1 - i32.load - i32.const 2 - i32.or - local.set 0 - end - local.get 1 - local.get 0 - i32.const 1 - i32.or - i32.store - local.get 1 - i32.const 8 - i32.add - return - end - local.get 2 - local.get 1 - i32.store - local.get 1 - local.set 3 - local.get 1 - br_if 0 (;@1;) - end - i32.const 0 - ) - (func $::alloc (;11;) (type 7) (param i32 i32 i32) (result i32) - (local i32 i32 i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 3 - global.set $__stack_pointer - block ;; label = @1 - block ;; label = @2 - local.get 2 - br_if 0 (;@2;) - local.get 1 - local.set 2 - br 1 (;@1;) - end - local.get 3 - local.get 0 - i32.load - i32.store offset=12 - block ;; label = @2 - local.get 2 - i32.const 3 - i32.add - local.tee 4 - i32.const 2 - i32.shr_u - local.tee 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.tee 2 - br_if 0 (;@2;) - block ;; label = @3 - local.get 4 - i32.const -4 - i32.and - local.tee 2 - local.get 1 - i32.const 3 - i32.shl - i32.const 512 - i32.add - local.tee 4 - local.get 2 - local.get 4 - i32.gt_u - select - i32.const 65543 - i32.add - local.tee 4 - i32.const 16 - i32.shr_u - memory.grow - local.tee 2 - i32.const -1 - i32.ne - br_if 0 (;@3;) - i32.const 0 - local.set 2 - br 1 (;@2;) - end - local.get 2 - i32.const 16 - i32.shl - local.tee 2 - i32.const 0 - i32.store offset=4 - local.get 2 - local.get 3 - i32.load offset=12 - i32.store offset=8 - local.get 2 - local.get 2 - local.get 4 - i32.const -65536 - i32.and - i32.add - i32.const 2 - i32.or - i32.store - local.get 3 - local.get 2 - i32.store offset=12 - local.get 5 - local.get 1 - local.get 3 - i32.const 12 - i32.add - call $wee_alloc::alloc_first_fit - local.set 2 - end - local.get 0 - local.get 3 - i32.load offset=12 - i32.store - end - local.get 3 - i32.const 16 - i32.add - global.set $__stack_pointer - local.get 2 - ) - (func $::dealloc (;12;) (type 8) (param i32 i32 i32 i32) - (local i32 i32 i32 i32 i32 i32 i32) - block ;; label = @1 - local.get 1 - i32.eqz - br_if 0 (;@1;) - local.get 3 - i32.eqz - br_if 0 (;@1;) - local.get 0 - i32.load - local.set 4 - local.get 1 - i32.const 0 - i32.store - local.get 1 - i32.const -8 - i32.add - local.tee 3 - local.get 3 - i32.load - local.tee 5 - i32.const -2 - i32.and - local.tee 6 - i32.store - block ;; label = @2 - block ;; label = @3 - block ;; label = @4 - block ;; label = @5 - local.get 1 - i32.const -4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - br_if 0 (;@5;) - block ;; label = @6 - block ;; label = @7 - block ;; label = @8 - local.get 5 - i32.const -4 - i32.and - local.tee 10 - br_if 0 (;@8;) - local.get 8 - local.set 1 - br 1 (;@7;) - end - local.get 8 - local.set 1 - local.get 5 - i32.const 2 - i32.and - br_if 0 (;@7;) - local.get 10 - local.get 10 - i32.load offset=4 - i32.const 3 - i32.and - local.get 8 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 6 - local.get 7 - i32.load - local.tee 5 - i32.const -4 - i32.and - local.tee 1 - i32.eqz - br_if 1 (;@6;) - local.get 1 - i32.load - local.set 9 - end - local.get 1 - local.get 6 - i32.const -4 - i32.and - local.get 9 - i32.const 3 - i32.and - i32.or - i32.store - local.get 7 - i32.load - local.set 5 - local.get 3 - i32.load - local.set 6 - end - local.get 7 - local.get 5 - i32.const 3 - i32.and - i32.store - local.get 3 - local.get 6 - i32.const 3 - i32.and - i32.store - local.get 6 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@4;) - local.get 8 - local.get 8 - i32.load - i32.const 2 - i32.or - i32.store - br 1 (;@4;) - end - local.get 5 - i32.const 2 - i32.and - br_if 1 (;@3;) - local.get 5 - i32.const -4 - i32.and - local.tee 5 - i32.eqz - br_if 1 (;@3;) - local.get 5 - i32.load8_u - i32.const 1 - i32.and - br_if 1 (;@3;) - local.get 1 - local.get 5 - i32.load offset=8 - i32.const -4 - i32.and - i32.store - local.get 5 - local.get 3 - i32.const 1 - i32.or - i32.store offset=8 - end - local.get 4 - local.set 3 - br 1 (;@2;) - end - local.get 1 - local.get 4 - i32.store - end - local.get 0 - local.get 3 - i32.store - end - ) - (func $core::panicking::panic_fmt (;13;) (type 9) (param i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 32 - i32.sub - local.tee 2 - global.set $__stack_pointer - local.get 2 - i32.const 16 - i32.add - local.get 0 - i32.const 16 - i32.add - i64.load align=4 - i64.store - local.get 2 - i32.const 8 - i32.add - local.get 0 - i32.const 8 - i32.add - i64.load align=4 - i64.store - local.get 2 - i32.const 1 - i32.store16 offset=28 - local.get 2 - local.get 1 - i32.store offset=24 - local.get 2 - local.get 0 - i64.load align=4 - i64.store - local.get 2 - call $rust_begin_unwind - unreachable - ) - (func $core::panicking::panic (;14;) (type 10) (param i32 i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 32 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - i32.const 0 - i32.store offset=16 - local.get 3 - i32.const 1 - i32.store offset=4 - local.get 3 - i64.const 4 - i64.store offset=8 align=4 - local.get 3 - local.get 1 - i32.store offset=28 - local.get 3 - local.get 0 - i32.store offset=24 - local.get 3 - local.get 3 - i32.const 24 - i32.add - i32.store - local.get 3 - local.get 2 - call $core::panicking::panic_fmt - unreachable - ) - (func $cabi_realloc (;15;) (type 3) (param i32 i32 i32 i32) (result i32) - local.get 0 - local.get 1 - local.get 2 - local.get 3 - call $wit_bindgen_rt::cabi_realloc - ) - (table (;0;) 3 3 funcref) - (memory (;0;) 17) - (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) - (export "memory" (memory 0)) - (export "miden:base/core-types@1.0.0#account-id-from-felt" (func $miden:base/core-types@1.0.0#account-id-from-felt)) - (export "miden:base/types@1.0.0#from-core-asset" (func $miden:base/types@1.0.0#from-core-asset)) - (export "miden:base/types@1.0.0#to-core-asset" (func $miden:base/types@1.0.0#to-core-asset)) - (export "cabi_realloc" (func $cabi_realloc)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $miden_sdk::bindings::__link_custom_section_describing_imports $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00not yet implementedsrc/lib.rs\00\00\00\1b\00\10\00\0a\00\00\00!\00\00\00\09\00\00\00\1b\00\10\00\0a\00\00\00%\00\00\00\09\00\00\00\02\00\00\00") - ) - (core instance (;0;) (instantiate 0)) - (alias core export 0 "memory" (core memory (;0;))) - (alias core export 0 "cabi_realloc" (core func (;0;))) - (type (;0;) (record (field "inner" u64))) - (type (;1;) (record (field "inner" 0))) - (type (;2;) (func (param "felt" 0) (result 1))) - (alias core export 0 "miden:base/core-types@1.0.0#account-id-from-felt" (core func (;1;))) - (func (;0;) (type 2) (canon lift (core func 1))) - (component (;0;) - (type (;0;) (record (field "inner" u64))) - (import "import-type-felt" (type (;1;) (eq 0))) - (type (;2;) (record (field "inner" 1))) - (import "import-type-account-id" (type (;3;) (eq 2))) - (type (;4;) (func (param "felt" 1) (result 3))) - (import "import-func-account-id-from-felt" (func (;0;) (type 4))) - (type (;5;) (record (field "inner" u64))) - (export (;6;) "felt" (type 5)) - (type (;7;) (tuple 6 6 6 6)) - (export (;8;) "word" (type 7)) - (type (;9;) (record (field "inner" 6))) - (export (;10;) "account-id" (type 9)) - (type (;11;) (record (field "inner" 8))) - (export (;12;) "recipient" (type 11)) - (type (;13;) (record (field "inner" 6))) - (export (;14;) "tag" (type 13)) - (type (;15;) (record (field "inner" 8))) - (export (;16;) "core-asset" (type 15)) - (type (;17;) (record (field "inner" 6))) - (export (;18;) "nonce" (type 17)) - (type (;19;) (record (field "inner" 8))) - (export (;20;) "account-hash" (type 19)) - (type (;21;) (record (field "inner" 8))) - (export (;22;) "block-hash" (type 21)) - (type (;23;) (record (field "inner" 8))) - (export (;24;) "storage-value" (type 23)) - (type (;25;) (record (field "inner" 8))) - (export (;26;) "storage-root" (type 25)) - (type (;27;) (record (field "inner" 8))) - (export (;28;) "account-code-root" (type 27)) - (type (;29;) (record (field "inner" 8))) - (export (;30;) "vault-commitment" (type 29)) - (type (;31;) (record (field "inner" 6))) - (export (;32;) "note-id" (type 31)) - (type (;33;) (func (param "felt" 6) (result 10))) - (export (;1;) "account-id-from-felt" (func 0) (func (type 33))) - ) - (instance (;0;) (instantiate 0 - (with "import-func-account-id-from-felt" (func 0)) - (with "import-type-felt" (type 0)) - (with "import-type-account-id" (type 1)) - ) - ) - (export (;1;) "miden:base/core-types@1.0.0" (instance 0)) - (alias export 1 "core-asset" (type (;3;))) - (alias export 1 "account-id" (type (;4;))) - (type (;5;) (record (field "asset" 4) (field "amount" u64))) - (alias export 1 "word" (type (;6;))) - (type (;7;) (record (field "inner" 6))) - (type (;8;) (variant (case "fungible" 5) (case "non-fungible" 7))) - (type (;9;) (func (param "core-asset" 3) (result 8))) - (alias core export 0 "miden:base/types@1.0.0#from-core-asset" (core func (;2;))) - (func (;1;) (type 9) (canon lift (core func 2) (memory 0))) - (type (;10;) (func (param "asset" 8) (result 3))) - (alias core export 0 "miden:base/types@1.0.0#to-core-asset" (core func (;3;))) - (func (;2;) (type 10) (canon lift (core func 3) (memory 0))) - (alias export 1 "felt" (type (;11;))) - (component (;1;) - (type (;0;) (record (field "inner" u64))) - (import "import-type-felt" (type (;1;) (eq 0))) - (type (;2;) (record (field "inner" 1))) - (import "import-type-account-id" (type (;3;) (eq 2))) - (type (;4;) (tuple 1 1 1 1)) - (import "import-type-word" (type (;5;) (eq 4))) - (type (;6;) (record (field "inner" 5))) - (import "import-type-core-asset" (type (;7;) (eq 6))) - (import "import-type-core-asset0" (type (;8;) (eq 7))) - (import "import-type-account-id0" (type (;9;) (eq 3))) - (type (;10;) (record (field "asset" 9) (field "amount" u64))) - (import "import-type-fungible-asset" (type (;11;) (eq 10))) - (import "import-type-word0" (type (;12;) (eq 5))) - (type (;13;) (record (field "inner" 12))) - (import "import-type-non-fungible-asset" (type (;14;) (eq 13))) - (type (;15;) (variant (case "fungible" 11) (case "non-fungible" 14))) - (import "import-type-asset" (type (;16;) (eq 15))) - (type (;17;) (func (param "core-asset" 8) (result 16))) - (import "import-func-from-core-asset" (func (;0;) (type 17))) - (type (;18;) (func (param "asset" 16) (result 8))) - (import "import-func-to-core-asset" (func (;1;) (type 18))) - (export (;19;) "felt" (type 1)) - (export (;20;) "account-id" (type 3)) - (export (;21;) "word" (type 5)) - (export (;22;) "core-asset" (type 7)) - (type (;23;) (record (field "asset" 20) (field "amount" u64))) - (export (;24;) "fungible-asset" (type 23)) - (type (;25;) (record (field "inner" 21))) - (export (;26;) "non-fungible-asset" (type 25)) - (type (;27;) (variant (case "fungible" 24) (case "non-fungible" 26))) - (export (;28;) "asset" (type 27)) - (type (;29;) (func (param "core-asset" 22) (result 28))) - (export (;2;) "from-core-asset" (func 0) (func (type 29))) - (type (;30;) (func (param "asset" 28) (result 22))) - (export (;3;) "to-core-asset" (func 1) (func (type 30))) - ) - (instance (;2;) (instantiate 1 - (with "import-func-from-core-asset" (func 1)) - (with "import-func-to-core-asset" (func 2)) - (with "import-type-felt" (type 11)) - (with "import-type-account-id" (type 4)) - (with "import-type-word" (type 6)) - (with "import-type-core-asset" (type 3)) - (with "import-type-core-asset0" (type 3)) - (with "import-type-account-id0" (type 4)) - (with "import-type-fungible-asset" (type 5)) - (with "import-type-word0" (type 6)) - (with "import-type-non-fungible-asset" (type 7)) - (with "import-type-asset" (type 8)) - ) - ) - (export (;3;) "miden:base/types@1.0.0" (instance 2)) -) \ No newline at end of file diff --git a/tests/integration/src/compiler_test.rs b/tests/integration/src/compiler_test.rs index cef475638..3677228f0 100644 --- a/tests/integration/src/compiler_test.rs +++ b/tests/integration/src/compiler_test.rs @@ -162,8 +162,6 @@ impl RustcTest { pub enum CompilerTestInputType { /// A project that uses `cargo miden build` to produce a Wasm module to use as input CargoMiden(CargoTest), - /// A project that uses `cargo component build` to produce a Wasm module to use as input - CargoComponent(CargoTest), /// A project that uses `cargo build` to produce a core Wasm module to use as input Cargo(CargoTest), /// A project that uses `rustc` to produce a core Wasm module to use as input @@ -224,13 +222,11 @@ impl CompilerTestBuilder { }; let entrypoint = match source { CompilerTestInputType::Cargo(ref mut config) => config.entrypoint.take(), - CompilerTestInputType::CargoComponent(ref mut config) => config.entrypoint.take(), CompilerTestInputType::Rustc(_) => Some("__main".into()), CompilerTestInputType::CargoMiden(ref mut config) => config.entrypoint.take(), }; let name = match source { CompilerTestInputType::Cargo(ref mut config) => config.name.as_ref(), - CompilerTestInputType::CargoComponent(ref mut config) => config.name.as_ref(), CompilerTestInputType::Rustc(ref mut config) => config.name.as_ref(), CompilerTestInputType::CargoMiden(ref mut config) => config.name.as_ref(), }; @@ -338,11 +334,6 @@ impl CompilerTestBuilder { cmd.arg("miden").arg("build"); cmd } - CompilerTestInputType::CargoComponent(_) => { - let mut cmd = Command::new("cargo"); - cmd.arg("component").arg("build"); - cmd - } CompilerTestInputType::Cargo(_) => { let mut cmd = Command::new("cargo"); cmd.arg("build"); @@ -356,9 +347,6 @@ impl CompilerTestBuilder { CompilerTestInputType::CargoMiden(CargoTest { ref project_dir, .. }) - | CompilerTestInputType::CargoComponent(CargoTest { - ref project_dir, .. - }) | CompilerTestInputType::Cargo(CargoTest { ref project_dir, .. }) => Cow::Borrowed(project_dir.as_path()), @@ -379,12 +367,6 @@ impl CompilerTestBuilder { .arg("--target") .arg(config.target.as_ref()); } - CompilerTestInputType::CargoComponent(_) => { - let manifest_path = project_dir.join("Cargo.toml"); - command.arg("--manifest-path").arg(manifest_path).arg("--release"); - // Render Cargo output as JSON - command.arg("--message-format=json-render-diagnostics"); - } CompilerTestInputType::Cargo(ref config) => { let manifest_path = project_dir.join("Cargo.toml"); @@ -473,49 +455,7 @@ impl CompilerTestBuilder { ..Default::default() } } - CompilerTestInputType::CargoComponent(_) => { - let mut child = command.spawn().unwrap_or_else(|_| { - panic!( - "Failed to execute command: {}", - command - .get_args() - .map(|arg| format!("'{}'", arg.to_str().unwrap())) - .collect::>() - .join(" ") - ) - }); - - let wasm_artifacts = find_wasm_artifacts(&mut child); - let output = child.wait().expect("Couldn't get cargo's exit status"); - if !output.success() { - report_cargo_error(child); - } - assert!(output.success()); - assert_eq!(wasm_artifacts.len(), 1, "Expected one Wasm artifact"); - let wasm_comp_path = &wasm_artifacts.first().unwrap(); - let artifact_name = - wasm_comp_path.file_stem().unwrap().to_str().unwrap().to_string(); - let input_file = InputFile::from_path(wasm_comp_path).unwrap(); - let mut inputs = vec![input_file]; - inputs.extend(self.link_masm_modules.into_iter().map(|(path, content)| { - let path = path.to_string(); - InputFile::new( - midenc_session::FileType::Masm, - InputType::Stdin { - name: path.into(), - input: content.into_bytes(), - }, - ) - })); - CompilerTest { - config: self.config, - session: default_session(inputs, &self.midenc_flags), - artifact_name: artifact_name.into(), - entrypoint: self.entrypoint, - ..Default::default() - } - } CompilerTestInputType::Cargo(config) => { let expected_wasm_artifact_path = config.wasm_artifact_path(); let skip_rust_compilation = @@ -630,23 +570,6 @@ impl CompilerTestBuilder { /// Convenience builders impl CompilerTestBuilder { - /// Compile the Wasm component from a Rust Cargo project using cargo-component - pub fn rust_source_cargo_component( - cargo_project_folder: impl AsRef, - config: WasmTranslationConfig, - ) -> Self { - let name = cargo_project_folder - .as_ref() - .file_stem() - .map(|name| name.to_string_lossy().into_owned()) - .unwrap_or("".to_string()); - let mut builder = CompilerTestBuilder::new(CompilerTestInputType::CargoComponent( - CargoTest::new(name, cargo_project_folder.as_ref().to_path_buf()), - )); - builder.with_wasm_translation_config(config); - builder - } - /// Compile the Rust project using cargo-miden pub fn rust_source_cargo_miden( cargo_project_folder: impl AsRef, @@ -1010,14 +933,6 @@ impl CompilerTest { self.artifact_name.as_ref() } - /// Compile the Wasm component from a Rust Cargo project using cargo-component - pub fn rust_source_cargo_component( - cargo_project_folder: impl AsRef, - config: WasmTranslationConfig, - ) -> Self { - CompilerTestBuilder::rust_source_cargo_component(cargo_project_folder, config).build() - } - /// Compile the Rust project using cargo-miden pub fn rust_source_cargo_miden( cargo_project_folder: impl AsRef, diff --git a/tests/integration/src/rust_masm_tests/mod.rs b/tests/integration/src/rust_masm_tests/mod.rs index ea7c66ea8..4089cfce9 100644 --- a/tests/integration/src/rust_masm_tests/mod.rs +++ b/tests/integration/src/rust_masm_tests/mod.rs @@ -12,12 +12,10 @@ use crate::execute_emulator; mod abi_transform; mod apps; -mod components; mod instructions; mod intrinsics; mod rust_sdk; mod types; -mod wit_sdk; pub fn run_masm_vs_rust( rust_out: T, diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock b/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock deleted file mode 100644 index e48ef9474..000000000 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock +++ /dev/null @@ -1,69 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "basic-wallet" -version = "0.0.0" -dependencies = [ - "wee_alloc", - "wit-bindgen-rt", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "wit-bindgen-rt" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a37bd9274cb2d4754b915d624447ec0dce9105d174361841c0826efc79ceb9" diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.toml b/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.toml deleted file mode 100644 index 736b46881..000000000 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.toml +++ /dev/null @@ -1,31 +0,0 @@ -[package] -name = "basic-wallet" -version = "0.0.0" -rust-version = "1.71" -authors = ["Miden contributors"] -description = "Basic wallet" -repository = "https://github.com/0xPolygonMiden/miden-ir" -homepage = "https://github.com/0xPolygonMiden/miden-ir" -documentation = "https://github.com/0xPolygonMiden/miden-ir" -license = "MIT" -edition = "2021" -publish = false - -[dependencies] -wit-bindgen-rt = "0.28" -wee_alloc = { version = "0.4.5", default-features = false } - -[lib] -crate-type = ["cdylib"] - -[package.metadata.component] -package = "miden:basic-wallet" - -[package.metadata.component.dependencies] - -[package.metadata.component.target.dependencies] -"miden:base" = { path = "../sdk/wit" } - -[profile.release] -panic = "abort" -debug = true diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs deleted file mode 100644 index c81aa3024..000000000 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs +++ /dev/null @@ -1,1374 +0,0 @@ -#[allow(dead_code)] -pub mod miden { - #[allow(dead_code)] - pub mod base { - #[allow(dead_code, clippy::all)] - pub mod core_types { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - /// Represents base field element in the field using Montgomery representation. - /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the range [0, M). - /// Field modulus M = 2^64 - 2^32 + 1 - #[repr(C)] - #[derive(Clone, Copy)] - pub struct Felt { - /// We plan to use f64 as the backing type for the field element. It has the size that we need and - /// we don't plan to support floating point arithmetic in programs for Miden VM. - /// - /// For now its u64 - pub inner: u64, - } - impl ::core::fmt::Debug for Felt { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Felt").field("inner", &self.inner).finish() - } - } - /// A group of four field elements in the Miden base field. - pub type Word = (Felt, Felt, Felt, Felt); - /// Unique identifier of an account. - /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a - /// single account and also specifies the type of the underlying account. Specifically: - /// - The two most significant bits of the ID specify the type of the account: - /// - 00 - regular account with updatable code. - /// - 01 - regular account with immutable code. - /// - 10 - fungible asset faucet with immutable code. - /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: - /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. - /// As such the three most significant bits fully describes the type of the account. - #[repr(C)] - #[derive(Clone, Copy)] - pub struct AccountId { - pub inner: Felt, - } - impl ::core::fmt::Debug for AccountId { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountId").field("inner", &self.inner).finish() - } - } - /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), input_hash) - #[repr(C)] - #[derive(Clone, Copy)] - pub struct Recipient { - pub inner: Word, - } - impl ::core::fmt::Debug for Recipient { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Recipient").field("inner", &self.inner).finish() - } - } - #[repr(C)] - #[derive(Clone, Copy)] - pub struct Tag { - pub inner: Felt, - } - impl ::core::fmt::Debug for Tag { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Tag").field("inner", &self.inner).finish() - } - } - /// A fungible or a non-fungible asset. - /// - /// All assets are encoded using a single word (4 elements) such that it is easy to determine the - /// type of an asset both inside and outside Miden VM. Specifically: - /// Element 1 will be: - /// - ZERO for a fungible asset - /// - non-ZERO for a non-fungible asset - /// The most significant bit will be: - /// - ONE for a fungible asset - /// - ZERO for a non-fungible asset - /// - /// The above properties guarantee that there can never be a collision between a fungible and a - /// non-fungible asset. - /// - /// The methodology for constructing fungible and non-fungible assets is described below. - /// - /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet which issued - /// the asset. This guarantees the properties described above (the first bit is ONE). - /// - /// The least significant element is set to the amount of the asset. This amount cannot be greater - /// than 2^63 - 1 and thus requires 63-bits to store. - /// - /// Elements 1 and 2 are set to ZERO. - /// - /// It is impossible to find a collision between two fungible assets issued by different faucets as - /// the faucet_id is included in the description of the asset and this is guaranteed to be different - /// for each faucet as per the faucet creation logic. - /// - /// # Non-fungible assets - /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field - /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. - /// - Lastly, the most significant bit of d3 is set to ZERO. - /// - /// It is impossible to find a collision between two non-fungible assets issued by different faucets - /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed - /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets - /// issued by the same faucet is ~2^95. - #[repr(C)] - #[derive(Clone, Copy)] - pub struct CoreAsset { - pub inner: Word, - } - impl ::core::fmt::Debug for CoreAsset { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("CoreAsset").field("inner", &self.inner).finish() - } - } - /// Account nonce - #[repr(C)] - #[derive(Clone, Copy)] - pub struct Nonce { - pub inner: Felt, - } - impl ::core::fmt::Debug for Nonce { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Nonce").field("inner", &self.inner).finish() - } - } - /// Account hash - #[repr(C)] - #[derive(Clone, Copy)] - pub struct AccountHash { - pub inner: Word, - } - impl ::core::fmt::Debug for AccountHash { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountHash").field("inner", &self.inner).finish() - } - } - /// Block hash - #[repr(C)] - #[derive(Clone, Copy)] - pub struct BlockHash { - pub inner: Word, - } - impl ::core::fmt::Debug for BlockHash { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("BlockHash").field("inner", &self.inner).finish() - } - } - /// Storage value - #[repr(C)] - #[derive(Clone, Copy)] - pub struct StorageValue { - pub inner: Word, - } - impl ::core::fmt::Debug for StorageValue { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("StorageValue").field("inner", &self.inner).finish() - } - } - /// Account storage root - #[repr(C)] - #[derive(Clone, Copy)] - pub struct StorageRoot { - pub inner: Word, - } - impl ::core::fmt::Debug for StorageRoot { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("StorageRoot").field("inner", &self.inner).finish() - } - } - /// Account code root - #[repr(C)] - #[derive(Clone, Copy)] - pub struct AccountCodeRoot { - pub inner: Word, - } - impl ::core::fmt::Debug for AccountCodeRoot { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountCodeRoot") - .field("inner", &self.inner) - .finish() - } - } - /// Commitment to the account vault - #[repr(C)] - #[derive(Clone, Copy)] - pub struct VaultCommitment { - pub inner: Word, - } - impl ::core::fmt::Debug for VaultCommitment { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("VaultCommitment") - .field("inner", &self.inner) - .finish() - } - } - /// An id of the created note - #[repr(C)] - #[derive(Clone, Copy)] - pub struct NoteId { - pub inner: Felt, - } - impl ::core::fmt::Debug for NoteId { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("NoteId").field("inner", &self.inner).finish() - } - } - #[allow(unused_unsafe, clippy::all)] - /// Creates a new account ID from a field element. - pub fn account_id_from_felt(felt: Felt) -> AccountId { - unsafe { - let Felt { inner: inner0 } = felt; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/core-types@1.0.0")] - extern "C" { - #[link_name = "account-id-from-felt"] - fn wit_import(_: i64) -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i64 { - unreachable!() - } - let ret = wit_import(_rt::as_i64(inner0)); - AccountId { - inner: Felt { inner: ret as u64 }, - } - } - } - } - #[allow(dead_code, clippy::all)] - pub mod account { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - pub type Felt = super::super::super::miden::base::core_types::Felt; - pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; - pub type AccountId = super::super::super::miden::base::core_types::AccountId; - pub type Nonce = super::super::super::miden::base::core_types::Nonce; - pub type AccountHash = super::super::super::miden::base::core_types::AccountHash; - pub type StorageValue = super::super::super::miden::base::core_types::StorageValue; - pub type StorageRoot = super::super::super::miden::base::core_types::StorageRoot; - pub type AccountCodeRoot = super::super::super::miden::base::core_types::AccountCodeRoot; - pub type VaultCommitment = super::super::super::miden::base::core_types::VaultCommitment; - #[allow(unused_unsafe, clippy::all)] - /// Get the id of the currently executing account - pub fn get_id() -> AccountId { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-id"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::AccountId { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Return the account nonce - pub fn get_nonce() -> Nonce { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-nonce"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::Nonce { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the initial hash of the currently executing account - pub fn get_initial_hash() -> AccountHash { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-initial-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::AccountHash { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the current hash of the account data stored in memory - pub fn get_current_hash() -> AccountHash { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-current-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::AccountHash { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Increment the account nonce by the specified value. - /// value can be at most 2^32 - 1 otherwise this procedure panics - pub fn incr_nonce(value: Felt) { - unsafe { - let super::super::super::miden::base::core_types::Felt { - inner: inner0, - } = value; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "incr-nonce"] - fn wit_import(_: i64); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) { - unreachable!() - } - wit_import(_rt::as_i64(inner0)); - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the value of the specified key in the account storage - pub fn get_item(index: Felt) -> StorageValue { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::Felt { - inner: inner0, - } = index; - let ptr1 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-item"] - fn wit_import(_: i64, _: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: *mut u8) { - unreachable!() - } - wit_import(_rt::as_i64(inner0), ptr1); - let l2 = *ptr1.add(0).cast::(); - let l3 = *ptr1.add(8).cast::(); - let l4 = *ptr1.add(16).cast::(); - let l5 = *ptr1.add(24).cast::(); - super::super::super::miden::base::core_types::StorageValue { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l5 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Set the value of the specified key in the account storage - /// Returns the old value of the key and the new storage root - pub fn set_item( - index: Felt, - value: StorageValue, - ) -> (StorageRoot, StorageValue) { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 64]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 64]); - let super::super::super::miden::base::core_types::Felt { - inner: inner0, - } = index; - let super::super::super::miden::base::core_types::StorageValue { - inner: inner1, - } = value; - let (t2_0, t2_1, t2_2, t2_3) = inner1; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t2_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t2_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t2_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner6, - } = t2_3; - let ptr7 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "set-item"] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: *mut u8, - ); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: *mut u8) { - unreachable!() - } - wit_import( - _rt::as_i64(inner0), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - _rt::as_i64(inner6), - ptr7, - ); - let l8 = *ptr7.add(0).cast::(); - let l9 = *ptr7.add(8).cast::(); - let l10 = *ptr7.add(16).cast::(); - let l11 = *ptr7.add(24).cast::(); - let l12 = *ptr7.add(32).cast::(); - let l13 = *ptr7.add(40).cast::(); - let l14 = *ptr7.add(48).cast::(); - let l15 = *ptr7.add(56).cast::(); - ( - super::super::super::miden::base::core_types::StorageRoot { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l8 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l9 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l10 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l11 as u64, - }, - ), - }, - super::super::super::miden::base::core_types::StorageValue { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l12 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l13 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l14 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l15 as u64, - }, - ), - }, - ) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Sets the code of the account the transaction is being executed against. - /// This procedure can only be executed on regular accounts with updatable - /// code. Otherwise, this procedure fails. code is the hash of the code - /// to set. - pub fn set_code(code_root: AccountCodeRoot) { - unsafe { - let super::super::super::miden::base::core_types::AccountCodeRoot { - inner: inner0, - } = code_root; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "set-code"] - fn wit_import(_: i64, _: i64, _: i64, _: i64); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ); - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the balance of a fungible asset associated with a account_id. - /// Panics if the asset is not a fungible asset. account_id is the faucet id - /// of the fungible asset of interest. balance is the vault balance of the - /// fungible asset. - pub fn get_balance(account_id: AccountId) -> Felt { - unsafe { - let super::super::super::miden::base::core_types::AccountId { - inner: inner0, - } = account_id; - let super::super::super::miden::base::core_types::Felt { - inner: inner1, - } = inner0; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-balance"] - fn wit_import(_: i64) -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i64 { - unreachable!() - } - let ret = wit_import(_rt::as_i64(inner1)); - super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns a boolean indicating whether the non-fungible asset is present - /// in the vault. Panics if the asset is a fungible asset. asset is the - /// non-fungible asset of interest. has_asset is a boolean indicating - /// whether the account vault has the asset of interest. - pub fn has_non_fungible_asset(asset: CoreAsset) -> bool { - unsafe { - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "has-non-fungible-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32 { - unreachable!() - } - let ret = wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ); - _rt::bool_lift(ret as u8) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Add the specified asset to the vault. Panics under various conditions. - /// Returns the final asset in the account vault defined as follows: If asset is - /// a non-fungible asset, then returns the same as asset. If asset is a - /// fungible asset, then returns the total fungible asset in the account - /// vault after asset was added to it. - pub fn add_asset(asset: CoreAsset) -> CoreAsset { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let ptr6 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "add-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ptr6, - ); - let l7 = *ptr6.add(0).cast::(); - let l8 = *ptr6.add(8).cast::(); - let l9 = *ptr6.add(16).cast::(); - let l10 = *ptr6.add(24).cast::(); - super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l7 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l8 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l9 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l10 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Remove the specified asset from the vault - pub fn remove_asset(asset: CoreAsset) -> CoreAsset { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let ptr6 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "remove-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ptr6, - ); - let l7 = *ptr6.add(0).cast::(); - let l8 = *ptr6.add(8).cast::(); - let l9 = *ptr6.add(16).cast::(); - let l10 = *ptr6.add(24).cast::(); - super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l7 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l8 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l9 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l10 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the commitment to the account vault. - pub fn get_vault_commitment() -> VaultCommitment { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-vault-commitment"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::VaultCommitment { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - } - #[allow(dead_code, clippy::all)] - pub mod tx { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - pub type Felt = super::super::super::miden::base::core_types::Felt; - pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; - pub type Tag = super::super::super::miden::base::core_types::Tag; - pub type Recipient = super::super::super::miden::base::core_types::Recipient; - pub type BlockHash = super::super::super::miden::base::core_types::BlockHash; - pub type Word = super::super::super::miden::base::core_types::Word; - pub type NoteId = super::super::super::miden::base::core_types::NoteId; - #[allow(unused_unsafe, clippy::all)] - /// Returns the block number of the last known block at the time of transaction execution. - pub fn get_block_number() -> Felt { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-block-number"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the block hash of the last known block at the time of transaction execution. - pub fn get_block_hash() -> BlockHash { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-block-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::BlockHash { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the input notes hash. This is computed as a sequential hash of - /// (nullifier, script_root) tuples over all input notes. - pub fn get_input_notes_hash() -> Word { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-input-notes-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the output notes hash. This is computed as a sequential hash of - /// (note_hash, note_metadata) tuples over all output notes. - pub fn get_output_notes_hash() -> Word { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-output-notes-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Creates a new note. - /// asset is the asset to be included in the note. - /// tag is the tag to be included in the note. - /// recipient is the recipient of the note. - /// Returns the id of the created note. - pub fn create_note( - asset: CoreAsset, - tag: Tag, - recipient: Recipient, - ) -> NoteId { - unsafe { - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let super::super::super::miden::base::core_types::Tag { - inner: inner6, - } = tag; - let super::super::super::miden::base::core_types::Felt { - inner: inner7, - } = inner6; - let super::super::super::miden::base::core_types::Recipient { - inner: inner8, - } = recipient; - let (t9_0, t9_1, t9_2, t9_3) = inner8; - let super::super::super::miden::base::core_types::Felt { - inner: inner10, - } = t9_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner11, - } = t9_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner12, - } = t9_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner13, - } = t9_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "create-note"] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - ) -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - ) -> i64 { - unreachable!() - } - let ret = wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - _rt::as_i64(inner7), - _rt::as_i64(inner10), - _rt::as_i64(inner11), - _rt::as_i64(inner12), - _rt::as_i64(inner13), - ); - super::super::super::miden::base::core_types::NoteId { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - } - } -} -#[allow(dead_code)] -pub mod exports { - #[allow(dead_code)] - pub mod miden { - #[allow(dead_code)] - pub mod basic_wallet { - #[allow(dead_code, clippy::all)] - pub mod basic_wallet { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; - use super::super::super::super::_rt; - pub type CoreAsset = super::super::super::super::miden::base::core_types::CoreAsset; - pub type Tag = super::super::super::super::miden::base::core_types::Tag; - pub type Recipient = super::super::super::super::miden::base::core_types::Recipient; - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_receive_asset_cabi( - arg0: i64, - arg1: i64, - arg2: i64, - arg3: i64, - ) { - #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); - T::receive_asset(super::super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::super::miden::base::core_types::Felt { - inner: arg0 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg1 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg2 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg3 as u64, - }, - ), - }); - } - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_send_asset_cabi( - arg0: i64, - arg1: i64, - arg2: i64, - arg3: i64, - arg4: i64, - arg5: i64, - arg6: i64, - arg7: i64, - arg8: i64, - ) { - #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); - T::send_asset( - super::super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::super::miden::base::core_types::Felt { - inner: arg0 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg1 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg2 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg3 as u64, - }, - ), - }, - super::super::super::super::miden::base::core_types::Tag { - inner: super::super::super::super::miden::base::core_types::Felt { - inner: arg4 as u64, - }, - }, - super::super::super::super::miden::base::core_types::Recipient { - inner: ( - super::super::super::super::miden::base::core_types::Felt { - inner: arg5 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg6 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg7 as u64, - }, - super::super::super::super::miden::base::core_types::Felt { - inner: arg8 as u64, - }, - ), - }, - ); - } - pub trait Guest { - fn receive_asset(core_asset: CoreAsset); - fn send_asset(core_asset: CoreAsset, tag: Tag, recipient: Recipient); - } - #[doc(hidden)] - macro_rules! __export_miden_basic_wallet_basic_wallet_1_0_0_cabi { - ($ty:ident with_types_in $($path_to_types:tt)*) => { - const _ : () = { #[export_name = - "miden:basic-wallet/basic-wallet@1.0.0#receive-asset"] unsafe - extern "C" fn export_receive_asset(arg0 : i64, arg1 : i64, arg2 : - i64, arg3 : i64,) { $($path_to_types)*:: - _export_receive_asset_cabi::<$ty > (arg0, arg1, arg2, arg3) } - #[export_name = - "miden:basic-wallet/basic-wallet@1.0.0#send-asset"] unsafe extern - "C" fn export_send_asset(arg0 : i64, arg1 : i64, arg2 : i64, arg3 - : i64, arg4 : i64, arg5 : i64, arg6 : i64, arg7 : i64, arg8 : - i64,) { $($path_to_types)*:: _export_send_asset_cabi::<$ty > - (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } }; - }; - } - #[doc(hidden)] - pub(crate) use __export_miden_basic_wallet_basic_wallet_1_0_0_cabi; - } - } - } -} -mod _rt { - pub fn as_i64(t: T) -> i64 { - t.as_i64() - } - pub trait AsI64 { - fn as_i64(self) -> i64; - } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { - fn as_i64(self) -> i64 { - (*self).as_i64() - } - } - impl AsI64 for i64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - impl AsI64 for u64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - pub unsafe fn bool_lift(val: u8) -> bool { - if cfg!(debug_assertions) { - match val { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } else { - val != 0 - } - } - #[cfg(target_arch = "wasm32")] - pub fn run_ctors_once() { - wit_bindgen_rt::run_ctors_once(); - } -} -/// Generates `#[no_mangle]` functions to export the specified type as the -/// root implementation of all generated traits. -/// -/// For more information see the documentation of `wit_bindgen::generate!`. -/// -/// ```rust -/// # macro_rules! export{ ($($t:tt)*) => (); } -/// # trait Guest {} -/// struct MyType; -/// -/// impl Guest for MyType { -/// // ... -/// } -/// -/// export!(MyType); -/// ``` -#[allow(unused_macros)] -#[doc(hidden)] -macro_rules! __export_basic_wallet_world_impl { - ($ty:ident) => { - self::export!($ty with_types_in self); - }; - ($ty:ident with_types_in $($path_to_types_root:tt)*) => { - $($path_to_types_root)*:: - exports::miden::basic_wallet::basic_wallet::__export_miden_basic_wallet_basic_wallet_1_0_0_cabi!($ty - with_types_in $($path_to_types_root)*:: - exports::miden::basic_wallet::basic_wallet); - }; -} -#[doc(inline)] -pub(crate) use __export_basic_wallet_world_impl as export; -#[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.30.0:basic-wallet-world:encoded world"] -#[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2072] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x8f\x0f\x01A\x02\x01\ -A\x16\x01B\x1e\x01r\x01\x05innerw\x04\0\x04felt\x03\0\0\x01o\x04\x01\x01\x01\x01\ -\x04\0\x04word\x03\0\x02\x01r\x01\x05inner\x01\x04\0\x0aaccount-id\x03\0\x04\x01\ -r\x01\x05inner\x03\x04\0\x09recipient\x03\0\x06\x01r\x01\x05inner\x01\x04\0\x03t\ -ag\x03\0\x08\x01r\x01\x05inner\x03\x04\0\x0acore-asset\x03\0\x0a\x01r\x01\x05inn\ -er\x01\x04\0\x05nonce\x03\0\x0c\x01r\x01\x05inner\x03\x04\0\x0caccount-hash\x03\0\ -\x0e\x01r\x01\x05inner\x03\x04\0\x0ablock-hash\x03\0\x10\x01r\x01\x05inner\x03\x04\ -\0\x0dstorage-value\x03\0\x12\x01r\x01\x05inner\x03\x04\0\x0cstorage-root\x03\0\x14\ -\x01r\x01\x05inner\x03\x04\0\x11account-code-root\x03\0\x16\x01r\x01\x05inner\x03\ -\x04\0\x10vault-commitment\x03\0\x18\x01r\x01\x05inner\x01\x04\0\x07note-id\x03\0\ -\x1a\x01@\x01\x04felt\x01\0\x05\x04\0\x14account-id-from-felt\x01\x1c\x03\x01\x1b\ -miden:base/core-types@1.0.0\x05\0\x02\x03\0\0\x04felt\x02\x03\0\0\x0acore-asset\x02\ -\x03\0\0\x03tag\x02\x03\0\0\x09recipient\x02\x03\0\0\x0aaccount-id\x02\x03\0\0\x05\ -nonce\x02\x03\0\0\x0caccount-hash\x02\x03\0\0\x0dstorage-value\x02\x03\0\0\x0cst\ -orage-root\x02\x03\0\0\x11account-code-root\x02\x03\0\0\x10vault-commitment\x01B\ -/\x02\x03\x02\x01\x01\x04\0\x04felt\x03\0\0\x02\x03\x02\x01\x02\x04\0\x0acore-as\ -set\x03\0\x02\x02\x03\x02\x01\x03\x04\0\x03tag\x03\0\x04\x02\x03\x02\x01\x04\x04\ -\0\x09recipient\x03\0\x06\x02\x03\x02\x01\x05\x04\0\x0aaccount-id\x03\0\x08\x02\x03\ -\x02\x01\x06\x04\0\x05nonce\x03\0\x0a\x02\x03\x02\x01\x07\x04\0\x0caccount-hash\x03\ -\0\x0c\x02\x03\x02\x01\x08\x04\0\x0dstorage-value\x03\0\x0e\x02\x03\x02\x01\x09\x04\ -\0\x0cstorage-root\x03\0\x10\x02\x03\x02\x01\x0a\x04\0\x11account-code-root\x03\0\ -\x12\x02\x03\x02\x01\x0b\x04\0\x10vault-commitment\x03\0\x14\x01@\0\0\x09\x04\0\x06\ -get-id\x01\x16\x01@\0\0\x0b\x04\0\x09get-nonce\x01\x17\x01@\0\0\x0d\x04\0\x10get\ --initial-hash\x01\x18\x04\0\x10get-current-hash\x01\x18\x01@\x01\x05value\x01\x01\ -\0\x04\0\x0aincr-nonce\x01\x19\x01@\x01\x05index\x01\0\x0f\x04\0\x08get-item\x01\ -\x1a\x01o\x02\x11\x0f\x01@\x02\x05index\x01\x05value\x0f\0\x1b\x04\0\x08set-item\ -\x01\x1c\x01@\x01\x09code-root\x13\x01\0\x04\0\x08set-code\x01\x1d\x01@\x01\x0aa\ -ccount-id\x09\0\x01\x04\0\x0bget-balance\x01\x1e\x01@\x01\x05asset\x03\0\x7f\x04\ -\0\x16has-non-fungible-asset\x01\x1f\x01@\x01\x05asset\x03\0\x03\x04\0\x09add-as\ -set\x01\x20\x04\0\x0cremove-asset\x01\x20\x01@\0\0\x15\x04\0\x14get-vault-commit\ -ment\x01!\x03\x01\x18miden:base/account@1.0.0\x05\x0c\x02\x03\0\0\x0ablock-hash\x02\ -\x03\0\0\x04word\x02\x03\0\0\x07note-id\x01B%\x02\x03\x02\x01\x01\x04\0\x04felt\x03\ -\0\0\x02\x03\x02\x01\x02\x04\0\x0acore-asset\x03\0\x02\x02\x03\x02\x01\x03\x04\0\ -\x03tag\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x09recipient\x03\0\x06\x02\x03\x02\x01\ -\x05\x04\0\x0aaccount-id\x03\0\x08\x02\x03\x02\x01\x06\x04\0\x05nonce\x03\0\x0a\x02\ -\x03\x02\x01\x07\x04\0\x0caccount-hash\x03\0\x0c\x02\x03\x02\x01\x08\x04\0\x0dst\ -orage-value\x03\0\x0e\x02\x03\x02\x01\x09\x04\0\x0cstorage-root\x03\0\x10\x02\x03\ -\x02\x01\x0a\x04\0\x11account-code-root\x03\0\x12\x02\x03\x02\x01\x0b\x04\0\x10v\ -ault-commitment\x03\0\x14\x02\x03\x02\x01\x0d\x04\0\x0ablock-hash\x03\0\x16\x02\x03\ -\x02\x01\x0e\x04\0\x04word\x03\0\x18\x02\x03\x02\x01\x0f\x04\0\x07note-id\x03\0\x1a\ -\x01@\0\0\x01\x04\0\x10get-block-number\x01\x1c\x01@\0\0\x17\x04\0\x0eget-block-\ -hash\x01\x1d\x01@\0\0\x19\x04\0\x14get-input-notes-hash\x01\x1e\x04\0\x15get-out\ -put-notes-hash\x01\x1e\x01@\x03\x05asset\x03\x03tag\x05\x09recipient\x07\0\x1b\x04\ -\0\x0bcreate-note\x01\x1f\x03\x01\x13miden:base/tx@1.0.0\x05\x10\x01B\x0a\x02\x03\ -\x02\x01\x02\x04\0\x0acore-asset\x03\0\0\x02\x03\x02\x01\x03\x04\0\x03tag\x03\0\x02\ -\x02\x03\x02\x01\x04\x04\0\x09recipient\x03\0\x04\x01@\x01\x0acore-asset\x01\x01\ -\0\x04\0\x0dreceive-asset\x01\x06\x01@\x03\x0acore-asset\x01\x03tag\x03\x09recip\ -ient\x05\x01\0\x04\0\x0asend-asset\x01\x07\x04\x01%miden:basic-wallet/basic-wall\ -et@1.0.0\x05\x11\x04\x01+miden:basic-wallet/basic-wallet-world@1.0.0\x04\0\x0b\x18\ -\x01\0\x12basic-wallet-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0d\ -wit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; -#[inline(never)] -#[doc(hidden)] -pub fn __link_custom_section_describing_imports() { - wit_bindgen_rt::maybe_link_cabi_realloc(); -} diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/lib.rs b/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/lib.rs deleted file mode 100644 index 0b83b2c95..000000000 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/lib.rs +++ /dev/null @@ -1,35 +0,0 @@ -#![no_std] - -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - -#[panic_handler] -fn my_panic(_info: &core::panic::PanicInfo) -> ! { - loop {} -} - -bindings::export!(Component with_types_in bindings); - -#[allow(dead_code)] -mod bindings; - -use bindings::{ - exports::miden::basic_wallet::basic_wallet::{CoreAsset, Guest, Recipient, Tag}, - miden::base::{ - account::{add_asset, remove_asset}, - tx::create_note, - }, -}; - -struct Component; - -impl Guest for Component { - fn receive_asset(asset: CoreAsset) { - add_asset(asset); - } - - fn send_asset(asset: CoreAsset, tag: Tag, recipient: Recipient) { - let asset = remove_asset(asset); - create_note(asset, tag, recipient); - } -} diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/wit/basic-wallet.wit b/tests/rust-apps-wasm/wit-sdk/basic-wallet/wit/basic-wallet.wit deleted file mode 100644 index f30375a67..000000000 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/wit/basic-wallet.wit +++ /dev/null @@ -1,19 +0,0 @@ -package miden:basic-wallet@1.0.0; - -use miden:base/core-types@1.0.0; -use miden:base/types@1.0.0; -use miden:base/tx@1.0.0; -use miden:base/account@1.0.0; - -interface basic-wallet { - use core-types.{core-asset, tag, recipient}; - - receive-asset: func(core-asset: core-asset); - send-asset: func(core-asset: core-asset, tag: tag, recipient: recipient); -} - -world basic-wallet-world { - import account; - import tx; - export basic-wallet; -} diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock b/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock deleted file mode 100644 index 79bc8a1f1..000000000 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock +++ /dev/null @@ -1,69 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "basic-wallet-p2id-note" -version = "0.0.0" -dependencies = [ - "wee_alloc", - "wit-bindgen-rt", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "wit-bindgen-rt" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a37bd9274cb2d4754b915d624447ec0dce9105d174361841c0826efc79ceb9" diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.toml b/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.toml deleted file mode 100644 index f891ee738..000000000 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.toml +++ /dev/null @@ -1,35 +0,0 @@ -[package] -name = "basic-wallet-p2id-note" -version = "0.0.0" -rust-version = "1.71" -authors = ["Miden contributors"] -description = "p2id-note for basic wallet" -repository = "https://github.com/0xPolygonMiden/miden-ir" -homepage = "https://github.com/0xPolygonMiden/miden-ir" -documentation = "https://github.com/0xPolygonMiden/miden-ir" -license = "MIT" -edition = "2021" -publish = false - -[lib] -crate-type = ["cdylib"] - -[dependencies] -wit-bindgen-rt = "0.28" -wee_alloc = { version = "0.4.5", default-features = false } - -[package.metadata.component] -package = "miden:basic-wallet-p2id-note" - -[package.metadata.component.dependencies] - -[package.metadata.component.target.dependencies] -"miden:base" = { path = "../sdk/wit" } -"miden:basic-wallet" = { path = "../basic-wallet/wit" } - -[package.metadata.component.bindings] -derives = ["PartialEq"] - -[profile.release] -panic = "abort" -debug = true diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs deleted file mode 100644 index 45bff2b7d..000000000 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs +++ /dev/null @@ -1,1516 +0,0 @@ -#[allow(dead_code)] -pub mod miden { - #[allow(dead_code)] - pub mod base { - #[allow(dead_code, clippy::all)] - pub mod core_types { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - /// Represents base field element in the field using Montgomery representation. - /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the range [0, M). - /// Field modulus M = 2^64 - 2^32 + 1 - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct Felt { - /// We plan to use f64 as the backing type for the field element. It has the size that we need and - /// we don't plan to support floating point arithmetic in programs for Miden VM. - /// - /// For now its u64 - pub inner: u64, - } - impl ::core::fmt::Debug for Felt { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Felt").field("inner", &self.inner).finish() - } - } - /// A group of four field elements in the Miden base field. - pub type Word = (Felt, Felt, Felt, Felt); - /// Unique identifier of an account. - /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a - /// single account and also specifies the type of the underlying account. Specifically: - /// - The two most significant bits of the ID specify the type of the account: - /// - 00 - regular account with updatable code. - /// - 01 - regular account with immutable code. - /// - 10 - fungible asset faucet with immutable code. - /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: - /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. - /// As such the three most significant bits fully describes the type of the account. - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct AccountId { - pub inner: Felt, - } - impl ::core::fmt::Debug for AccountId { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountId").field("inner", &self.inner).finish() - } - } - /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), input_hash) - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct Recipient { - pub inner: Word, - } - impl ::core::fmt::Debug for Recipient { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Recipient").field("inner", &self.inner).finish() - } - } - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct Tag { - pub inner: Felt, - } - impl ::core::fmt::Debug for Tag { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Tag").field("inner", &self.inner).finish() - } - } - /// A fungible or a non-fungible asset. - /// - /// All assets are encoded using a single word (4 elements) such that it is easy to determine the - /// type of an asset both inside and outside Miden VM. Specifically: - /// Element 1 will be: - /// - ZERO for a fungible asset - /// - non-ZERO for a non-fungible asset - /// The most significant bit will be: - /// - ONE for a fungible asset - /// - ZERO for a non-fungible asset - /// - /// The above properties guarantee that there can never be a collision between a fungible and a - /// non-fungible asset. - /// - /// The methodology for constructing fungible and non-fungible assets is described below. - /// - /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet which issued - /// the asset. This guarantees the properties described above (the first bit is ONE). - /// - /// The least significant element is set to the amount of the asset. This amount cannot be greater - /// than 2^63 - 1 and thus requires 63-bits to store. - /// - /// Elements 1 and 2 are set to ZERO. - /// - /// It is impossible to find a collision between two fungible assets issued by different faucets as - /// the faucet_id is included in the description of the asset and this is guaranteed to be different - /// for each faucet as per the faucet creation logic. - /// - /// # Non-fungible assets - /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field - /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. - /// - Lastly, the most significant bit of d3 is set to ZERO. - /// - /// It is impossible to find a collision between two non-fungible assets issued by different faucets - /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed - /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets - /// issued by the same faucet is ~2^95. - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct CoreAsset { - pub inner: Word, - } - impl ::core::fmt::Debug for CoreAsset { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("CoreAsset").field("inner", &self.inner).finish() - } - } - /// Account nonce - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct Nonce { - pub inner: Felt, - } - impl ::core::fmt::Debug for Nonce { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Nonce").field("inner", &self.inner).finish() - } - } - /// Account hash - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct AccountHash { - pub inner: Word, - } - impl ::core::fmt::Debug for AccountHash { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountHash").field("inner", &self.inner).finish() - } - } - /// Block hash - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct BlockHash { - pub inner: Word, - } - impl ::core::fmt::Debug for BlockHash { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("BlockHash").field("inner", &self.inner).finish() - } - } - /// Storage value - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct StorageValue { - pub inner: Word, - } - impl ::core::fmt::Debug for StorageValue { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("StorageValue").field("inner", &self.inner).finish() - } - } - /// Account storage root - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct StorageRoot { - pub inner: Word, - } - impl ::core::fmt::Debug for StorageRoot { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("StorageRoot").field("inner", &self.inner).finish() - } - } - /// Account code root - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct AccountCodeRoot { - pub inner: Word, - } - impl ::core::fmt::Debug for AccountCodeRoot { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountCodeRoot") - .field("inner", &self.inner) - .finish() - } - } - /// Commitment to the account vault - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct VaultCommitment { - pub inner: Word, - } - impl ::core::fmt::Debug for VaultCommitment { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("VaultCommitment") - .field("inner", &self.inner) - .finish() - } - } - /// An id of the created note - #[repr(C)] - #[derive(Clone, Copy, PartialEq)] - pub struct NoteId { - pub inner: Felt, - } - impl ::core::fmt::Debug for NoteId { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("NoteId").field("inner", &self.inner).finish() - } - } - #[allow(unused_unsafe, clippy::all)] - /// Creates a new account ID from a field element. - pub fn account_id_from_felt(felt: Felt) -> AccountId { - unsafe { - let Felt { inner: inner0 } = felt; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/core-types@1.0.0")] - extern "C" { - #[link_name = "account-id-from-felt"] - fn wit_import(_: i64) -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i64 { - unreachable!() - } - let ret = wit_import(_rt::as_i64(inner0)); - AccountId { - inner: Felt { inner: ret as u64 }, - } - } - } - } - #[allow(dead_code, clippy::all)] - pub mod tx { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - pub type Felt = super::super::super::miden::base::core_types::Felt; - pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; - pub type Tag = super::super::super::miden::base::core_types::Tag; - pub type Recipient = super::super::super::miden::base::core_types::Recipient; - pub type BlockHash = super::super::super::miden::base::core_types::BlockHash; - pub type Word = super::super::super::miden::base::core_types::Word; - pub type NoteId = super::super::super::miden::base::core_types::NoteId; - #[allow(unused_unsafe, clippy::all)] - /// Returns the block number of the last known block at the time of transaction execution. - pub fn get_block_number() -> Felt { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-block-number"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the block hash of the last known block at the time of transaction execution. - pub fn get_block_hash() -> BlockHash { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-block-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::BlockHash { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the input notes hash. This is computed as a sequential hash of - /// (nullifier, script_root) tuples over all input notes. - pub fn get_input_notes_hash() -> Word { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-input-notes-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the output notes hash. This is computed as a sequential hash of - /// (note_hash, note_metadata) tuples over all output notes. - pub fn get_output_notes_hash() -> Word { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-output-notes-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Creates a new note. - /// asset is the asset to be included in the note. - /// tag is the tag to be included in the note. - /// recipient is the recipient of the note. - /// Returns the id of the created note. - pub fn create_note( - asset: CoreAsset, - tag: Tag, - recipient: Recipient, - ) -> NoteId { - unsafe { - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let super::super::super::miden::base::core_types::Tag { - inner: inner6, - } = tag; - let super::super::super::miden::base::core_types::Felt { - inner: inner7, - } = inner6; - let super::super::super::miden::base::core_types::Recipient { - inner: inner8, - } = recipient; - let (t9_0, t9_1, t9_2, t9_3) = inner8; - let super::super::super::miden::base::core_types::Felt { - inner: inner10, - } = t9_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner11, - } = t9_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner12, - } = t9_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner13, - } = t9_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "create-note"] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - ) -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - ) -> i64 { - unreachable!() - } - let ret = wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - _rt::as_i64(inner7), - _rt::as_i64(inner10), - _rt::as_i64(inner11), - _rt::as_i64(inner12), - _rt::as_i64(inner13), - ); - super::super::super::miden::base::core_types::NoteId { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - } - #[allow(dead_code, clippy::all)] - pub mod account { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - pub type Felt = super::super::super::miden::base::core_types::Felt; - pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; - pub type AccountId = super::super::super::miden::base::core_types::AccountId; - pub type Nonce = super::super::super::miden::base::core_types::Nonce; - pub type AccountHash = super::super::super::miden::base::core_types::AccountHash; - pub type StorageValue = super::super::super::miden::base::core_types::StorageValue; - pub type StorageRoot = super::super::super::miden::base::core_types::StorageRoot; - pub type AccountCodeRoot = super::super::super::miden::base::core_types::AccountCodeRoot; - pub type VaultCommitment = super::super::super::miden::base::core_types::VaultCommitment; - #[allow(unused_unsafe, clippy::all)] - /// Get the id of the currently executing account - pub fn get_id() -> AccountId { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-id"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::AccountId { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Return the account nonce - pub fn get_nonce() -> Nonce { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-nonce"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::Nonce { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the initial hash of the currently executing account - pub fn get_initial_hash() -> AccountHash { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-initial-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::AccountHash { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the current hash of the account data stored in memory - pub fn get_current_hash() -> AccountHash { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-current-hash"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::AccountHash { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Increment the account nonce by the specified value. - /// value can be at most 2^32 - 1 otherwise this procedure panics - pub fn incr_nonce(value: Felt) { - unsafe { - let super::super::super::miden::base::core_types::Felt { - inner: inner0, - } = value; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "incr-nonce"] - fn wit_import(_: i64); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) { - unreachable!() - } - wit_import(_rt::as_i64(inner0)); - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the value of the specified key in the account storage - pub fn get_item(index: Felt) -> StorageValue { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::Felt { - inner: inner0, - } = index; - let ptr1 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-item"] - fn wit_import(_: i64, _: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: *mut u8) { - unreachable!() - } - wit_import(_rt::as_i64(inner0), ptr1); - let l2 = *ptr1.add(0).cast::(); - let l3 = *ptr1.add(8).cast::(); - let l4 = *ptr1.add(16).cast::(); - let l5 = *ptr1.add(24).cast::(); - super::super::super::miden::base::core_types::StorageValue { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l5 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Set the value of the specified key in the account storage - /// Returns the old value of the key and the new storage root - pub fn set_item( - index: Felt, - value: StorageValue, - ) -> (StorageRoot, StorageValue) { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 64]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 64]); - let super::super::super::miden::base::core_types::Felt { - inner: inner0, - } = index; - let super::super::super::miden::base::core_types::StorageValue { - inner: inner1, - } = value; - let (t2_0, t2_1, t2_2, t2_3) = inner1; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t2_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t2_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t2_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner6, - } = t2_3; - let ptr7 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "set-item"] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: *mut u8, - ); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: *mut u8) { - unreachable!() - } - wit_import( - _rt::as_i64(inner0), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - _rt::as_i64(inner6), - ptr7, - ); - let l8 = *ptr7.add(0).cast::(); - let l9 = *ptr7.add(8).cast::(); - let l10 = *ptr7.add(16).cast::(); - let l11 = *ptr7.add(24).cast::(); - let l12 = *ptr7.add(32).cast::(); - let l13 = *ptr7.add(40).cast::(); - let l14 = *ptr7.add(48).cast::(); - let l15 = *ptr7.add(56).cast::(); - ( - super::super::super::miden::base::core_types::StorageRoot { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l8 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l9 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l10 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l11 as u64, - }, - ), - }, - super::super::super::miden::base::core_types::StorageValue { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l12 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l13 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l14 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l15 as u64, - }, - ), - }, - ) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Sets the code of the account the transaction is being executed against. - /// This procedure can only be executed on regular accounts with updatable - /// code. Otherwise, this procedure fails. code is the hash of the code - /// to set. - pub fn set_code(code_root: AccountCodeRoot) { - unsafe { - let super::super::super::miden::base::core_types::AccountCodeRoot { - inner: inner0, - } = code_root; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "set-code"] - fn wit_import(_: i64, _: i64, _: i64, _: i64); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ); - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the balance of a fungible asset associated with a account_id. - /// Panics if the asset is not a fungible asset. account_id is the faucet id - /// of the fungible asset of interest. balance is the vault balance of the - /// fungible asset. - pub fn get_balance(account_id: AccountId) -> Felt { - unsafe { - let super::super::super::miden::base::core_types::AccountId { - inner: inner0, - } = account_id; - let super::super::super::miden::base::core_types::Felt { - inner: inner1, - } = inner0; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-balance"] - fn wit_import(_: i64) -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64) -> i64 { - unreachable!() - } - let ret = wit_import(_rt::as_i64(inner1)); - super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns a boolean indicating whether the non-fungible asset is present - /// in the vault. Panics if the asset is a fungible asset. asset is the - /// non-fungible asset of interest. has_asset is a boolean indicating - /// whether the account vault has the asset of interest. - pub fn has_non_fungible_asset(asset: CoreAsset) -> bool { - unsafe { - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "has-non-fungible-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64) -> i32 { - unreachable!() - } - let ret = wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ); - _rt::bool_lift(ret as u8) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Add the specified asset to the vault. Panics under various conditions. - /// Returns the final asset in the account vault defined as follows: If asset is - /// a non-fungible asset, then returns the same as asset. If asset is a - /// fungible asset, then returns the total fungible asset in the account - /// vault after asset was added to it. - pub fn add_asset(asset: CoreAsset) -> CoreAsset { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let ptr6 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "add-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ptr6, - ); - let l7 = *ptr6.add(0).cast::(); - let l8 = *ptr6.add(8).cast::(); - let l9 = *ptr6.add(16).cast::(); - let l10 = *ptr6.add(24).cast::(); - super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l7 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l8 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l9 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l10 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Remove the specified asset from the vault - pub fn remove_asset(asset: CoreAsset) -> CoreAsset { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let ptr6 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "remove-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: *mut u8) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ptr6, - ); - let l7 = *ptr6.add(0).cast::(); - let l8 = *ptr6.add(8).cast::(); - let l9 = *ptr6.add(16).cast::(); - let l10 = *ptr6.add(24).cast::(); - super::super::super::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l7 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l8 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l9 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l10 as u64, - }, - ), - } - } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the commitment to the account vault. - pub fn get_vault_commitment() -> VaultCommitment { - unsafe { - #[repr(align(8))] - struct RetArea([::core::mem::MaybeUninit; 32]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 32]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-vault-commitment"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::(); - let l2 = *ptr0.add(8).cast::(); - let l3 = *ptr0.add(16).cast::(); - let l4 = *ptr0.add(24).cast::(); - super::super::super::miden::base::core_types::VaultCommitment { - inner: ( - super::super::super::miden::base::core_types::Felt { - inner: l1 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l2 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l3 as u64, - }, - super::super::super::miden::base::core_types::Felt { - inner: l4 as u64, - }, - ), - } - } - } - } - #[allow(dead_code, clippy::all)] - pub mod note { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - pub type Felt = super::super::super::miden::base::core_types::Felt; - pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; - pub type AccountId = super::super::super::miden::base::core_types::AccountId; - #[allow(unused_unsafe, clippy::all)] - /// Get the inputs of the currently executed note - pub fn get_inputs() -> _rt::Vec { - unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/note@1.0.0")] - extern "C" { - #[link_name = "get-inputs"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - _rt::Vec::from_raw_parts(l1.cast(), len3, len3) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the assets of the currently executing note - pub fn get_assets() -> _rt::Vec { - unsafe { - #[repr(align(4))] - struct RetArea([::core::mem::MaybeUninit; 8]); - let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 8]); - let ptr0 = ret_area.0.as_mut_ptr().cast::(); - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/note@1.0.0")] - extern "C" { - #[link_name = "get-assets"] - fn wit_import(_: *mut u8); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: *mut u8) { - unreachable!() - } - wit_import(ptr0); - let l1 = *ptr0.add(0).cast::<*mut u8>(); - let l2 = *ptr0.add(4).cast::(); - let len3 = l2; - _rt::Vec::from_raw_parts(l1.cast(), len3, len3) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the sender of the currently executing note - pub fn get_sender() -> AccountId { - unsafe { - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/note@1.0.0")] - extern "C" { - #[link_name = "get-sender"] - fn wit_import() -> i64; - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import() -> i64 { - unreachable!() - } - let ret = wit_import(); - super::super::super::miden::base::core_types::AccountId { - inner: super::super::super::miden::base::core_types::Felt { - inner: ret as u64, - }, - } - } - } - } - } - #[allow(dead_code)] - pub mod basic_wallet { - #[allow(dead_code, clippy::all)] - pub mod basic_wallet { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_custom_section_describing_imports; - use super::super::super::_rt; - pub type CoreAsset = super::super::super::miden::base::core_types::CoreAsset; - pub type Tag = super::super::super::miden::base::core_types::Tag; - pub type Recipient = super::super::super::miden::base::core_types::Recipient; - #[allow(unused_unsafe, clippy::all)] - pub fn receive_asset(core_asset: CoreAsset) { - unsafe { - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = core_asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:basic-wallet/basic-wallet@1.0.0")] - extern "C" { - #[link_name = "receive-asset"] - fn wit_import(_: i64, _: i64, _: i64, _: i64); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - ); - } - } - #[allow(unused_unsafe, clippy::all)] - pub fn send_asset(core_asset: CoreAsset, tag: Tag, recipient: Recipient) { - unsafe { - let super::super::super::miden::base::core_types::CoreAsset { - inner: inner0, - } = core_asset; - let (t1_0, t1_1, t1_2, t1_3) = inner0; - let super::super::super::miden::base::core_types::Felt { - inner: inner2, - } = t1_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner3, - } = t1_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner4, - } = t1_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner5, - } = t1_3; - let super::super::super::miden::base::core_types::Tag { - inner: inner6, - } = tag; - let super::super::super::miden::base::core_types::Felt { - inner: inner7, - } = inner6; - let super::super::super::miden::base::core_types::Recipient { - inner: inner8, - } = recipient; - let (t9_0, t9_1, t9_2, t9_3) = inner8; - let super::super::super::miden::base::core_types::Felt { - inner: inner10, - } = t9_0; - let super::super::super::miden::base::core_types::Felt { - inner: inner11, - } = t9_1; - let super::super::super::miden::base::core_types::Felt { - inner: inner12, - } = t9_2; - let super::super::super::miden::base::core_types::Felt { - inner: inner13, - } = t9_3; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:basic-wallet/basic-wallet@1.0.0")] - extern "C" { - #[link_name = "send-asset"] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - ); - } - #[cfg(not(target_arch = "wasm32"))] - fn wit_import( - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - _: i64, - ) { - unreachable!() - } - wit_import( - _rt::as_i64(inner2), - _rt::as_i64(inner3), - _rt::as_i64(inner4), - _rt::as_i64(inner5), - _rt::as_i64(inner7), - _rt::as_i64(inner10), - _rt::as_i64(inner11), - _rt::as_i64(inner12), - _rt::as_i64(inner13), - ); - } - } - } - } -} -#[allow(dead_code)] -pub mod exports { - #[allow(dead_code)] - pub mod miden { - #[allow(dead_code)] - pub mod base { - #[allow(dead_code, clippy::all)] - pub mod note_script { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; - use super::super::super::super::_rt; - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_note_script_cabi() { - #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); - T::note_script(); - } - pub trait Guest { - fn note_script(); - } - #[doc(hidden)] - macro_rules! __export_miden_base_note_script_1_0_0_cabi { - ($ty:ident with_types_in $($path_to_types:tt)*) => { - const _ : () = { #[export_name = - "miden:base/note-script@1.0.0#note-script"] unsafe extern "C" fn - export_note_script() { $($path_to_types)*:: - _export_note_script_cabi::<$ty > () } }; - }; - } - #[doc(hidden)] - pub(crate) use __export_miden_base_note_script_1_0_0_cabi; - } - } - } -} -mod _rt { - pub fn as_i64(t: T) -> i64 { - t.as_i64() - } - pub trait AsI64 { - fn as_i64(self) -> i64; - } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { - fn as_i64(self) -> i64 { - (*self).as_i64() - } - } - impl AsI64 for i64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - impl AsI64 for u64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - pub unsafe fn bool_lift(val: u8) -> bool { - if cfg!(debug_assertions) { - match val { - 0 => false, - 1 => true, - _ => panic!("invalid bool discriminant"), - } - } else { - val != 0 - } - } - pub use alloc_crate::vec::Vec; - #[cfg(target_arch = "wasm32")] - pub fn run_ctors_once() { - wit_bindgen_rt::run_ctors_once(); - } - extern crate alloc as alloc_crate; -} -/// Generates `#[no_mangle]` functions to export the specified type as the -/// root implementation of all generated traits. -/// -/// For more information see the documentation of `wit_bindgen::generate!`. -/// -/// ```rust -/// # macro_rules! export{ ($($t:tt)*) => (); } -/// # trait Guest {} -/// struct MyType; -/// -/// impl Guest for MyType { -/// // ... -/// } -/// -/// export!(MyType); -/// ``` -#[allow(unused_macros)] -#[doc(hidden)] -macro_rules! __export_notes_world_impl { - ($ty:ident) => { - self::export!($ty with_types_in self); - }; - ($ty:ident with_types_in $($path_to_types_root:tt)*) => { - $($path_to_types_root)*:: - exports::miden::base::note_script::__export_miden_base_note_script_1_0_0_cabi!($ty - with_types_in $($path_to_types_root)*:: exports::miden::base::note_script); - }; -} -#[doc(inline)] -pub(crate) use __export_notes_world_impl as export; -#[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.30.0:notes-world:encoded world"] -#[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2434] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x80\x12\x01A\x02\x01\ -A\x1a\x01B\x1e\x01r\x01\x05innerw\x04\0\x04felt\x03\0\0\x01o\x04\x01\x01\x01\x01\ -\x04\0\x04word\x03\0\x02\x01r\x01\x05inner\x01\x04\0\x0aaccount-id\x03\0\x04\x01\ -r\x01\x05inner\x03\x04\0\x09recipient\x03\0\x06\x01r\x01\x05inner\x01\x04\0\x03t\ -ag\x03\0\x08\x01r\x01\x05inner\x03\x04\0\x0acore-asset\x03\0\x0a\x01r\x01\x05inn\ -er\x01\x04\0\x05nonce\x03\0\x0c\x01r\x01\x05inner\x03\x04\0\x0caccount-hash\x03\0\ -\x0e\x01r\x01\x05inner\x03\x04\0\x0ablock-hash\x03\0\x10\x01r\x01\x05inner\x03\x04\ -\0\x0dstorage-value\x03\0\x12\x01r\x01\x05inner\x03\x04\0\x0cstorage-root\x03\0\x14\ -\x01r\x01\x05inner\x03\x04\0\x11account-code-root\x03\0\x16\x01r\x01\x05inner\x03\ -\x04\0\x10vault-commitment\x03\0\x18\x01r\x01\x05inner\x01\x04\0\x07note-id\x03\0\ -\x1a\x01@\x01\x04felt\x01\0\x05\x04\0\x14account-id-from-felt\x01\x1c\x03\x01\x1b\ -miden:base/core-types@1.0.0\x05\0\x02\x03\0\0\x04felt\x02\x03\0\0\x0acore-asset\x02\ -\x03\0\0\x03tag\x02\x03\0\0\x09recipient\x02\x03\0\0\x0aaccount-id\x02\x03\0\0\x05\ -nonce\x02\x03\0\0\x0caccount-hash\x02\x03\0\0\x0dstorage-value\x02\x03\0\0\x0cst\ -orage-root\x02\x03\0\0\x11account-code-root\x02\x03\0\0\x10vault-commitment\x02\x03\ -\0\0\x0ablock-hash\x02\x03\0\0\x04word\x02\x03\0\0\x07note-id\x01B%\x02\x03\x02\x01\ -\x01\x04\0\x04felt\x03\0\0\x02\x03\x02\x01\x02\x04\0\x0acore-asset\x03\0\x02\x02\ -\x03\x02\x01\x03\x04\0\x03tag\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x09recipient\x03\ -\0\x06\x02\x03\x02\x01\x05\x04\0\x0aaccount-id\x03\0\x08\x02\x03\x02\x01\x06\x04\ -\0\x05nonce\x03\0\x0a\x02\x03\x02\x01\x07\x04\0\x0caccount-hash\x03\0\x0c\x02\x03\ -\x02\x01\x08\x04\0\x0dstorage-value\x03\0\x0e\x02\x03\x02\x01\x09\x04\0\x0cstora\ -ge-root\x03\0\x10\x02\x03\x02\x01\x0a\x04\0\x11account-code-root\x03\0\x12\x02\x03\ -\x02\x01\x0b\x04\0\x10vault-commitment\x03\0\x14\x02\x03\x02\x01\x0c\x04\0\x0abl\ -ock-hash\x03\0\x16\x02\x03\x02\x01\x0d\x04\0\x04word\x03\0\x18\x02\x03\x02\x01\x0e\ -\x04\0\x07note-id\x03\0\x1a\x01@\0\0\x01\x04\0\x10get-block-number\x01\x1c\x01@\0\ -\0\x17\x04\0\x0eget-block-hash\x01\x1d\x01@\0\0\x19\x04\0\x14get-input-notes-has\ -h\x01\x1e\x04\0\x15get-output-notes-hash\x01\x1e\x01@\x03\x05asset\x03\x03tag\x05\ -\x09recipient\x07\0\x1b\x04\0\x0bcreate-note\x01\x1f\x03\x01\x13miden:base/tx@1.\ -0.0\x05\x0f\x01B/\x02\x03\x02\x01\x01\x04\0\x04felt\x03\0\0\x02\x03\x02\x01\x02\x04\ -\0\x0acore-asset\x03\0\x02\x02\x03\x02\x01\x03\x04\0\x03tag\x03\0\x04\x02\x03\x02\ -\x01\x04\x04\0\x09recipient\x03\0\x06\x02\x03\x02\x01\x05\x04\0\x0aaccount-id\x03\ -\0\x08\x02\x03\x02\x01\x06\x04\0\x05nonce\x03\0\x0a\x02\x03\x02\x01\x07\x04\0\x0c\ -account-hash\x03\0\x0c\x02\x03\x02\x01\x08\x04\0\x0dstorage-value\x03\0\x0e\x02\x03\ -\x02\x01\x09\x04\0\x0cstorage-root\x03\0\x10\x02\x03\x02\x01\x0a\x04\0\x11accoun\ -t-code-root\x03\0\x12\x02\x03\x02\x01\x0b\x04\0\x10vault-commitment\x03\0\x14\x01\ -@\0\0\x09\x04\0\x06get-id\x01\x16\x01@\0\0\x0b\x04\0\x09get-nonce\x01\x17\x01@\0\ -\0\x0d\x04\0\x10get-initial-hash\x01\x18\x04\0\x10get-current-hash\x01\x18\x01@\x01\ -\x05value\x01\x01\0\x04\0\x0aincr-nonce\x01\x19\x01@\x01\x05index\x01\0\x0f\x04\0\ -\x08get-item\x01\x1a\x01o\x02\x11\x0f\x01@\x02\x05index\x01\x05value\x0f\0\x1b\x04\ -\0\x08set-item\x01\x1c\x01@\x01\x09code-root\x13\x01\0\x04\0\x08set-code\x01\x1d\ -\x01@\x01\x0aaccount-id\x09\0\x01\x04\0\x0bget-balance\x01\x1e\x01@\x01\x05asset\ -\x03\0\x7f\x04\0\x16has-non-fungible-asset\x01\x1f\x01@\x01\x05asset\x03\0\x03\x04\ -\0\x09add-asset\x01\x20\x04\0\x0cremove-asset\x01\x20\x01@\0\0\x15\x04\0\x14get-\ -vault-commitment\x01!\x03\x01\x18miden:base/account@1.0.0\x05\x10\x01B\x1e\x02\x03\ -\x02\x01\x01\x04\0\x04felt\x03\0\0\x02\x03\x02\x01\x02\x04\0\x0acore-asset\x03\0\ -\x02\x02\x03\x02\x01\x03\x04\0\x03tag\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x09rec\ -ipient\x03\0\x06\x02\x03\x02\x01\x05\x04\0\x0aaccount-id\x03\0\x08\x02\x03\x02\x01\ -\x06\x04\0\x05nonce\x03\0\x0a\x02\x03\x02\x01\x07\x04\0\x0caccount-hash\x03\0\x0c\ -\x02\x03\x02\x01\x08\x04\0\x0dstorage-value\x03\0\x0e\x02\x03\x02\x01\x09\x04\0\x0c\ -storage-root\x03\0\x10\x02\x03\x02\x01\x0a\x04\0\x11account-code-root\x03\0\x12\x02\ -\x03\x02\x01\x0b\x04\0\x10vault-commitment\x03\0\x14\x01p\x01\x01@\0\0\x16\x04\0\ -\x0aget-inputs\x01\x17\x01p\x03\x01@\0\0\x18\x04\0\x0aget-assets\x01\x19\x01@\0\0\ -\x09\x04\0\x0aget-sender\x01\x1a\x03\x01\x15miden:base/note@1.0.0\x05\x11\x01B\x0a\ -\x02\x03\x02\x01\x02\x04\0\x0acore-asset\x03\0\0\x02\x03\x02\x01\x03\x04\0\x03ta\ -g\x03\0\x02\x02\x03\x02\x01\x04\x04\0\x09recipient\x03\0\x04\x01@\x01\x0acore-as\ -set\x01\x01\0\x04\0\x0dreceive-asset\x01\x06\x01@\x03\x0acore-asset\x01\x03tag\x03\ -\x09recipient\x05\x01\0\x04\0\x0asend-asset\x01\x07\x03\x01%miden:basic-wallet/b\ -asic-wallet@1.0.0\x05\x12\x01B\x02\x01@\0\x01\0\x04\0\x0bnote-script\x01\0\x04\x01\ -\x1cmiden:base/note-script@1.0.0\x05\x13\x04\x01\x1cmiden:p2id/notes-world@1.0.0\ -\x04\0\x0b\x11\x01\0\x0bnotes-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\ -\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; -#[inline(never)] -#[doc(hidden)] -pub fn __link_custom_section_describing_imports() { - wit_bindgen_rt::maybe_link_cabi_realloc(); -} diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/lib.rs b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/lib.rs deleted file mode 100644 index 702a5e800..000000000 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/lib.rs +++ /dev/null @@ -1,42 +0,0 @@ -#![no_std] - -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - -#[panic_handler] -fn my_panic(_info: &core::panic::PanicInfo) -> ! { - loop {} -} - -bindings::export!(Component with_types_in bindings); - -#[allow(dead_code)] -mod bindings; - -use bindings::{ - exports::miden::base::note_script::Guest, - miden::{ - base::{ - account::get_id, - core_types::account_id_from_felt, - note::{get_assets, get_inputs}, - }, - basic_wallet::basic_wallet::receive_asset, - }, -}; - -pub struct Component; - -impl Guest for Component { - fn note_script() { - let inputs = get_inputs(); - let target_account_id_felt = inputs[0]; - let target_account_id = account_id_from_felt(target_account_id_felt); - let account_id = get_id(); - assert_eq!(account_id, target_account_id); - let assets = get_assets(); - for asset in assets { - receive_asset(asset); - } - } -} diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/wit/p2id-note.wit b/tests/rust-apps-wasm/wit-sdk/p2id-note/wit/p2id-note.wit deleted file mode 100644 index c30a257b2..000000000 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/wit/p2id-note.wit +++ /dev/null @@ -1,13 +0,0 @@ -package miden:p2id@1.0.0; - - -world notes-world { - import miden:base/core-types@1.0.0; - import miden:base/tx@1.0.0; - import miden:base/account@1.0.0; - import miden:base/note@1.0.0; - - import miden:basic-wallet/basic-wallet@1.0.0; - - export miden:base/note-script@1.0.0; -} diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock b/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock deleted file mode 100644 index 02128e975..000000000 --- a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock +++ /dev/null @@ -1,69 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "miden-sdk" -version = "0.0.0" -dependencies = [ - "wee_alloc", - "wit-bindgen-rt", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "wit-bindgen-rt" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a37bd9274cb2d4754b915d624447ec0dce9105d174361841c0826efc79ceb9" diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml b/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml deleted file mode 100644 index 7c9b5c2a1..000000000 --- a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml +++ /dev/null @@ -1,29 +0,0 @@ -[package] -name = "miden-sdk" -version = "0.0.0" -rust-version = "1.71" -authors = ["Miden contributors"] -description = "Miden SDK" -license = "MIT" -edition = "2021" -publish = false - -# To keep it out of the root workspace since it cannot be built for a non-Wasm target -[workspace] - -[dependencies] -wit-bindgen-rt = "0.28" -wee_alloc = { version = "0.4.5", default-features = false } - - -[lib] -crate-type = ["cdylib"] - -[package.metadata.component] -package = "component:miden" - -[package.metadata.component.dependencies] - -[profile.release] -panic = "abort" -debug = true diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs deleted file mode 100644 index fc063acda..000000000 --- a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs +++ /dev/null @@ -1,468 +0,0 @@ -#[allow(dead_code)] -pub mod exports { - #[allow(dead_code)] - pub mod miden { - #[allow(dead_code)] - pub mod base { - #[allow(dead_code, clippy::all)] - pub mod core_types { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; - use super::super::super::super::_rt; - /// Represents base field element in the field using Montgomery representation. - /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the range [0, M). - /// Field modulus M = 2^64 - 2^32 + 1 - #[repr(C)] - #[derive(Clone, Copy)] - pub struct Felt { - /// We plan to use f64 as the backing type for the field element. It has the size that we need and - /// we don't plan to support floating point arithmetic in programs for Miden VM. - /// - /// For now its u64 - pub inner: u64, - } - impl ::core::fmt::Debug for Felt { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("Felt").field("inner", &self.inner).finish() - } - } - /// A group of four field elements in the Miden base field. - pub type Word = (Felt, Felt, Felt, Felt); - /// Unique identifier of an account. - /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a - /// single account and also specifies the type of the underlying account. Specifically: - /// - The two most significant bits of the ID specify the type of the account: - /// - 00 - regular account with updatable code. - /// - 01 - regular account with immutable code. - /// - 10 - fungible asset faucet with immutable code. - /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: - /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. - /// As such the three most significant bits fully describes the type of the account. - #[repr(C)] - #[derive(Clone, Copy)] - pub struct AccountId { - pub inner: Felt, - } - impl ::core::fmt::Debug for AccountId { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("AccountId").field("inner", &self.inner).finish() - } - } - /// A fungible or a non-fungible asset. - /// - /// All assets are encoded using a single word (4 elements) such that it is easy to determine the - /// type of an asset both inside and outside Miden VM. Specifically: - /// Element 1 will be: - /// - ZERO for a fungible asset - /// - non-ZERO for a non-fungible asset - /// The most significant bit will be: - /// - ONE for a fungible asset - /// - ZERO for a non-fungible asset - /// - /// The above properties guarantee that there can never be a collision between a fungible and a - /// non-fungible asset. - /// - /// The methodology for constructing fungible and non-fungible assets is described below. - /// - /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet which issued - /// the asset. This guarantees the properties described above (the first bit is ONE). - /// - /// The least significant element is set to the amount of the asset. This amount cannot be greater - /// than 2^63 - 1 and thus requires 63-bits to store. - /// - /// Elements 1 and 2 are set to ZERO. - /// - /// It is impossible to find a collision between two fungible assets issued by different faucets as - /// the faucet_id is included in the description of the asset and this is guaranteed to be different - /// for each faucet as per the faucet creation logic. - /// - /// # Non-fungible assets - /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field - /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. - /// - Lastly, the most significant bit of d3 is set to ZERO. - /// - /// It is impossible to find a collision between two non-fungible assets issued by different faucets - /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed - /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets - /// issued by the same faucet is ~2^95. - #[repr(C)] - #[derive(Clone, Copy)] - pub struct CoreAsset { - pub inner: Word, - } - impl ::core::fmt::Debug for CoreAsset { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("CoreAsset").field("inner", &self.inner).finish() - } - } - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_account_id_from_felt_cabi( - arg0: i64, - ) -> i64 { - #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); - let result0 = T::account_id_from_felt(Felt { inner: arg0 as u64 }); - let AccountId { inner: inner1 } = result0; - let Felt { inner: inner2 } = inner1; - _rt::as_i64(inner2) - } - pub trait Guest { - /// Creates a new account ID from a field element. - fn account_id_from_felt(felt: Felt) -> AccountId; - } - #[doc(hidden)] - macro_rules! __export_miden_base_core_types_1_0_0_cabi { - ($ty:ident with_types_in $($path_to_types:tt)*) => { - const _ : () = { #[export_name = - "miden:base/core-types@1.0.0#account-id-from-felt"] unsafe extern - "C" fn export_account_id_from_felt(arg0 : i64,) -> i64 { - $($path_to_types)*:: _export_account_id_from_felt_cabi::<$ty > - (arg0) } }; - }; - } - #[doc(hidden)] - pub(crate) use __export_miden_base_core_types_1_0_0_cabi; - } - #[allow(dead_code, clippy::all)] - pub mod types { - #[used] - #[doc(hidden)] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_custom_section_describing_imports; - use super::super::super::super::_rt; - pub type AccountId = super::super::super::super::exports::miden::base::core_types::AccountId; - pub type Word = super::super::super::super::exports::miden::base::core_types::Word; - pub type CoreAsset = super::super::super::super::exports::miden::base::core_types::CoreAsset; - /// A fungible asset - #[repr(C)] - #[derive(Clone, Copy)] - pub struct FungibleAsset { - /// Faucet ID of the faucet which issued the asset as well as the asset amount. - pub asset: AccountId, - /// Asset amount is guaranteed to be 2^63 - 1 or smaller. - pub amount: u64, - } - impl ::core::fmt::Debug for FungibleAsset { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("FungibleAsset") - .field("asset", &self.asset) - .field("amount", &self.amount) - .finish() - } - } - /// A commitment to a non-fungible asset. - /// - /// A non-fungible asset consists of 4 field elements which are computed by hashing asset data - /// (which can be of arbitrary length) to produce: [d0, d1, d2, d3]. We then replace d1 with the - /// faucet_id that issued the asset: [d0, faucet_id, d2, d3]. We then set the most significant bit - /// of the most significant element to ZERO. - #[repr(C)] - #[derive(Clone, Copy)] - pub struct NonFungibleAsset { - pub inner: Word, - } - impl ::core::fmt::Debug for NonFungibleAsset { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_struct("NonFungibleAsset") - .field("inner", &self.inner) - .finish() - } - } - /// A fungible or a non-fungible asset. - #[derive(Clone, Copy)] - pub enum Asset { - Fungible(FungibleAsset), - NonFungible(NonFungibleAsset), - } - impl ::core::fmt::Debug for Asset { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Asset::Fungible(e) => { - f.debug_tuple("Asset::Fungible").field(e).finish() - } - Asset::NonFungible(e) => { - f.debug_tuple("Asset::NonFungible").field(e).finish() - } - } - } - } - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_from_core_asset_cabi( - arg0: i64, - arg1: i64, - arg2: i64, - arg3: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); - let result0 = T::from_core_asset(super::super::super::super::exports::miden::base::core_types::CoreAsset { - inner: ( - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg0 as u64, - }, - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg1 as u64, - }, - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg2 as u64, - }, - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg3 as u64, - }, - ), - }); - let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); - match result0 { - Asset::Fungible(e) => { - *ptr1.add(0).cast::() = (0i32) as u8; - let FungibleAsset { asset: asset2, amount: amount2 } = e; - let super::super::super::super::exports::miden::base::core_types::AccountId { - inner: inner3, - } = asset2; - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner4, - } = inner3; - *ptr1.add(8).cast::() = _rt::as_i64(inner4); - *ptr1.add(16).cast::() = _rt::as_i64(amount2); - } - Asset::NonFungible(e) => { - *ptr1.add(0).cast::() = (1i32) as u8; - let NonFungibleAsset { inner: inner5 } = e; - let (t6_0, t6_1, t6_2, t6_3) = inner5; - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner7, - } = t6_0; - *ptr1.add(8).cast::() = _rt::as_i64(inner7); - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner8, - } = t6_1; - *ptr1.add(16).cast::() = _rt::as_i64(inner8); - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner9, - } = t6_2; - *ptr1.add(24).cast::() = _rt::as_i64(inner9); - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner10, - } = t6_3; - *ptr1.add(32).cast::() = _rt::as_i64(inner10); - } - } - ptr1 - } - #[doc(hidden)] - #[allow(non_snake_case)] - pub unsafe fn _export_to_core_asset_cabi( - arg0: i32, - arg1: i64, - arg2: i64, - arg3: i64, - arg4: i64, - ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); - let v0 = match arg0 { - 0 => { - let e0 = FungibleAsset { - asset: super::super::super::super::exports::miden::base::core_types::AccountId { - inner: super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg1 as u64, - }, - }, - amount: arg2 as u64, - }; - Asset::Fungible(e0) - } - n => { - debug_assert_eq!(n, 1, "invalid enum discriminant"); - let e0 = NonFungibleAsset { - inner: ( - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg1 as u64, - }, - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg2 as u64, - }, - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg3 as u64, - }, - super::super::super::super::exports::miden::base::core_types::Felt { - inner: arg4 as u64, - }, - ), - }; - Asset::NonFungible(e0) - } - }; - let result1 = T::to_core_asset(v0); - let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); - let super::super::super::super::exports::miden::base::core_types::CoreAsset { - inner: inner3, - } = result1; - let (t4_0, t4_1, t4_2, t4_3) = inner3; - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner5, - } = t4_0; - *ptr2.add(0).cast::() = _rt::as_i64(inner5); - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner6, - } = t4_1; - *ptr2.add(8).cast::() = _rt::as_i64(inner6); - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner7, - } = t4_2; - *ptr2.add(16).cast::() = _rt::as_i64(inner7); - let super::super::super::super::exports::miden::base::core_types::Felt { - inner: inner8, - } = t4_3; - *ptr2.add(24).cast::() = _rt::as_i64(inner8); - ptr2 - } - pub trait Guest { - /// Converts a core asset to a an asset representation. - fn from_core_asset(core_asset: CoreAsset) -> Asset; - /// Converts an asset to a core asset representation. - fn to_core_asset(asset: Asset) -> CoreAsset; - } - #[doc(hidden)] - macro_rules! __export_miden_base_types_1_0_0_cabi { - ($ty:ident with_types_in $($path_to_types:tt)*) => { - const _ : () = { #[export_name = - "miden:base/types@1.0.0#from-core-asset"] unsafe extern "C" fn - export_from_core_asset(arg0 : i64, arg1 : i64, arg2 : i64, arg3 : - i64,) -> * mut u8 { $($path_to_types)*:: - _export_from_core_asset_cabi::<$ty > (arg0, arg1, arg2, arg3) } - #[export_name = "miden:base/types@1.0.0#to-core-asset"] unsafe - extern "C" fn export_to_core_asset(arg0 : i32, arg1 : i64, arg2 : - i64, arg3 : i64, arg4 : i64,) -> * mut u8 { $($path_to_types)*:: - _export_to_core_asset_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4) - } }; - }; - } - #[doc(hidden)] - pub(crate) use __export_miden_base_types_1_0_0_cabi; - #[repr(align(8))] - struct _RetArea([::core::mem::MaybeUninit; 40]); - static mut _RET_AREA: _RetArea = _RetArea( - [::core::mem::MaybeUninit::uninit(); 40], - ); - } - } - } -} -mod _rt { - #[cfg(target_arch = "wasm32")] - pub fn run_ctors_once() { - wit_bindgen_rt::run_ctors_once(); - } - pub fn as_i64(t: T) -> i64 { - t.as_i64() - } - pub trait AsI64 { - fn as_i64(self) -> i64; - } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { - fn as_i64(self) -> i64 { - (*self).as_i64() - } - } - impl AsI64 for i64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } - impl AsI64 for u64 { - #[inline] - fn as_i64(self) -> i64 { - self as i64 - } - } -} -/// Generates `#[no_mangle]` functions to export the specified type as the -/// root implementation of all generated traits. -/// -/// For more information see the documentation of `wit_bindgen::generate!`. -/// -/// ```rust -/// # macro_rules! export{ ($($t:tt)*) => (); } -/// # trait Guest {} -/// struct MyType; -/// -/// impl Guest for MyType { -/// // ... -/// } -/// -/// export!(MyType); -/// ``` -#[allow(unused_macros)] -#[doc(hidden)] -macro_rules! __export_base_world_impl { - ($ty:ident) => { - self::export!($ty with_types_in self); - }; - ($ty:ident with_types_in $($path_to_types_root:tt)*) => { - $($path_to_types_root)*:: - exports::miden::base::core_types::__export_miden_base_core_types_1_0_0_cabi!($ty - with_types_in $($path_to_types_root)*:: exports::miden::base::core_types); - $($path_to_types_root)*:: - exports::miden::base::types::__export_miden_base_types_1_0_0_cabi!($ty - with_types_in $($path_to_types_root)*:: exports::miden::base::types); - }; -} -#[doc(inline)] -pub(crate) use __export_base_world_impl as export; -#[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.30.0:base-world:encoded world"] -#[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 922] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x99\x06\x01A\x02\x01\ -A\x08\x01B\x1e\x01r\x01\x05innerw\x04\0\x04felt\x03\0\0\x01o\x04\x01\x01\x01\x01\ -\x04\0\x04word\x03\0\x02\x01r\x01\x05inner\x01\x04\0\x0aaccount-id\x03\0\x04\x01\ -r\x01\x05inner\x03\x04\0\x09recipient\x03\0\x06\x01r\x01\x05inner\x01\x04\0\x03t\ -ag\x03\0\x08\x01r\x01\x05inner\x03\x04\0\x0acore-asset\x03\0\x0a\x01r\x01\x05inn\ -er\x01\x04\0\x05nonce\x03\0\x0c\x01r\x01\x05inner\x03\x04\0\x0caccount-hash\x03\0\ -\x0e\x01r\x01\x05inner\x03\x04\0\x0ablock-hash\x03\0\x10\x01r\x01\x05inner\x03\x04\ -\0\x0dstorage-value\x03\0\x12\x01r\x01\x05inner\x03\x04\0\x0cstorage-root\x03\0\x14\ -\x01r\x01\x05inner\x03\x04\0\x11account-code-root\x03\0\x16\x01r\x01\x05inner\x03\ -\x04\0\x10vault-commitment\x03\0\x18\x01r\x01\x05inner\x01\x04\0\x07note-id\x03\0\ -\x1a\x01@\x01\x04felt\x01\0\x05\x04\0\x14account-id-from-felt\x01\x1c\x04\x01\x1b\ -miden:base/core-types@1.0.0\x05\0\x02\x03\0\0\x04felt\x02\x03\0\0\x0aaccount-id\x02\ -\x03\0\0\x04word\x02\x03\0\0\x0acore-asset\x01B\x12\x02\x03\x02\x01\x01\x04\0\x04\ -felt\x03\0\0\x02\x03\x02\x01\x02\x04\0\x0aaccount-id\x03\0\x02\x02\x03\x02\x01\x03\ -\x04\0\x04word\x03\0\x04\x02\x03\x02\x01\x04\x04\0\x0acore-asset\x03\0\x06\x01r\x02\ -\x05asset\x03\x06amountw\x04\0\x0efungible-asset\x03\0\x08\x01r\x01\x05inner\x05\ -\x04\0\x12non-fungible-asset\x03\0\x0a\x01q\x02\x08fungible\x01\x09\0\x0cnon-fun\ -gible\x01\x0b\0\x04\0\x05asset\x03\0\x0c\x01@\x01\x0acore-asset\x07\0\x0d\x04\0\x0f\ -from-core-asset\x01\x0e\x01@\x01\x05asset\x0d\0\x07\x04\0\x0dto-core-asset\x01\x0f\ -\x04\x01\x16miden:base/types@1.0.0\x05\x05\x04\x01\x1bmiden:base/base-world@1.0.\ -0\x04\0\x0b\x10\x01\0\x0abase-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\ -\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; -#[inline(never)] -#[doc(hidden)] -pub fn __link_custom_section_describing_imports() { - wit_bindgen_rt::maybe_link_cabi_realloc(); -} diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/src/lib.rs b/tests/rust-apps-wasm/wit-sdk/sdk/src/lib.rs deleted file mode 100644 index d13032ba0..000000000 --- a/tests/rust-apps-wasm/wit-sdk/sdk/src/lib.rs +++ /dev/null @@ -1,39 +0,0 @@ -#![no_std] - -#[global_allocator] -static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; - -#[panic_handler] -fn my_panic(_info: &core::panic::PanicInfo) -> ! { - loop {} -} - -bindings::export!(Component with_types_in bindings); - -mod bindings; - -use bindings::exports::miden::base::{ - core_types, - core_types::{AccountId, CoreAsset, Felt}, - types, - types::Asset, -}; - -pub struct Component; - -impl core_types::Guest for Component { - fn account_id_from_felt(felt: Felt) -> AccountId { - // TODO: assert that felt is a valid account id - AccountId { inner: felt } - } -} - -impl types::Guest for Component { - fn from_core_asset(asset: CoreAsset) -> Asset { - todo!() - } - - fn to_core_asset(asset: Asset) -> CoreAsset { - todo!() - } -} diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/wit/miden.wit b/tests/rust-apps-wasm/wit-sdk/sdk/wit/miden.wit deleted file mode 100644 index dd6546743..000000000 --- a/tests/rust-apps-wasm/wit-sdk/sdk/wit/miden.wit +++ /dev/null @@ -1,307 +0,0 @@ -package miden:base@1.0.0; - -/// Types to be used in tx-kernel interface -interface core-types { - /// Represents base field element in the field using Montgomery representation. - /// Internal values represent x * R mod M where R = 2^64 mod M and x in [0, M). - /// The backing type is `f64` but the internal values are always integer in the range [0, M). - /// Field modulus M = 2^64 - 2^32 + 1 - record felt { - /// We plan to use f64 as the backing type for the field element. It has the size that we need and - /// we don't plan to support floating point arithmetic in programs for Miden VM. - /// - /// For now its u64 - inner: u64 - } - - - /// A group of four field elements in the Miden base field. - type word = tuple; - - /// Unique identifier of an account. - /// - /// Account ID consists of 1 field element (~64 bits). This field element uniquely identifies a - /// single account and also specifies the type of the underlying account. Specifically: - /// - The two most significant bits of the ID specify the type of the account: - /// - 00 - regular account with updatable code. - /// - 01 - regular account with immutable code. - /// - 10 - fungible asset faucet with immutable code. - /// - 11 - non-fungible asset faucet with immutable code. - /// - The third most significant bit of the ID specifies whether the account data is stored on-chain: - /// - 0 - full account data is stored on-chain. - /// - 1 - only the account hash is stored on-chain which serves as a commitment to the account state. - /// As such the three most significant bits fully describes the type of the account. - record account-id { - inner: felt - } - - /// Creates a new account ID from a field element. - account-id-from-felt: func(felt: felt) -> account-id; - - /// Recipient of the note, i.e., hash(hash(hash(serial_num, [0; 4]), note_script_hash), input_hash) - record recipient { - inner: word - } - - record tag { - inner: felt - } - - /// A fungible or a non-fungible asset. - /// - /// All assets are encoded using a single word (4 elements) such that it is easy to determine the - /// type of an asset both inside and outside Miden VM. Specifically: - /// Element 1 will be: - /// - ZERO for a fungible asset - /// - non-ZERO for a non-fungible asset - /// The most significant bit will be: - /// - ONE for a fungible asset - /// - ZERO for a non-fungible asset - /// - /// The above properties guarantee that there can never be a collision between a fungible and a - /// non-fungible asset. - /// - /// The methodology for constructing fungible and non-fungible assets is described below. - /// - /// # Fungible assets - /// The most significant element of a fungible asset is set to the ID of the faucet which issued - /// the asset. This guarantees the properties described above (the first bit is ONE). - /// - /// The least significant element is set to the amount of the asset. This amount cannot be greater - /// than 2^63 - 1 and thus requires 63-bits to store. - /// - /// Elements 1 and 2 are set to ZERO. - /// - /// It is impossible to find a collision between two fungible assets issued by different faucets as - /// the faucet_id is included in the description of the asset and this is guaranteed to be different - /// for each faucet as per the faucet creation logic. - /// - /// # Non-fungible assets - /// The 4 elements of non-fungible assets are computed as follows: - /// - First the asset data is hashed. This compresses an asset of an arbitrary length to 4 field - /// elements: [d0, d1, d2, d3]. - /// - d1 is then replaced with the faucet_id which issues the asset: [d0, faucet_id, d2, d3]. - /// - Lastly, the most significant bit of d3 is set to ZERO. - /// - /// It is impossible to find a collision between two non-fungible assets issued by different faucets - /// as the faucet_id is included in the description of the non-fungible asset and this is guaranteed - /// to be different as per the faucet creation logic. Collision resistance for non-fungible assets - /// issued by the same faucet is ~2^95. - record core-asset { - inner: word - } - - /// Account nonce - record nonce { - inner: felt - } - - /// Account hash - record account-hash { - inner: word - } - - /// Block hash - record block-hash { - inner: word - } - - /// Storage value - record storage-value { - inner: word - } - - /// Account storage root - record storage-root { - inner: word - } - - /// Account code root - record account-code-root { - inner: word - } - - /// Commitment to the account vault - record vault-commitment { - inner: word - } - - /// An id of the created note - record note-id { - inner: felt - } - -} - - -/// Account-related functions -interface account { - use core-types.{felt,core-asset, tag, recipient, account-id, nonce, account-hash, storage-value, storage-root, account-code-root, vault-commitment}; - - /// Get the id of the currently executing account - get-id: func() -> account-id; - /// Return the account nonce - get-nonce: func() -> nonce; - /// Get the initial hash of the currently executing account - get-initial-hash: func() -> account-hash; - /// Get the current hash of the account data stored in memory - get-current-hash: func() -> account-hash; - /// Increment the account nonce by the specified value. - /// value can be at most 2^32 - 1 otherwise this procedure panics - incr-nonce: func(value: felt); - /// Get the value of the specified key in the account storage - get-item: func(index: felt) -> storage-value; - /// Set the value of the specified key in the account storage - /// Returns the old value of the key and the new storage root - set-item: func(index: felt, value: storage-value) -> tuple; - /// Sets the code of the account the transaction is being executed against. - /// This procedure can only be executed on regular accounts with updatable - /// code. Otherwise, this procedure fails. code is the hash of the code - /// to set. - set-code: func(code-root: account-code-root); - /// Returns the balance of a fungible asset associated with a account_id. - /// Panics if the asset is not a fungible asset. account_id is the faucet id - /// of the fungible asset of interest. balance is the vault balance of the - /// fungible asset. - get-balance: func(account-id: account-id) -> felt; - /// Returns a boolean indicating whether the non-fungible asset is present - /// in the vault. Panics if the asset is a fungible asset. asset is the - /// non-fungible asset of interest. has_asset is a boolean indicating - /// whether the account vault has the asset of interest. - has-non-fungible-asset: func(asset: core-asset) -> bool; - /// Add the specified asset to the vault. Panics under various conditions. - /// Returns the final asset in the account vault defined as follows: If asset is - /// a non-fungible asset, then returns the same as asset. If asset is a - /// fungible asset, then returns the total fungible asset in the account - /// vault after asset was added to it. - add-asset: func(asset: core-asset) -> core-asset; - /// Remove the specified asset from the vault - remove-asset: func(asset: core-asset) -> core-asset; - /// Returns the commitment to the account vault. - get-vault-commitment: func() -> vault-commitment; -} - -// Note-related functions -interface note { - use core-types.{felt, core-asset, tag, recipient, account-id, nonce, account-hash, storage-value, storage-root, account-code-root, vault-commitment}; - - /// Get the inputs of the currently executed note - get-inputs: func() -> list; - /// Get the assets of the currently executing note - get-assets: func() -> list; - /// Get the sender of the currently executing note - get-sender: func() -> account-id; - -} - -/// Transaction-related functions -interface tx { - use core-types.{felt, core-asset, tag, recipient, account-id, nonce, account-hash, storage-value, storage-root, account-code-root, vault-commitment, block-hash, word, note-id}; - - /// Returns the block number of the last known block at the time of transaction execution. - get-block-number: func() -> felt; - /// Returns the block hash of the last known block at the time of transaction execution. - get-block-hash: func() -> block-hash; - /// Returns the input notes hash. This is computed as a sequential hash of - /// (nullifier, script_root) tuples over all input notes. - get-input-notes-hash: func() -> word; - /// Returns the output notes hash. This is computed as a sequential hash of - /// (note_hash, note_metadata) tuples over all output notes. - get-output-notes-hash: func() -> word; - /// Creates a new note. - /// asset is the asset to be included in the note. - /// tag is the tag to be included in the note. - /// recipient is the recipient of the note. - /// Returns the id of the created note. - create-note: func(asset: core-asset, tag: tag, recipient: recipient) -> note-id; -} - -/// Asset-related functions. These functions can only be called by faucet accounts. -interface asset { - use core-types.{felt, core-asset, tag, recipient, account-id, nonce, account-hash, storage-value, storage-root, account-code-root, vault-commitment, block-hash, word}; - - /// Builds a fungible asset for the specified fungible faucet and amount. - /// faucet_id is the faucet to create the asset for. - /// amount is the amount of the asset to create. - /// Returns the created asset. - build-fungible-asset: func(faucet-id: account-id, amount: felt) -> core-asset; - /// Creates a fungible asset for the faucet the transaction is being - /// executed against. - /// amount is the amount of the asset to create. - /// Returns the created asset. - create-fungible-asset: func(amount: felt) -> core-asset; - /// Builds a non-fungible asset for the specified non-fungible faucet and - /// data-hash. - /// faucet_id is the faucet to create the asset for. - /// data-hash is the data hash of the non-fungible asset to build. - /// Returns the created asset. - build-non-fungible-asset: func(faucet-id: account-id, data-hash: word) -> core-asset; - /// Creates a non-fungible asset for the faucet the transaction is being executed against. - /// data-hash is the data hash of the non-fungible asset to create. - /// Returns the created asset. - create-non-fungible-asset: func(data-hash: word) -> core-asset; -} - - -/// Faucet-related functions. These functions can only be called by faucet accounts. -interface faucet { - use core-types.{felt, core-asset, tag, recipient, account-id, nonce, account-hash, storage-value, storage-root, account-code-root, vault-commitment, block-hash, word}; - - /// Mint an asset from the faucet transaction is being executed against. - /// Returns the minted asset. - mint: func(asset: core-asset) -> core-asset; - /// Burn an asset from the faucet transaction is being executed against. - /// Returns the burned asset. - burn: func(asset: core-asset) -> core-asset; - /// Returns the total issuance of the fungible faucet the transaction is - /// being executed against. Panics if the transaction is not being executed - /// against a fungible faucet. - get-total-issuance: func() -> felt; - -} - - -/// High-level representation of core types -interface types { - use core-types.{felt, account-id, word, core-asset}; - - /// A fungible asset - record fungible-asset { - /// Faucet ID of the faucet which issued the asset as well as the asset amount. - asset: account-id, - /// Asset amount is guaranteed to be 2^63 - 1 or smaller. - amount: u64 - } - - /// A commitment to a non-fungible asset. - /// - /// A non-fungible asset consists of 4 field elements which are computed by hashing asset data - /// (which can be of arbitrary length) to produce: [d0, d1, d2, d3]. We then replace d1 with the - /// faucet_id that issued the asset: [d0, faucet_id, d2, d3]. We then set the most significant bit - /// of the most significant element to ZERO. - record non-fungible-asset { - inner: word, - } - - /// A fungible or a non-fungible asset. - variant asset { - fungible(fungible-asset), - non-fungible(non-fungible-asset), - } - - /// Converts a core asset to a an asset representation. - from-core-asset: func(core-asset: core-asset) -> asset; - /// Converts an asset to a core asset representation. - to-core-asset: func(asset: asset) -> core-asset; -} - - -/// Note script interface that is expected to be implemented by the note script. -interface note-script { - note-script: func(); -} - -world base-world { - export types; - export core-types; -}