From 2802aa788a333d5a592bf28364a3a703f0f2f4e5 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Mon, 14 Oct 2024 12:37:39 +0300 Subject: [PATCH] fix: include `account` module in `MidenTxKernelLibrary`; Build MASM for the basic wallet Rust SDK test. --- sdk/base-sys/build.rs | 10 +- sdk/base-sys/masm/{tx => miden}/account.masm | 0 sdk/base-sys/masm/{tx => miden}/tx.masm | 0 sdk/base-sys/src/masl/tx.rs | 5 +- .../expected/rust_sdk/basic_wallet.masm | 2967 +++++++++++++++++ tests/integration/src/compiler_test.rs | 6 +- 6 files changed, 2976 insertions(+), 12 deletions(-) rename sdk/base-sys/masm/{tx => miden}/account.masm (100%) rename sdk/base-sys/masm/{tx => miden}/tx.masm (100%) create mode 100644 tests/integration/expected/rust_sdk/basic_wallet.masm diff --git a/sdk/base-sys/build.rs b/sdk/base-sys/build.rs index d4a90c4a0..e12954962 100644 --- a/sdk/base-sys/build.rs +++ b/sdk/base-sys/build.rs @@ -16,14 +16,14 @@ fn main() { let source_manager = Arc::new(miden_assembly::DefaultSourceManager::default()); let namespace = "miden".parse::().expect("invalid base namespace"); - let tx_asm_dir = Path::new(manifest_dir).join("masm").join("tx"); + let asm_dir = Path::new(manifest_dir).join("masm").join("miden"); let asm = Assembler::new(source_manager); - let txlib = CompiledLibrary::from_dir(tx_asm_dir, namespace, asm).unwrap(); - let tx_masl_path = build_dir + let lib = CompiledLibrary::from_dir(asm_dir, namespace, asm).unwrap(); + let masl_path = build_dir .join("assets") - .join("tx") + .join("miden") .with_extension(CompiledLibrary::LIBRARY_EXTENSION); - txlib.write_to_file(tx_masl_path).into_diagnostic().unwrap(); + lib.write_to_file(masl_path).into_diagnostic().unwrap(); } #[cfg(not(feature = "masl-lib"))] diff --git a/sdk/base-sys/masm/tx/account.masm b/sdk/base-sys/masm/miden/account.masm similarity index 100% rename from sdk/base-sys/masm/tx/account.masm rename to sdk/base-sys/masm/miden/account.masm diff --git a/sdk/base-sys/masm/tx/tx.masm b/sdk/base-sys/masm/miden/tx.masm similarity index 100% rename from sdk/base-sys/masm/tx/tx.masm rename to sdk/base-sys/masm/miden/tx.masm diff --git a/sdk/base-sys/src/masl/tx.rs b/sdk/base-sys/src/masl/tx.rs index 080087da7..7d87b8eb9 100644 --- a/sdk/base-sys/src/masl/tx.rs +++ b/sdk/base-sys/src/masl/tx.rs @@ -17,8 +17,9 @@ impl From for CompiledLibrary { impl Default for MidenTxKernelLibrary { fn default() -> Self { - let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/tx.masl")); - let contents = CompiledLibrary::read_from_bytes(bytes).expect("failed to read std masl!"); + let bytes = include_bytes!(concat!(env!("OUT_DIR"), "/assets/miden.masl")); + let contents = + CompiledLibrary::read_from_bytes(bytes).expect("failed to read Miden tx kernel masl!"); Self(contents) } } diff --git a/tests/integration/expected/rust_sdk/basic_wallet.masm b/tests/integration/expected/rust_sdk/basic_wallet.masm new file mode 100644 index 000000000..773e20ada --- /dev/null +++ b/tests/integration/expected/rust_sdk/basic_wallet.masm @@ -0,0 +1,2967 @@ +# mod basic_wallet + +use.intrinsics::mem +use.miden::tx +use.miden::account +use.std::crypto::hashes::blake3 + +export.cabi_realloc + exec.cabi_realloc_wit_bindgen_0_28_0 +end + + +export.cabi_realloc_wit_bindgen_0_28_0 + exec."wit_bindgen_rt::cabi_realloc" +end + + +export."wit_bindgen_rt::cabi_realloc" + dup.1 + neq.0 + if.true + exec."__rust_realloc" + dup.0 + neq.0 + if.true + + else + push.0 assert + end + else + drop + drop + dup.1 + eq.0 + neq.0 + if.true + swap.1 drop + else + swap.1 + exec."__rust_alloc" + dup.0 + neq.0 + if.true + + else + push.0 assert + end + end + end +end + + +export."cabi_post_miden:basic-wallet/basic-wallet@1.0.0#test-stdlib" + dropw +end + + +export."miden:basic-wallet/basic-wallet@1.0.0#test-stdlib" + mem_load.0x00011000 + push.96 + dup.1 + swap.1 + u32wrapping_sub + push.4294967264 + u32and + push.1114112 + dup.1 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + add.24 + u32assert + exec."wit_bindgen_rt::run_ctors_once" + dup.1 + add.20 + u32assert + dup.1 + dup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + dup.6 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + push.32 + movup.4 + swap.1 + neq + neq.0 + if.true + push.0 assert + else + dup.0 + add.28 + u32assert + push.0 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.20 + dup.2 + swap.1 + u32wrapping_add + exec." as core::ops::drop::Drop>::drop" + push.20 + dup.2 + swap.1 + u32wrapping_add + exec." as core::ops::drop::Drop>::drop" + push.32 + dup.2 + swap.1 + u32wrapping_add + dup.4 + add.28 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.5 + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.6 + add.20 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.7 + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.8 + add.12 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.9 + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.10 + add.4 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + movup.11 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + exec.::std::crypto::hashes::blake3::hash_1to1 + dup.8 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.7 + add.4 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.6 + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.5 + add.12 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.4 + add.16 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.3 + add.20 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.2 + add.24 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + add.28 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.1 + add.84 + u32assert + dup.2 + add.88 + u32assert + push.0 + push.32 + push.84 + dup.6 + swap.1 + u32wrapping_add + exec."alloc::raw_vec::RawVec::try_allocate_in" + dup.1 + u32mod.4 + assertz.err=250 + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + swap.1 + u32mod.4 + assertz.err=250 + movup.2 + u32mod.4 + assertz.err=250 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + push.1 + eq + neq.0 + if.true + movup.2 + drop + swap.1 + add.92 + u32assert + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + movup.2 + exec."alloc::raw_vec::handle_error" + u32mod.4 + assertz.err=250 + push.0 + assert + else + dup.1 + add.92 + u32assert + dup.2 + add.56 + u32assert + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.4 + add.48 + u32assert + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_dw + push.24 + dup.4 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_dw + dup.5 + add.40 + u32assert + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_dw + push.16 + dup.5 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_dw + dup.6 + add.32 + u32assert + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_dw + push.8 + dup.6 + swap.1 + u32wrapping_add + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_dw + dup.7 + add.92 + u32assert + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_dw + dup.6 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_dw + dup.8 + add.88 + u32assert + push.32 + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.9 + add.84 + u32assert + dup.1 + movup.7 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + movup.9 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.0 + add.1048608 + u32assert + dup.9 + add.8 + u32assert + push.84 + dup.11 + swap.1 + u32wrapping_add + push.8 + movup.12 + swap.1 + u32wrapping_add + exec."alloc::vec::Vec::into_boxed_slice" + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_dw + dup.3 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_dw + push.1114112 + movup.11 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + u32mod.4 + assertz.err=250 + u32mod.8 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.8 + assertz.err=250 + u32mod.8 + assertz.err=250 + u32mod.8 + assertz.err=250 + u32mod.8 + assertz.err=250 + u32mod.4 + assertz.err=250 + push.1048608 + end + end +end + + +export." as core::ops::drop::Drop>::drop" + dropw +end + + +export."alloc::vec::Vec::into_boxed_slice" + dup.1 + add.8 + u32assert + dup.2 + mem_load.0x00011000 + push.16 + u32wrapping_sub + push.1114112 + dup.1 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.2 + u32mod.4 + assertz.err=250 + dup.1 + u32mod.4 + assertz.err=250 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + movup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + movup.2 + swap.1 + u32lte + push.0 + push.0 + push.4294967294 + movup.2 + cdrop + u32or + neq.0 + if.true + dup.2 + add.4 + u32assert + movup.3 + movup.4 + add.4 + u32assert + dup.2 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.4 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + dup.1 + add.8 + u32assert + push.8 + dup.3 + swap.1 + u32wrapping_add + dup.5 + movup.2 + swap.3 + movdn.2 + swap.1 + exec."alloc::raw_vec::RawVec::shrink_unchecked" + dup.0 + u32mod.4 + assertz.err=250 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + push.2147483649 + neq + neq.0 + if.true + push.0 assert + else + dup.1 + add.4 + u32assert + dup.3 + add.8 + u32assert + movup.3 + movup.4 + add.4 + u32assert + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.5 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + swap.1 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + end +end + + +export."alloc::raw_vec::RawVec::shrink_unchecked" + dup.1 + dup.0 + u32mod.4 + assertz.err=250 + push.2147483649 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + eq.0 + neq.0 + if.true + movup.3 + swap.1 + drop + drop + dup.1 + add.4 + u32assert + movup.2 + dup.1 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + movup.3 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + swap.1 + drop + dup.2 + add.4 + u32assert + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + swap.1 + u32mod.4 + assertz.err=250 + dup.4 + neq.0 + if.true + push.1 + push.1 + dup.6 + swap.1 + swap.2 + swap.4 + swap.1 + swap.3 + exec."__rust_realloc" + dup.0 + eq.0 + neq.0 + if.true + movup.3 + swap.1 + drop + drop + dup.1 + add.4 + u32assert + movup.2 + dup.1 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + movup.3 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + swap.1 + drop + dup.2 + movup.3 + add.4 + u32assert + dup.1 + dup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.3 + add.4 + u32assert + dup.1 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.3 + dup.1 + movup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.2147483649 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + else + dup.3 + push.1 + movdn.2 + movdn.3 + exec."::deallocate" + movup.2 + add.4 + u32assert + dup.1 + dup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.2 + add.4 + u32assert + push.1 + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.3 + dup.1 + movup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.2147483649 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + end +end + + +export."alloc::raw_vec::RawVec::try_allocate_in" + mem_load.0x00011000 + push.16 + u32wrapping_sub + push.1114112 + dup.1 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.2 + neq.0 + if.true + push.4294967295 + dup.3 + swap.1 + exec.::intrinsics::i32::is_gt + dup.0 + neq.0 + if.true + movup.4 + neq.0 + if.true + dup.1 + push.1 + dup.3 + dup.3 + dup.7 + swap.2 + exec."alloc::alloc::Global::alloc_impl" + dup.0 + u32mod.4 + assertz.err=250 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + eq.0 + neq.0 + if.true + drop + dup.2 + add.8 + u32assert + dup.3 + add.4 + u32assert + dup.1 + movup.6 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.4 + dup.1 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.1 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.4 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + swap.1 + drop + dup.2 + add.8 + u32assert + dup.3 + add.4 + u32assert + dup.1 + movup.3 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.3 + dup.1 + movup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.0 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.4 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + else + dup.1 + add.8 + u32assert + push.8 + dup.3 + swap.1 + u32wrapping_add + dup.2 + dup.6 + swap.2 + exec."::allocate" + dup.0 + u32mod.4 + assertz.err=250 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + eq.0 + neq.0 + if.true + drop + dup.2 + add.8 + u32assert + dup.3 + add.4 + u32assert + dup.1 + movup.6 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.4 + dup.1 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.1 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.4 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + swap.1 + drop + dup.2 + add.8 + u32assert + dup.3 + add.4 + u32assert + dup.1 + movup.3 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.3 + dup.1 + movup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.0 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.4 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + end + else + drop + movup.2 + drop + movup.2 + drop + dup.1 + add.4 + u32assert + movup.2 + push.0 + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.1 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.3 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + else + swap.3 + movup.2 + drop + drop + dup.0 + add.4 + u32assert + swap.1 + push.1.0 + dup.3 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_dw + push.0 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.3 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end +end + + +export."::allocate" + mem_load.0x00011000 + push.16 + u32wrapping_sub + push.1114112 + dup.1 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.1 + dup.1 + add.8 + u32assert + push.0 + push.8 + dup.4 + swap.1 + u32wrapping_add + movup.2 + swap.7 + movdn.2 + swap.1 + swap.3 + swap.6 + swap.1 + exec."alloc::alloc::Global::alloc_impl" + swap.1 + add.4 + u32assert + dup.1 + add.12 + u32assert + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + push.16 + movup.3 + swap.1 + u32wrapping_add + push.1114112 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + u32mod.4 + assertz.err=250 + swap.1 + u32mod.4 + assertz.err=250 + swap.1 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 +end + + +export."alloc::alloc::Global::alloc_impl" + dup.2 + eq.0 + neq.0 + if.true + movup.3 + drop + dup.0 + add.4 + u32assert + swap.1 + dup.1 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + movup.3 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + movup.3 + neq.0 + if.true + dup.0 + add.4 + u32assert + dup.3 + swap.1 + swap.3 + swap.1 + exec."__rust_alloc_zeroed" + swap.1 + dup.2 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + movup.2 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + else + dup.0 + add.4 + u32assert + dup.3 + swap.1 + swap.3 + swap.1 + exec."__rust_alloc" + swap.1 + dup.2 + movup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + movup.2 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + end + end +end + + +export."alloc::raw_vec::handle_error" + push.0 assert +end + + +export." as core::ops::drop::Drop>::drop" + dup.0 + dup.0 + u32mod.4 + assertz.err=250 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + eq.0 + neq.0 + if.true + dropw dropw + else + swap.1 + add.4 + u32assert + push.1 + dup.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + movup.2 + swap.3 + movdn.2 + exec."::deallocate" + u32mod.4 + assertz.err=250 + end +end + + +export."::deallocate" + dup.2 + eq.0 + neq.0 + if.true + dropw dropw dropw + else + movup.2 swap.1 exec."__rust_dealloc" + end +end + + +export."miden:basic-wallet/basic-wallet@1.0.0#test-felt-intrinsics" + exec."wit_bindgen_rt::run_ctors_once" swap.1 add +end + + +export."miden:basic-wallet/basic-wallet@1.0.0#send-asset" + mem_load.0x00011000 + push.96 + dup.1 + swap.1 + u32wrapping_sub + push.4294967264 + u32and + push.1114112 + dup.1 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + add.12 + u32assert + exec."wit_bindgen_rt::run_ctors_once" + dup.1 + add.8 + u32assert + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.2 + add.4 + u32assert + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.3 + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.4 + add.44 + u32assert + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.5 + add.40 + u32assert + dup.1 + movup.14 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.6 + add.36 + u32assert + dup.1 + movup.14 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.7 + add.32 + u32assert + dup.1 + movup.14 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.0 + movup.13 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + push.64 + dup.9 + swap.1 + u32wrapping_add + dup.9 + swap.1 + exec."miden_base_sys::bindings::tx::remove_asset" + push.32 + dup.9 + swap.1 + u32wrapping_add + push.64 + movup.10 + swap.1 + u32wrapping_add + movup.2 + swap.12 + movdn.2 + swap.1 + swap.3 + swap.11 + swap.1 + exec."miden_base_sys::bindings::tx::create_note" + drop + push.1114112 + movup.7 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + movup.7 + u32mod.4 + assertz.err=250 + movup.6 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 +end + + +export."miden_base_sys::bindings::tx::remove_asset" + dup.1 + add.12 + u32assert + dup.2 + add.8 + u32assert + dup.3 + add.4 + u32assert + movup.4 + movup.4 + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + exec.::miden::account::remove_asset + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.3 + add.4 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.2 + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + swap.1 + add.12 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + movup.3 + u32mod.4 + assertz.err=250 + movup.2 + u32mod.4 + assertz.err=250 + swap.1 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 +end + + +export."miden_base_sys::bindings::tx::create_note" + dup.3 + add.12 + u32assert + dup.4 + add.8 + u32assert + dup.5 + add.4 + u32assert + movup.6 + dup.4 + add.12 + u32assert + dup.5 + add.8 + u32assert + dup.6 + add.4 + u32assert + movup.7 + dup.7 + u32mod.4 + assertz.err=250 + dup.6 + u32mod.4 + assertz.err=250 + dup.5 + u32mod.4 + assertz.err=250 + dup.4 + u32mod.4 + assertz.err=250 + dup.3 + u32mod.4 + assertz.err=250 + dup.2 + u32mod.4 + assertz.err=250 + dup.1 + u32mod.4 + assertz.err=250 + dup.0 + u32mod.4 + assertz.err=250 + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.7 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + movup.5 + swap.7 + swap.9 + movdn.5 + movup.4 + swap.6 + swap.8 + movdn.4 + exec.::miden::tx::create_note +end + + +export."miden:basic-wallet/basic-wallet@1.0.0#receive-asset" + mem_load.0x00011000 + push.64 + dup.1 + swap.1 + u32wrapping_sub + push.4294967264 + u32and + push.1114112 + dup.1 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + add.12 + u32assert + exec."wit_bindgen_rt::run_ctors_once" + dup.1 + add.8 + u32assert + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.2 + add.4 + u32assert + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.3 + dup.1 + movup.8 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.0 + movup.7 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + push.32 + dup.5 + swap.1 + u32wrapping_add + movup.5 + swap.1 + exec."miden_base_sys::bindings::tx::add_asset" + push.1114112 + movup.5 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 +end + + +export."miden_base_sys::bindings::tx::add_asset" + dup.1 + add.12 + u32assert + dup.2 + add.8 + u32assert + dup.3 + add.4 + u32assert + movup.4 + movup.4 + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_felt + exec.::miden::account::add_asset + dup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.3 + add.4 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + dup.2 + add.8 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + swap.1 + add.12 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_felt + movup.3 + u32mod.4 + assertz.err=250 + movup.2 + u32mod.4 + assertz.err=250 + swap.1 + u32mod.4 + assertz.err=250 + u32mod.4 + assertz.err=250 +end + + +export."wit_bindgen_rt::run_ctors_once" + push.0 + add.1048621 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + push.128 + u32and + neq.0 + if.true + + else + exec."__wasm_call_ctors" + push.1 + push.128 + u32and + push.0 + add.1048621 + u32assert + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + dup.2 + dup.2 + dup.2 + exec.::intrinsics::mem::load_sw + push.4294967040 + u32and + movup.5 + u32or + movdn.4 + exec.::intrinsics::mem::store_sw + end +end + + +export."__rust_alloc_zeroed" + push.1048616 + dup.1 + swap.2 + swap.3 + swap.1 + exec."::alloc" + dup.0 + eq.0 + neq.0 + if.true + swap.1 drop + else + push.0 + push.128 + u32and + movup.2 + dup.2 + push.0 + dup.2 + gte.0 + while.true + dup.1 + dup.1 + push.1 + u32overflowing_madd + assertz + dup.4 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + dup.2 + dup.2 + dup.2 + exec.::intrinsics::mem::load_sw + push.4294967040 + u32and + movup.5 + u32or + movdn.4 + exec.::intrinsics::mem::store_sw + u32wrapping_add.1 + dup.0 + dup.3 + u32gte + end + dropw + end +end + + +export."__rust_realloc" + push.1048616 + dup.4 + swap.2 + swap.4 + swap.1 + exec."::alloc" + dup.0 + eq.0 + neq.0 + if.true + movdn.3 drop drop drop + else + dup.1 + dup.4 + u32lt + push.0 + push.0 + push.4294967294 + movup.2 + cdrop + u32or + neq.0 + swap.1 + swap.4 + swap.2 + swap.1 + cdrop + dup.2 + movup.2 + push.0 + dup.3 + gte.0 + while.true + dup.2 + dup.1 + push.1 + u32overflowing_madd + assertz + dup.2 + dup.2 + push.1 + u32overflowing_madd + assertz + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + push.128 + u32and + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + dup.2 + dup.2 + dup.2 + exec.::intrinsics::mem::load_sw + push.4294967040 + u32and + movup.5 + u32or + movdn.4 + exec.::intrinsics::mem::store_sw + u32wrapping_add.1 + dup.0 + dup.4 + u32gte + end + dropw + end +end + + +export."__rust_dealloc" + dropw dropw dropw +end + + +export."__rust_alloc" + push.1048616 + movup.2 + swap.1 + exec."::alloc" +end + + +export."::alloc" + push.32 + dup.2 + push.32 + u32gt + push.0 + push.0 + push.4294967294 + movup.2 + cdrop + u32or + neq.0 + movup.3 + swap.1 + cdrop + dup.0 + u32popcnt + push.1 + neq + neq.0 + if.true + push.0 assert + else + push.2147483648 + dup.1 + u32wrapping_sub + dup.3 + u32lt + push.0 + push.0 + push.4294967294 + movup.2 + cdrop + u32or + neq.0 + if.true + push.0 assert + else + dup.1 + dup.0 + u32mod.4 + assertz.err=250 + dup.1 + swap.1 + swap.4 + u32wrapping_add + push.4294967295 + u32wrapping_add + push.0 + dup.2 + u32wrapping_sub + u32and + push.0 + movup.4 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + neq.0 + if.true + dup.3 + dup.0 + u32mod.4 + assertz.err=250 + push.268435456 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + swap.1 + swap.2 + swap.1 + u32wrapping_sub + dup.3 + u32lt + push.0 + push.0 + push.4294967294 + movup.2 + cdrop + u32or + neq.0 + if.true + drop + movdn.3 + drop + drop + drop + else + swap.1 + drop + movup.3 + dup.1 + swap.1 + swap.3 + u32wrapping_add + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + u32mod.4 + assertz.err=250 + swap.1 + u32wrapping_add + end + else + dup.3 + exec.::intrinsics::mem::heap_base + dup.5 + exec.::intrinsics::mem::memory_size + push.16 + u32shl + movup.2 + swap.1 + u32wrapping_add + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + dup.0 + u32mod.4 + assertz.err=250 + swap.1 + u32mod.4 + assertz.err=250 + push.268435456 + swap.1 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::load_sw + dup.0 + swap.1 + swap.2 + swap.1 + u32wrapping_sub + dup.3 + u32lt + push.0 + push.0 + push.4294967294 + movup.2 + cdrop + u32or + neq.0 + if.true + drop + movdn.3 + drop + drop + drop + else + swap.1 + drop + movup.3 + dup.1 + swap.1 + swap.3 + u32wrapping_add + dup.2 + dup.0 + u32mod.16 + dup.0 + u32mod.4 + swap.1 + u32div.4 + movup.2 + u32div.16 + exec.::intrinsics::mem::store_sw + swap.1 + u32mod.4 + assertz.err=250 + swap.1 + u32wrapping_add + end + end + end + end +end + + +export."basic_wallet::bindings::__link_custom_section_describing_imports" + +end + + +export."__wasm_call_ctors" + +end + + diff --git a/tests/integration/src/compiler_test.rs b/tests/integration/src/compiler_test.rs index fd0ce14b0..f89ea49bd 100644 --- a/tests/integration/src/compiler_test.rs +++ b/tests/integration/src/compiler_test.rs @@ -659,6 +659,7 @@ impl CompilerTestBuilder { CargoTest::new(name, cargo_project_folder.as_ref().to_path_buf()), )); builder.with_wasm_translation_config(config); + builder.with_midenc_flags(["--target".into(), "rollup".into()]); builder } @@ -1227,11 +1228,6 @@ impl CompilerTest { .unwrap_or_else(|err| panic!("{err}")) .unwrap_mast(); assert!(src.is_some(), "failed to pretty print masm artifact"); - assert!(masm_program.is_some(), "failed to capture masm artifact"); - assert!( - package.is_program(), - "expected to have produced an executable program, not a library" - ); self.masm_src = src; self.ir_masm_program = masm_program.map(Ok); self.package = Some(Ok(Arc::new(package)));