From ba3e71ba8998d3f66b73c12cb139231a7a03c181 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Mon, 29 Jul 2024 12:50:14 +0300 Subject: [PATCH 1/3] chore: add test coverage reporting job to CI --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ Makefile.toml | 24 ++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 24bc7be2c..a5b3f7fc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,3 +128,34 @@ jobs: with: command: make args: check-format + + test_coverage: + name: test-coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ env.CARGO_MAKE_TOOLCHAIN }} + override: true + - name: Cache Cargo + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + key: ${{ github.workflow }}-${{ github.job }}-toolchain-${{ env.CARGO_MAKE_TOOLCHAIN }} + - name: Install cargo-make + uses: actions-rs/cargo@v1 + with: + command: install + args: cargo-make + - name: Run tests and generate code coverage + run: | + cargo make test-rust-cov + - name: Push code coverage results to coveralls.io + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: ./lcov.info diff --git a/Makefile.toml b/Makefile.toml index c5fdaf7b7..03d1d955b 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -214,6 +214,12 @@ description = "Install cargo-component extension" command = "cargo" args = ["install", "cargo-component@0.7.0"] +[tasks.install-cargo-tarpaulin] +category = "Test" +description = "Install cargo-tarpaulin extension" +command = "cargo" +args = ["install", "cargo-tarpaulin"] + [tasks.test-rust] category = "Test" description = "Runs tests written in Rust" @@ -246,6 +252,24 @@ args = [ ] dependencies = ["litcheck"] +[tasks.test-rust-cov] +category = "Test" +description = "Runs tests written in Rust and generates code coverage report" +command = "cargo" +args = [ + "tarpaulin", + "--timeout=360", + "--out", + "lcov", +] +dependencies = [ + "install-wasm-target", + "install-wasm-wasi-target", + "install-rust-src", + "install-cargo-component", + "install-cargo-tarpaulin", +] + [tasks.litcheck] category = "Test" description = "Set up the litcheck utility" From 33aa62f579e31a5038db717506756d84d14b11a9 Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Mon, 29 Jul 2024 14:50:57 +0300 Subject: [PATCH 2/3] chore: switch to nightly-2024-05-15 and Update cargo-component to 0.14.0 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- Cargo.lock | 88 +- Makefile.toml | 2 +- codegen/masm/src/codegen/emitter.rs | 2 +- codegen/masm/src/codegen/scheduler.rs | 27 +- frontend-wasm/src/component/info.rs | 8 + frontend-wasm/src/module/module_env.rs | 4 +- hir/src/asm/display.rs | 1 + rust-toolchain.toml | 2 +- .../abi_transform_tx_kernel_get_inputs_4.hir | 103 +- .../abi_transform_tx_kernel_get_inputs_4.masm | 100 +- .../abi_transform_tx_kernel_get_inputs_4.wat | 67 +- .../components/add_wasm_component.hir | 989 +++---- .../components/add_wasm_component.wat | 611 ++-- .../components/inc_wasm_component.hir | 989 +++---- .../components/inc_wasm_component.wat | 615 ++-- .../miden_sdk_account_test.hir | 812 +++--- .../miden_sdk_account_test.wat | 285 +- .../rust_sdk_basic_wallet.hir | 156 +- .../rust_sdk_basic_wallet.wat | 48 +- .../wit_sdk_basic_wallet/basic_wallet.hir | 1082 ++++---- .../wit_sdk_basic_wallet/basic_wallet.wat | 673 ++--- .../basic_wallet_p2id_note.hir | 1257 +++++---- .../basic_wallet_p2id_note.wat | 667 ++--- .../wit_sdk_basic_wallet/miden_sdk.wat | 637 ++--- tests/integration/src/cargo_proj/mod.rs | 3 - .../src/rust_masm_tests/components.rs | 8 +- .../rust-sdk/account-test/Cargo.lock | 6 +- .../wit-sdk/basic-wallet/Cargo.lock | 17 +- .../wit-sdk/basic-wallet/Cargo.toml | 2 +- .../wit-sdk/basic-wallet/src/bindings.rs | 2245 ++++++++------- .../wit-sdk/basic-wallet/src/lib.rs | 12 +- .../wit-sdk/p2id-note/Cargo.lock | 17 +- .../wit-sdk/p2id-note/Cargo.toml | 2 +- .../wit-sdk/p2id-note/src/bindings.rs | 2470 +++++++++-------- .../wit-sdk/p2id-note/src/lib.rs | 19 +- tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock | 17 +- tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml | 2 +- .../wit-sdk/sdk/src/bindings.rs | 777 +++--- tests/rust-apps-wasm/wit-sdk/sdk/src/lib.rs | 12 +- tools/cargo-miden/Cargo.toml | 2 +- tools/cargo-miden/README.md | 4 +- 43 files changed, 7580 insertions(+), 7264 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5b3f7fc4..6a6d3e0d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: - '*.md' env: - CARGO_MAKE_TOOLCHAIN: nightly-2024-03-10 + CARGO_MAKE_TOOLCHAIN: nightly-2024-05-15 jobs: compiler: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e49ad591a..aee729265 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,7 @@ on: - main env: - CARGO_MAKE_TOOLCHAIN: nightly-2024-03-10 + CARGO_MAKE_TOOLCHAIN: nightly-2024-05-15 jobs: release-plz: diff --git a/Cargo.lock b/Cargo.lock index b1fed33fc..907ff1b59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,9 +113,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" @@ -219,7 +219,7 @@ dependencies = [ "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-lite 2.2.0", "slab", ] @@ -520,7 +520,7 @@ dependencies = [ "async-channel", "async-lock 3.3.0", "async-task", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-io", "futures-lite 2.2.0", "piper", @@ -647,10 +647,11 @@ dependencies = [ [[package]] name = "cargo-generate" -version = "0.20.0" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa7015584550945f11fdfb7af113d30e2727468ec281c1d7f28cc1019196c25d" +checksum = "b611d852b731eaaf84d3dfed2cefc1468f772b403ae0499fd3436a6a2b42b273" dependencies = [ + "anstyle", "anyhow", "auth-git2", "clap", @@ -681,6 +682,7 @@ dependencies = [ "serde", "tempfile", "thiserror", + "time", "toml", "walkdir", ] @@ -809,6 +811,7 @@ dependencies = [ "anstyle", "clap_lex", "strsim 0.11.1", + "terminal_size", ] [[package]] @@ -1399,9 +1402,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" @@ -1565,7 +1568,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -1647,9 +1650,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" dependencies = [ "bitflags 2.4.2", "libc", @@ -1662,9 +1665,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.1" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3a3bde455ad2ee8ba8a195745241ce0b770a8a26faae59fcf409d01b28c46" +checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2" dependencies = [ "bstr", "gix-date", @@ -1676,9 +1679,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62129c75e4b6229fe15fb9838cdc00c655e87105b651e4edd7c183fc5288b5d1" +checksum = "53fafe42957e11d98e354a66b6bd70aeea00faf2f62dd11164188224a507c840" dependencies = [ "bstr", "gix-config-value", @@ -1710,9 +1713,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180b130a4a41870edfbd36ce4169c7090bca70e195da783dea088dd973daa59c" +checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" dependencies = [ "bstr", "itoa", @@ -1722,9 +1725,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.38.1" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4254037d20a247a0367aa79333750146a369719f0c6617fec4f5752cc62b37" +checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" dependencies = [ "gix-hash", "gix-trace", @@ -1737,10 +1740,11 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634b8a743b0aae03c1a74ee0ea24e8c5136895efac64ce52b3ea106e1c6f0613" +checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" dependencies = [ + "fastrand 2.1.0", "gix-features", "gix-utils", ] @@ -1769,9 +1773,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "13.1.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c359f81f01b8352063319bcb39789b7ea0887b406406381106e38c4a34d049" +checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" dependencies = [ "gix-tempfile", "gix-utils", @@ -1780,9 +1784,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.1" +version = "0.42.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d4f8efae72030df1c4a81d02dbe2348e748d9b9a11e108ed6efbd846326e051" +checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" dependencies = [ "bstr", "gix-actor", @@ -1812,9 +1816,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.43.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4aba68b925101cb45d6df328979af0681364579db889098a0de75b36c77b65" +checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" dependencies = [ "gix-actor", "gix-date", @@ -1846,9 +1850,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "13.1.1" +version = "14.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a761d76594f4443b675e85928e4902dec333273836bd386906f01e7e346a0d11" +checksum = "006acf5a613e0b5cf095d8e4b3f48c12a60d9062aa2b2dd105afaf8344a5600c" dependencies = [ "gix-fs", "libc", @@ -1865,19 +1869,19 @@ checksum = "9b838b2db8f62c9447d483a4c28d251b67fee32741a82cb4d35e9eb4e9fdc5ab" [[package]] name = "gix-utils" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066432d4c277f9877f091279a597ea5331f68ca410efc874f0bdfb1cd348f92" +checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.1.0", "unicode-normalization", ] [[package]] name = "gix-validate" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e39fc6e06044985eac19dd34d474909e517307582e462b2eb4c8fa51b6241545" +checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" dependencies = [ "bstr", "thiserror", @@ -2383,9 +2387,9 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libgit2-sys" -version = "0.16.1+1.7.1" +version = "0.17.0+1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" dependencies = [ "cc", "libc", @@ -3525,7 +3529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.0.1", + "fastrand 2.1.0", "futures-io", ] @@ -3960,9 +3964,9 @@ dependencies = [ [[package]] name = "rhai" -version = "1.17.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6273372244d04a8a4b0bec080ea1e710403e88c5d9d83f9808b2bfa64f0982a" +checksum = "61797318be89b1a268a018a92a7657096d83f3ecb31418b9e9c16dcbb043b702" dependencies = [ "ahash 0.8.11", "bitflags 2.4.2", @@ -3977,9 +3981,9 @@ dependencies = [ [[package]] name = "rhai_codegen" -version = "2.0.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db7f8dc4c9d48183a17ce550574c42995252b82d267eaca3fcd1b979159856c" +checksum = "a5a11a05ee1ce44058fa3d5961d05194fdbe3ad6b40f904af764d81b86450e6b" dependencies = [ "proc-macro2", "quote", @@ -4588,7 +4592,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", + "fastrand 2.1.0", "rustix 0.38.32", "windows-sys 0.52.0", ] diff --git a/Makefile.toml b/Makefile.toml index 03d1d955b..f9a50d37c 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -212,7 +212,7 @@ args = ["component", "add", "rust-src"] category = "Test" description = "Install cargo-component extension" command = "cargo" -args = ["install", "cargo-component@0.7.0"] +args = ["install", "cargo-component@0.14.0"] [tasks.install-cargo-tarpaulin] category = "Test" diff --git a/codegen/masm/src/codegen/emitter.rs b/codegen/masm/src/codegen/emitter.rs index a12f79321..1d3698e12 100644 --- a/codegen/masm/src/codegen/emitter.rs +++ b/codegen/masm/src/codegen/emitter.rs @@ -188,7 +188,7 @@ impl<'b, 'f: 'b> BlockEmitter<'b, 'f> { // Continue normally, by emitting the contents of the block based on the given schedule for op in block_schedule.iter() { match op { - ScheduleOp::Init(_) | ScheduleOp::Enter(_) | ScheduleOp::Exit => continue, + ScheduleOp::Exit => continue, ScheduleOp::Inst(inst_info) => self.emit_inst(inst_info, tasks), ScheduleOp::Drop(value) => { let mut emitter = self.emitter(); diff --git a/codegen/masm/src/codegen/scheduler.rs b/codegen/masm/src/codegen/scheduler.rs index 73f374784..f36f74973 100644 --- a/codegen/masm/src/codegen/scheduler.rs +++ b/codegen/masm/src/codegen/scheduler.rs @@ -146,12 +146,6 @@ pub struct BlockInfo { pub source: hir::Block, /// The target MASM block which will be emitted from this info pub target: masm::BlockId, - /// The id of the last instruction in the source HIR block, - /// this is commonly used to check for liveness after the end - /// of a block - pub last_inst: hir::Inst, - /// The innermost loop to which this block belongs - pub innermost_loop: Option, /// If set, indicates that this block is the loop header /// for the specified loop. pub loop_header: Option, @@ -212,10 +206,6 @@ impl Schedule { /// optimizer would. #[derive(Debug, Clone)] pub enum ScheduleOp { - /// Always the first instruction in a schedule, represents entry into a function - Init(hir::Block), - /// Push the current block context on the context stack, and switch to the given block context - Enter(hir::Block), /// Pop the most recent block context from the context stack and switch to it Exit, /// Emit the given instruction, using the provided analysis @@ -233,7 +223,7 @@ pub enum Plan { /// This represents entering a block, so all further instructions /// are scheduled in the context of the given block until an ExitBlock /// meta-instruction is encountered. - Start(hir::Block), + Start, /// Schedule execution of an instruction's pre-requisites PreInst(Rc), /// Schedule execution of the given instruction @@ -280,16 +270,9 @@ impl<'a> Scheduler<'a> { pub fn build(mut self) -> Schedule { self.precompute_block_infos(); - let entry_block_id = self.f.dfg.entry_block(); let mut blockq = SmallVec::<[hir::Block; 8]>::from_slice(self.domtree.cfg_postorder()); while let Some(block_id) = blockq.pop() { - let is_entry_block = block_id == entry_block_id; let schedule = &mut self.schedule.block_schedules[block_id]; - if is_entry_block { - schedule.push(ScheduleOp::Init(block_id)); - } else { - schedule.push(ScheduleOp::Enter(block_id)); - } let block_info = self.schedule.block_infos.get(block_id).cloned().unwrap(); let block_scheduler = BlockScheduler { @@ -297,7 +280,7 @@ impl<'a> Scheduler<'a> { liveness: self.liveness, block_info, inst_infos: Default::default(), - worklist: SmallVec::from_iter([Plan::Start(block_id)]), + worklist: SmallVec::from_iter([Plan::Start]), }; block_scheduler.schedule(schedule); } @@ -318,8 +301,6 @@ impl<'a> Scheduler<'a> { // Set the controlling loop let loop_header = self.loops.is_loop_header(block_id); - let last_inst = self.f.dfg.last_inst(block_id).unwrap(); - let innermost_loop = self.loops.innermost_loop(block_id); let depgraph = build_dependency_graph(block_id, self.f, self.liveness); let treegraph = OrderedTreeGraph::new(&depgraph) .expect("unable to topologically sort treegraph for block"); @@ -327,8 +308,6 @@ impl<'a> Scheduler<'a> { let info = Rc::new(BlockInfo { source: block_id, target: masm_block_id, - last_inst, - innermost_loop, loop_header, depgraph, treegraph, @@ -353,7 +332,7 @@ impl<'a> BlockScheduler<'a> { // here, we will emit scheduling operations in "normal" order. while let Some(plan) = self.worklist.pop() { match plan { - Plan::Start(_) => self.visit_block(), + Plan::Start => self.visit_block(), Plan::Finish => { scheduled_ops.push(ScheduleOp::Exit); } diff --git a/frontend-wasm/src/component/info.rs b/frontend-wasm/src/component/info.rs index 3e4126c42..a4364b969 100644 --- a/frontend-wasm/src/component/info.rs +++ b/frontend-wasm/src/component/info.rs @@ -60,6 +60,7 @@ pub struct LinearComponentTranslation { /// /// NB: Lots of the component model is not yet implemented in the runtime so /// this is going to undergo a lot of churn. +#[allow(dead_code)] #[derive(Default, Debug)] pub struct LinearComponent { /// A list of typed values that this component imports. @@ -213,6 +214,7 @@ pub enum GlobalInitializer { /// Declares a new defined resource within this component. /// /// Contains information about the destructor, for example. + #[allow(dead_code)] Resource(Resource), } @@ -223,6 +225,7 @@ pub struct ExtractMemory { /// The index of the memory being defined. pub index: RuntimeMemoryIndex, /// Where this memory is being extracted from. + #[allow(dead_code)] pub export: CoreExport, } @@ -260,6 +263,7 @@ pub enum InstantiateModule { /// This is similar to `Upvar` but notably the imports are provided as a /// two-level named map since import resolution order needs to happen at /// runtime. + #[allow(dead_code)] Import(RuntimeImportIndex, IndexMap>), } @@ -344,6 +348,7 @@ pub enum ExportItem { } /// Possible exports from a component. +#[allow(dead_code)] #[derive(Debug, Clone)] pub enum Export { /// A lifted function being exported which is an adaptation of a core wasm @@ -369,6 +374,7 @@ pub enum Export { } /// Canonical ABI options associated with a lifted or lowered function. +#[allow(dead_code)] #[derive(Debug, Clone)] pub struct CanonicalOptions { /// The component instance that this bundle was associated with. @@ -402,6 +408,7 @@ pub enum StringEncoding { /// /// This will have the effect of initializing runtime state for this resource, /// namely the destructor is fetched and stored. +#[allow(dead_code)] #[derive(Debug)] pub struct Resource { /// The local index of the resource being defined. @@ -419,6 +426,7 @@ pub struct Resource { /// /// All trampolines have a core wasm function signature associated with them /// which is stored in the `Component::trampolines` array. +#[allow(dead_code)] #[derive(Debug)] pub enum Trampoline { /// Description of a lowered import used in conjunction with diff --git a/frontend-wasm/src/module/module_env.rs b/frontend-wasm/src/module/module_env.rs index f71a13b0b..4bd8bc496 100644 --- a/frontend-wasm/src/module/module_env.rs +++ b/frontend-wasm/src/module/module_env.rs @@ -654,7 +654,7 @@ impl<'a, 'data> ModuleEnvironment<'a, 'data> { wasmparser::Name::Global(names) => { for name in names { let Naming { index, name } = name?; - if index != u32::max_value() { + if index != u32::MAX { self.result .module .name_section @@ -666,7 +666,7 @@ impl<'a, 'data> ModuleEnvironment<'a, 'data> { wasmparser::Name::Data(names) => { for name in names { let Naming { index, name } = name?; - if index != u32::max_value() { + if index != u32::MAX { self.result .module .name_section diff --git a/hir/src/asm/display.rs b/hir/src/asm/display.rs index 3e8ea0d3e..d73293946 100644 --- a/hir/src/asm/display.rs +++ b/hir/src/asm/display.rs @@ -331,6 +331,7 @@ impl<'a> fmt::Display for DisplayOp<'a> { } } +#[allow(unused)] struct Address(u32); impl fmt::Display for Address { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7b699598c..d1d487928 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2024-03-10" +channel = "nightly-2024-05-15" components = ["rustfmt", "rust-src"] targets = ["wasm32-unknown-unknown"] profile = "minimal" diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir index bd3366937..ea2f47d94 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.hir @@ -773,68 +773,65 @@ (let (v9 i32) (const.i32 0)) (call #alloc::raw_vec::RawVec::try_allocate_in v7 v8 v9) (let (v10 u32) (cast v4)) - (let (v11 u32) (add.checked v10 12)) + (let (v11 u32) (add.checked v10 8)) (let (v12 u32) (mod.unchecked v11 2)) (assertz v12) (let (v13 (ptr i32)) (inttoptr v11)) (let (v14 i32) (load v13)) (let (v15 u32) (cast v4)) - (let (v16 u32) (add.checked v15 8)) + (let (v16 u32) (add.checked v15 4)) (let (v17 u32) (mod.unchecked v16 2)) (assertz v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 u32) (cast v4)) - (let (v21 u32) (add.checked v20 4)) - (let (v22 u32) (mod.unchecked v21 2)) - (assertz v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i1) (eq v24 0)) - (let (v26 i32) (zext v25)) - (let (v27 i1) (neq v26 0)) - (condbr v27 (block 3) (block 4))) + (let (v20 i1) (eq v19 0)) + (let (v21 i32) (zext v20)) + (let (v22 i1) (neq v21 0)) + (condbr v22 (block 2) (block 3))) - (block 1) + (block 1 + (ret)) (block 2 - (call #alloc::raw_vec::capacity_overflow) - (unreachable)) + (let (v28 u32) (cast v4)) + (let (v29 u32) (add.checked v28 12)) + (let (v30 u32) (mod.unchecked v29 2)) + (assertz v30) + (let (v31 (ptr i32)) (inttoptr v29)) + (let (v32 i32) (load v31)) + (let [(v33 i32) (v34 felt)] (call (#miden::note #get_inputs) v32)) + (let (v35 i32) (const.i32 0)) + (let (v36 u32) (cast v0)) + (let (v37 u32) (add.checked v36 8)) + (let (v38 u32) (mod.unchecked v37 2)) + (assertz v38) + (let (v39 (ptr i32)) (inttoptr v37)) + (store v39 v35) + (let (v40 u32) (cast v0)) + (let (v41 u32) (add.checked v40 4)) + (let (v42 u32) (mod.unchecked v41 2)) + (assertz v42) + (let (v43 (ptr i32)) (inttoptr v41)) + (store v43 v32) + (let (v44 u32) (cast v0)) + (let (v45 u32) (mod.unchecked v44 2)) + (assertz v45) + (let (v46 (ptr i32)) (inttoptr v44)) + (store v46 v14) + (let (v47 i32) (const.i32 16)) + (let (v48 i32) (add.wrapping v4 v47)) + (let (v49 (ptr i32)) (global.symbol #__stack_pointer)) + (store v49 v48) + (br (block 1))) (block 3 - (let [(v31 i32) (v32 felt)] (call (#miden::note #get_inputs) v14)) - (let (v33 i32) (const.i32 0)) - (let (v34 u32) (cast v0)) - (let (v35 u32) (add.checked v34 8)) - (let (v36 u32) (mod.unchecked v35 2)) - (assertz v36) - (let (v37 (ptr i32)) (inttoptr v35)) - (store v37 v33) - (let (v38 u32) (cast v0)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 2)) - (assertz v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (store v41 v14) - (let (v42 u32) (cast v0)) - (let (v43 u32) (mod.unchecked v42 2)) - (assertz v43) - (let (v44 (ptr i32)) (inttoptr v42)) - (store v44 v19) - (let (v45 i32) (const.i32 16)) - (let (v46 i32) (add.wrapping v4 v45)) - (let (v47 (ptr i32)) (global.symbol #__stack_pointer)) - (store v47 v46) - (ret)) - - (block 4 - (let (v28 i1) (eq v19 0)) - (let (v29 i32) (zext v28)) - (let (v30 i1) (neq v29 0)) - (condbr v30 (block 2) (block 5))) - - (block 5 - (call #alloc::alloc::handle_alloc_error v19 v14) + (let (v23 u32) (cast v4)) + (let (v24 u32) (add.checked v23 12)) + (let (v25 u32) (mod.unchecked v24 2)) + (assertz v25) + (let (v26 (ptr i32)) (inttoptr v24)) + (let (v27 i32) (load v26)) + (call #alloc::raw_vec::handle_error v14 v27) (unreachable)) ) @@ -956,7 +953,7 @@ (br (block 2 v40 v50))) ) - (func (export #alloc::alloc::handle_alloc_error) + (func (export #alloc::raw_vec::handle_error) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (unreachable)) @@ -964,14 +961,6 @@ (block 1) ) - (func (export #alloc::raw_vec::capacity_overflow) - - (block 0 - (unreachable)) - - (block 1) - ) - ;; Imports (func (import #miden::note #get_inputs) (param i32) (result i32 felt)) ) diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm index d510f1e40..babc68406 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.masm @@ -2927,37 +2927,17 @@ export."miden_tx_kernel_sys::get_inputs" assert add.8 u32assert - dup.2 - dup.0 - push.2147483648 - u32lte - assert - add.12 - u32assert push.0 push.256 push.4 - dup.6 + dup.5 swap.1 u32wrapping_add exec."alloc::raw_vec::RawVec::try_allocate_in" - dup.2 - u32mod.2 - assertz.err=0 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 u32mod.2 assertz.err=0 - dup.1 + dup.0 dup.0 u32mod.16 dup.0 @@ -2967,10 +2947,10 @@ export."miden_tx_kernel_sys::get_inputs" movup.2 u32div.16 exec.::intrinsics::mem::load_sw - movup.2 + swap.1 u32mod.2 assertz.err=0 - movup.2 + swap.1 dup.0 u32mod.16 dup.0 @@ -2983,7 +2963,24 @@ export."miden_tx_kernel_sys::get_inputs" eq.0 neq.0 if.true - dup.3 + dup.1 + dup.0 + push.2147483648 + u32lte + assert + add.12 + u32assert + dup.0 + 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 push.2147483648 u32lte @@ -2992,7 +2989,7 @@ export."miden_tx_kernel_sys::get_inputs" u32assert dup.1 exec.::miden::note::get_inputs - dup.6 + dup.7 dup.0 push.2147483648 u32lte @@ -3010,7 +3007,7 @@ export."miden_tx_kernel_sys::get_inputs" movup.2 u32div.16 exec.::intrinsics::mem::store_sw - movup.7 + movup.8 dup.0 push.2147483648 u32lte @@ -3028,7 +3025,7 @@ export."miden_tx_kernel_sys::get_inputs" u32div.16 exec.::intrinsics::mem::store_sw dup.0 - movup.6 + movup.7 swap.1 dup.0 u32mod.16 @@ -3040,7 +3037,7 @@ export."miden_tx_kernel_sys::get_inputs" u32div.16 exec.::intrinsics::mem::store_sw push.16 - movup.6 + movup.7 swap.1 u32wrapping_add dup.0 @@ -3059,25 +3056,37 @@ export."miden_tx_kernel_sys::get_inputs" movup.2 u32mod.2 assertz.err=0 + movup.2 + u32mod.2 + assertz.err=0 dropw dropw else - swap.3 movup.2 drop - drop + swap.1 dup.0 - eq.0 - neq.0 - if.true - exec."alloc::raw_vec::capacity_overflow" - push.0 - assert - else - exec."alloc::alloc::handle_alloc_error" - push.0 - assert - end + push.2147483648 + u32lte + assert + add.12 + 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.2 + assertz.err=0 + push.0 + assert end end @@ -3463,12 +3472,7 @@ export."alloc::raw_vec::RawVec::try_allocate_in" end -export."alloc::alloc::handle_alloc_error" - push.0 assert -end - - -export."alloc::raw_vec::capacity_overflow" +export."alloc::raw_vec::handle_error" push.0 assert end diff --git a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat index 756031a93..2231ccad3 100644 --- a/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat +++ b/tests/integration/expected/abi_transform_tx_kernel_get_inputs_4.wat @@ -6,7 +6,6 @@ (type (;4;) (func (param i32 i32 i32) (result i32))) (type (;5;) (func (param i32 i32 i32))) (type (;6;) (func (param i32 i32))) - (type (;7;) (func)) (import "miden::note" "get_inputs<0x0000000000000000000000000000000000000000000000000000000000000000>" (func $miden_tx_kernel_sys::externs::extern_note_get_inputs (;0;) (type 0))) (func $entrypoint (;1;) (type 1) (param i32) local.get 0 @@ -499,45 +498,37 @@ i32.const 0 call $alloc::raw_vec::RawVec::try_allocate_in local.get 1 - i32.load offset=12 - local.set 2 - local.get 1 i32.load offset=8 - local.set 3 + local.set 2 block ;; label = @1 - block ;; label = @2 - local.get 1 - i32.load offset=4 - i32.eqz - br_if 0 (;@2;) - local.get 3 - i32.eqz - br_if 1 (;@1;) - local.get 3 - local.get 2 - call $alloc::alloc::handle_alloc_error - unreachable - end - local.get 2 - call $miden_tx_kernel_sys::externs::extern_note_get_inputs - drop - local.get 0 - i32.const 0 - i32.store offset=8 - local.get 0 + local.get 1 + i32.load offset=4 + i32.eqz + br_if 0 (;@1;) local.get 2 - i32.store offset=4 - local.get 0 - local.get 3 - i32.store local.get 1 - i32.const 16 - i32.add - global.set $__stack_pointer - return + i32.load offset=12 + call $alloc::raw_vec::handle_error + unreachable end - call $alloc::raw_vec::capacity_overflow - unreachable + local.get 1 + i32.load offset=12 + local.tee 3 + call $miden_tx_kernel_sys::externs::extern_note_get_inputs + drop + local.get 0 + i32.const 0 + i32.store offset=8 + local.get 0 + local.get 3 + i32.store offset=4 + local.get 0 + local.get 2 + i32.store + local.get 1 + i32.const 16 + i32.add + global.set $__stack_pointer ) (func $alloc::raw_vec::RawVec::try_allocate_in (;9;) (type 5) (param i32 i32 i32) (local i32) @@ -613,11 +604,7 @@ local.get 1 i32.store ) - (func $alloc::alloc::handle_alloc_error (;10;) (type 6) (param i32 i32) - unreachable - unreachable - ) - (func $alloc::raw_vec::capacity_overflow (;11;) (type 7) + (func $alloc::raw_vec::handle_error (;10;) (type 6) (param i32 i32) unreachable unreachable ) diff --git a/tests/integration/expected/components/add_wasm_component.hir b/tests/integration/expected/components/add_wasm_component.hir index 9bd6a5a89..2678b561c 100644 --- a/tests/integration/expected/components/add_wasm_component.hir +++ b/tests/integration/expected/components/add_wasm_component.hir @@ -1,6 +1,9 @@ (component ;; Modules (module #add_wasm_component + ;; Data Segments + (data (mut) (offset 1048576) 0x01000000) + ;; Constants (const (id 0) 0x00100000) @@ -16,20 +19,9 @@ (ret)) ) - (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 #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048576)) + (let (v3 i32) (const.i32 1048580)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -41,7 +33,7 @@ (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 1048576)) + (let (v6 i32) (const.i32 1048580)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -66,11 +58,91 @@ (let (v19 u32) (cast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048576)) + (let (v21 i32) (const.i32 1048580)) (call #::dealloc v21 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) (cast v9)) + (let (v11 u32) (add.checked v10 1048584)) + (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) (cast v0)) + (let (v2 u32) (add.checked v1 1048585)) + (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 u8) (trunc v8)) + (let (v10 u32) (cast v7)) + (let (v11 u32) (add.checked v10 1048585)) + (let (v12 (ptr u8)) (inttoptr v11)) + (store v12 v9) + (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) @@ -80,480 +152,496 @@ (assertz v6) (let (v7 (ptr i32)) (inttoptr v5)) (let (v8 i32) (load v7)) - (let (v9 i1) (eq v8 0)) - (let (v10 i32) (zext v9)) - (let (v11 i1) (neq v10 0)) - (condbr v11 (block 2) (block 3))) + (let (v9 i1) (neq v8 0)) + (condbr v9 (block 2) (block 3))) (block 1 (param v3 i32) (ret v3)) (block 2 - (let (v330 i32) (const.i32 0)) - (br (block 1 v330))) + (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 (v12 i32) (const.i32 -1)) - (let (v13 i32) (add.wrapping v1 v12)) - (let (v14 i32) (const.i32 0)) - (let (v15 i32) (sub.wrapping v14 v1)) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v16)) - (let (v18 i32) (shl.wrapping v0 v17)) - (br (block 4 v8 v2 v18 v15 v13))) + (let (v10 i32) (const.i32 0)) + (ret v10)) (block 4 - (param v19 i32) - (param v160 i32) - (param v171 i32) - (param v185 i32) + (param v18 i32) + (param v169 i32) + (param v182 i32) (param v197 i32) - (let (v20 i32) (const.i32 8)) - (let (v21 i32) (add.wrapping v19 v20)) - (let (v22 u32) (cast v19)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 2)) - (assertz v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 i32) (const.i32 1)) - (let (v28 i32) (band v26 v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 7) (block 8))) + (param v210 i32) + (let (v19 u32) (cast v18)) + (let (v20 u32) (add.checked v19 8)) + (let (v21 u32) (mod.unchecked v20 2)) + (assertz 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 - (br (block 2))) + (let (v344 i32) (const.i32 0)) + (br (block 1 v344))) (block 6 - (param v161 i32) - (param v168 i32) - (param v170 i32) - (param v184 i32) + (param v172 i32) + (param v179 i32) + (param v181 i32) (param v196 i32) - (param v204 i32) - (param v205 i32) - (let (v162 u32) (cast v161)) - (let (v163 u32) (mod.unchecked v162 2)) - (assertz v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 -4)) - (let (v167 i32) (band v165 v166)) - (let (v169 i32) (sub.wrapping v167 v168)) - (let (v176 u32) (bitcast v169)) - (let (v177 u32) (bitcast v170)) - (let (v178 i1) (lt v176 v177)) - (let (v179 i32) (sext v178)) - (let (v180 i1) (neq v179 0)) - (condbr v180 (block 21 v204 v205 v170 v184 v196) (block 22))) + (param v209 i32) + (param v218 i32) + (param v219 i32) + (let (v173 u32) (cast v172)) + (let (v174 u32) (mod.unchecked v173 2)) + (assertz 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 v21 v26 v19 v160 v171 v185 v197))) + (br (block 9 v18 v23 v169 v182 v197 v210))) (block 8 - (br (block 6 v19 v21 v171 v185 v197 v160 v26))) + (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 v31 i32) - (param v37 i32) - (param v144 i32) - (param v174 i32) - (param v188 i32) - (param v200 i32) - (let (v32 i32) (const.i32 -2)) - (let (v33 i32) (band v31 v32)) - (let (v34 u32) (cast v30)) + (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) (cast v29)) + (let (v34 u32) (add.checked v33 8)) (let (v35 u32) (mod.unchecked v34 2)) (assertz v35) (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v33) - (let (v38 u32) (cast v37)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 2)) - (assertz v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (let (v42 i32) (load v41)) - (let (v43 i32) (const.i32 -4)) - (let (v44 i32) (band v42 v43)) - (let (v45 u32) (cast v44)) - (let (v46 u32) (mod.unchecked v45 2)) - (assertz v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (let (v48 i32) (load v47)) - (let (v49 u32) (cast v37)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i32)) (inttoptr v49)) - (let (v52 i32) (load v51)) - (let (v53 i32) (const.i32 -4)) - (let (v54 i32) (band v52 v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 13) (block 14))) + (store v36 v32) + (let (v37 u32) (cast v29)) + (let (v38 u32) (add.checked v37 4)) + (let (v39 u32) (mod.unchecked v38 2)) + (assertz 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 - (br (block 6 v146 v151 v172 v186 v198 v142 v156))) + (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 v112 i32) - (param v113 i32) - (param v120 i32) - (param v131 i32) - (param v143 i32) - (param v173 i32) - (param v187 i32) - (param v199 i32) - (let (v114 i32) (const.i32 3)) - (let (v115 i32) (band v113 v114)) - (let (v116 u32) (cast v112)) - (let (v117 u32) (add.checked v116 4)) - (let (v118 u32) (mod.unchecked v117 2)) - (assertz v118) - (let (v119 (ptr i32)) (inttoptr v117)) - (store v119 v115) - (let (v121 i32) (const.i32 3)) - (let (v122 i32) (band v120 v121)) - (let (v123 u32) (cast v112)) - (let (v124 u32) (mod.unchecked v123 2)) - (assertz v124) - (let (v125 (ptr i32)) (inttoptr v123)) - (store v125 v122) - (let (v126 i32) (const.i32 2)) - (let (v127 i32) (band v120 v126)) - (let (v128 i1) (eq v127 0)) - (let (v129 i32) (zext v128)) - (let (v130 i1) (neq v129 0)) - (condbr v130 (block 18 v143 v131 v173 v187 v199) (block 19))) + (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) (cast v55)) + (let (v57 u32) (mod.unchecked v56 2)) + (assertz 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 - (param v93 i32) - (param v94 i32) - (param v97 i32) - (param v102 i32) - (param v132 i32) - (param v145 i32) - (param v175 i32) - (param v189 i32) - (param v201 i32) - (let (v95 i32) (const.i32 3)) - (let (v96 i32) (band v94 v95)) - (let (v98 i32) (bor v96 v97)) - (let (v99 u32) (cast v93)) - (let (v100 u32) (mod.unchecked v99 2)) - (assertz v100) - (let (v101 (ptr i32)) (inttoptr v99)) - (store v101 v98) - (let (v103 u32) (cast v102)) - (let (v104 u32) (add.checked v103 4)) - (let (v105 u32) (mod.unchecked v104 2)) - (assertz v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (let (v107 i32) (load v106)) - (let (v108 u32) (cast v102)) - (let (v109 u32) (mod.unchecked v108 2)) - (assertz v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (br (block 11 v102 v107 v111 v132 v145 v175 v189 v201))) + (let (v46 i32) (const.i32 0)) + (let (v47 u32) (cast 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 (v56 i32) (const.i32 2)) - (let (v57 i32) (band v52 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 15) (block 16))) + (let (v45 i32) (const.i32 0)) + (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) (block 14 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (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 (v61 u32) (cast v54)) - (let (v62 u32) (add.checked v61 4)) - (let (v63 u32) (mod.unchecked v62 2)) - (assertz v63) - (let (v64 (ptr i32)) (inttoptr v62)) - (let (v65 i32) (load v64)) - (let (v66 i32) (const.i32 3)) - (let (v67 i32) (band v65 v66)) - (let (v68 i32) (bor v67 v44)) - (let (v69 u32) (cast v54)) - (let (v70 u32) (add.checked v69 4)) - (let (v71 u32) (mod.unchecked v70 2)) - (assertz v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 u32) (cast v37)) - (let (v74 u32) (mod.unchecked v73 2)) - (assertz v74) - (let (v75 (ptr i32)) (inttoptr v73)) - (let (v76 i32) (load v75)) - (let (v77 u32) (cast v37)) + (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) (cast v61)) + (let (v69 u32) (add.checked v68 4)) + (let (v70 u32) (mod.unchecked v69 2)) + (assertz 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) (cast v61)) (let (v78 u32) (add.checked v77 4)) (let (v79 u32) (mod.unchecked v78 2)) (assertz v79) (let (v80 (ptr i32)) (inttoptr v78)) - (let (v81 i32) (load v80)) - (let (v82 i32) (const.i32 -4)) - (let (v83 i32) (band v81 v82)) - (let (v84 i1) (eq v83 0)) - (let (v85 i32) (zext v84)) - (let (v86 i1) (neq v85 0)) - (condbr v86 (block 11 v37 v81 v76 v44 v144 v174 v188 v200) (block 17))) - - (block 16 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (store v80 v76) + (let (v81 u32) (cast v55)) + (let (v82 u32) (add.checked v81 4)) + (let (v83 u32) (mod.unchecked v82 2)) + (assertz 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) (cast v55)) + (let (v89 u32) (mod.unchecked v88 2)) + (assertz 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 - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v76 v87)) - (let (v89 u32) (cast v83)) - (let (v90 u32) (mod.unchecked v89 2)) - (assertz v90) - (let (v91 (ptr i32)) (inttoptr v89)) - (let (v92 i32) (load v91)) - (br (block 12 v83 v92 v88 v37 v44 v144 v174 v188 v200))) + (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) (cast v119)) + (let (v126 u32) (add.checked v125 4)) + (let (v127 u32) (mod.unchecked v126 2)) + (assertz 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) (cast v119)) + (let (v133 u32) (mod.unchecked v132 2)) + (assertz 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 - (param v142 i32) - (param v146 i32) - (param v172 i32) - (param v186 i32) - (param v198 i32) - (let (v147 u32) (cast v142)) - (let (v148 u32) (mod.unchecked v147 2)) - (assertz v148) - (let (v149 (ptr i32)) (inttoptr v147)) - (store v149 v146) - (let (v150 i32) (const.i32 8)) - (let (v151 i32) (add.wrapping v146 v150)) - (let (v152 u32) (cast v146)) - (let (v153 u32) (add.checked v152 8)) - (let (v154 u32) (mod.unchecked v153 2)) - (assertz v154) - (let (v155 (ptr i32)) (inttoptr v153)) - (let (v156 i32) (load v155)) - (let (v157 i32) (const.i32 1)) - (let (v158 i32) (band v156 v157)) - (let (v159 i1) (neq v158 0)) - (condbr v159 (block 9 v151 v156 v146 v142 v172 v186 v198) (block 20))) + (let (v96 u32) (cast v92)) + (let (v97 u32) (mod.unchecked v96 2)) + (assertz 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) (cast v92)) + (let (v107 u32) (mod.unchecked v106 2)) + (assertz v107) + (let (v108 (ptr i32)) (inttoptr v106)) + (store v108 v105) + (let (v110 u32) (cast v109)) + (let (v111 u32) (add.checked v110 4)) + (let (v112 u32) (mod.unchecked v111 2)) + (assertz v112) + (let (v113 (ptr i32)) (inttoptr v111)) + (let (v114 i32) (load v113)) + (let (v115 u32) (cast v109)) + (let (v116 u32) (mod.unchecked v115 2)) + (assertz 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 - (let (v133 u32) (cast v131)) - (let (v134 u32) (mod.unchecked v133 2)) - (assertz v134) - (let (v135 (ptr i32)) (inttoptr v133)) - (let (v136 i32) (load v135)) - (let (v137 i32) (const.i32 2)) - (let (v138 i32) (bor v136 v137)) - (let (v139 u32) (cast v131)) - (let (v140 u32) (mod.unchecked v139 2)) - (assertz v140) - (let (v141 (ptr i32)) (inttoptr v139)) - (store v141 v138) - (br (block 18 v143 v131 v173 v187 v199))) + (param v152 i32) + (param v157 i32) + (param v183 i32) + (param v198 i32) + (param v211 i32) + (let (v158 u32) (cast v152)) + (let (v159 u32) (mod.unchecked v158 2)) + (assertz v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v161 u32) (cast v157)) + (let (v162 u32) (add.checked v161 8)) + (let (v163 u32) (mod.unchecked v162 2)) + (assertz 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 - (br (block 10))) + (let (v143 u32) (cast v140)) + (let (v144 u32) (mod.unchecked v143 2)) + (assertz 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) (cast v140)) + (let (v150 u32) (mod.unchecked v149 2)) + (assertz v150) + (let (v151 (ptr i32)) (inttoptr v149)) + (store v151 v148) + (br (block 19 v153 v140 v184 v199 v212))) (block 21 - (param v321 i32) - (param v322 i32) - (param v327 i32) - (param v328 i32) - (param v329 i32) - (let (v323 u32) (cast v321)) - (let (v324 u32) (mod.unchecked v323 2)) - (assertz v324) - (let (v325 (ptr i32)) (inttoptr v323)) - (store v325 v322) - (let (v326 i1) (neq v322 0)) - (condbr v326 (block 4 v322 v321 v327 v328 v329) (block 32))) + (br (block 10))) (block 22 - (let (v181 i32) (const.i32 72)) - (let (v182 i32) (add.wrapping v168 v181)) - (let (v183 i32) (sub.wrapping v167 v170)) - (let (v190 i32) (band v183 v184)) - (let (v191 u32) (bitcast v182)) - (let (v192 u32) (bitcast v190)) - (let (v193 i1) (lte v191 v192)) - (let (v194 i32) (sext v193)) - (let (v195 i1) (neq v194 0)) - (condbr v195 (block 24) (block 25))) - - (block 23 (param v312 i32) (param v313 i32) - (let (v314 i32) (const.i32 1)) - (let (v315 i32) (bor v313 v314)) - (let (v316 u32) (cast v312)) - (let (v317 u32) (mod.unchecked v316 2)) - (assertz v317) - (let (v318 (ptr i32)) (inttoptr v316)) - (store v318 v315) - (let (v319 i32) (const.i32 8)) - (let (v320 i32) (add.wrapping v312 v319)) - (ret v320)) - - (block 24 - (let (v215 i32) (const.i32 0)) - (let (v216 i32) (const.i32 0)) - (let (v217 u32) (cast v190)) - (let (v218 u32) (mod.unchecked v217 2)) - (assertz v218) - (let (v219 (ptr i32)) (inttoptr v217)) - (store v219 v216) - (let (v220 i32) (const.i32 -8)) - (let (v221 i32) (add.wrapping v190 v220)) - (let (v222 i64) (const.i64 0)) - (let (v223 u32) (cast v221)) - (let (v224 u32) (mod.unchecked v223 2)) - (assertz v224) - (let (v225 (ptr i64)) (inttoptr v223)) - (store v225 v222) - (let (v226 u32) (cast v161)) - (let (v227 u32) (mod.unchecked v226 2)) - (assertz v227) - (let (v228 (ptr i32)) (inttoptr v226)) - (let (v229 i32) (load v228)) - (let (v230 i32) (const.i32 -4)) - (let (v231 i32) (band v229 v230)) - (let (v232 u32) (cast v221)) - (let (v233 u32) (mod.unchecked v232 2)) - (assertz v233) - (let (v234 (ptr i32)) (inttoptr v232)) - (store v234 v231) - (let (v235 u32) (cast v161)) - (let (v236 u32) (mod.unchecked v235 2)) - (assertz v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 i32) (const.i32 -4)) - (let (v240 i32) (band v238 v239)) - (let (v241 i1) (eq v240 0)) - (let (v242 i32) (zext v241)) - (let (v243 i1) (neq v242 0)) - (condbr v243 (block 27 v221 v215 v161 v168) (block 28))) + (param v335 i32) + (param v336 i32) + (param v341 i32) + (param v342 i32) + (param v343 i32) + (let (v337 u32) (cast v335)) + (let (v338 u32) (mod.unchecked v337 2)) + (assertz 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) (cast v326)) + (let (v331 u32) (mod.unchecked v330 2)) + (assertz 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 (v202 i32) (band v196 v168)) - (let (v203 i1) (neq v202 0)) - (condbr v203 (block 21 v204 v205 v170 v184 v196) (block 26))) + (let (v229 i32) (const.i32 0)) + (let (v230 i32) (const.i32 0)) + (let (v231 u32) (cast v203)) + (let (v232 u32) (mod.unchecked v231 2)) + (assertz 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) (cast v235)) + (let (v238 u32) (mod.unchecked v237 2)) + (assertz v238) + (let (v239 (ptr i64)) (inttoptr v237)) + (store v239 v236) + (let (v240 u32) (cast v172)) + (let (v241 u32) (mod.unchecked v240 2)) + (assertz 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) (cast v235)) + (let (v247 u32) (mod.unchecked v246 2)) + (assertz v247) + (let (v248 (ptr i32)) (inttoptr v246)) + (store v248 v245) + (let (v249 u32) (cast v172)) + (let (v250 u32) (mod.unchecked v249 2)) + (assertz 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 (v206 i32) (const.i32 -4)) - (let (v207 i32) (band v205 v206)) - (let (v208 u32) (cast v204)) - (let (v209 u32) (mod.unchecked v208 2)) - (assertz v209) - (let (v210 (ptr i32)) (inttoptr v208)) - (store v210 v207) - (let (v211 u32) (cast v161)) - (let (v212 u32) (mod.unchecked v211 2)) - (assertz v212) - (let (v213 (ptr i32)) (inttoptr v211)) - (let (v214 i32) (load v213)) - (br (block 23 v161 v214))) + (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 - (param v266 i32) - (param v267 i32) - (param v268 i32) - (param v274 i32) - (let (v269 i32) (bor v267 v268)) - (let (v270 u32) (cast v266)) - (let (v271 u32) (add.checked v270 4)) - (let (v272 u32) (mod.unchecked v271 2)) - (assertz v272) - (let (v273 (ptr i32)) (inttoptr v271)) - (store v273 v269) - (let (v275 u32) (cast v274)) - (let (v276 u32) (mod.unchecked v275 2)) - (assertz v276) - (let (v277 (ptr i32)) (inttoptr v275)) - (let (v278 i32) (load v277)) - (let (v279 i32) (const.i32 -2)) - (let (v280 i32) (band v278 v279)) - (let (v281 u32) (cast v274)) - (let (v282 u32) (mod.unchecked v281 2)) - (assertz v282) - (let (v283 (ptr i32)) (inttoptr v281)) - (store v283 v280) - (let (v284 u32) (cast v268)) - (let (v285 u32) (mod.unchecked v284 2)) - (assertz v285) - (let (v286 (ptr i32)) (inttoptr v284)) - (let (v287 i32) (load v286)) - (let (v288 i32) (const.i32 3)) - (let (v289 i32) (band v287 v288)) - (let (v290 i32) (bor v289 v266)) - (let (v291 u32) (cast v268)) - (let (v292 u32) (mod.unchecked v291 2)) - (assertz v292) - (let (v293 (ptr i32)) (inttoptr v291)) - (store v293 v290) - (let (v294 i32) (const.i32 2)) - (let (v295 i32) (band v287 v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 30) (block 31))) + (let (v220 i32) (const.i32 -4)) + (let (v221 i32) (band v219 v220)) + (let (v222 u32) (cast v218)) + (let (v223 u32) (mod.unchecked v222 2)) + (assertz v223) + (let (v224 (ptr i32)) (inttoptr v222)) + (store v224 v221) + (let (v225 u32) (cast v172)) + (let (v226 u32) (mod.unchecked v225 2)) + (assertz v226) + (let (v227 (ptr i32)) (inttoptr v225)) + (let (v228 i32) (load v227)) + (br (block 24 v172 v228))) (block 28 - (let (v244 i32) (const.i32 2)) - (let (v245 i32) (band v238 v244)) - (let (v246 i1) (neq v245 0)) - (condbr v246 (block 27 v221 v215 v161 v168) (block 29))) + (param v280 i32) + (param v281 i32) + (param v282 i32) + (param v288 i32) + (let (v283 i32) (bor v281 v282)) + (let (v284 u32) (cast v280)) + (let (v285 u32) (add.checked v284 4)) + (let (v286 u32) (mod.unchecked v285 2)) + (assertz v286) + (let (v287 (ptr i32)) (inttoptr v285)) + (store v287 v283) + (let (v289 u32) (cast v288)) + (let (v290 u32) (mod.unchecked v289 2)) + (assertz 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) (cast v288)) + (let (v296 u32) (mod.unchecked v295 2)) + (assertz v296) + (let (v297 (ptr i32)) (inttoptr v295)) + (store v297 v294) + (let (v298 u32) (cast v282)) + (let (v299 u32) (mod.unchecked v298 2)) + (assertz 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) (cast v282)) + (let (v306 u32) (mod.unchecked v305 2)) + (assertz 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 (v247 u32) (cast v240)) - (let (v248 u32) (add.checked v247 4)) - (let (v249 u32) (mod.unchecked v248 2)) - (assertz v249) - (let (v250 (ptr i32)) (inttoptr v248)) - (let (v251 i32) (load v250)) - (let (v252 i32) (const.i32 3)) - (let (v253 i32) (band v251 v252)) - (let (v254 i32) (bor v253 v221)) - (let (v255 u32) (cast v240)) - (let (v256 u32) (add.checked v255 4)) - (let (v257 u32) (mod.unchecked v256 2)) - (assertz v257) - (let (v258 (ptr i32)) (inttoptr v256)) - (store v258 v254) - (let (v259 u32) (cast v221)) - (let (v260 u32) (add.checked v259 4)) - (let (v261 u32) (mod.unchecked v260 2)) - (assertz v261) - (let (v262 (ptr i32)) (inttoptr v260)) - (let (v263 i32) (load v262)) - (let (v264 i32) (const.i32 3)) - (let (v265 i32) (band v263 v264)) - (br (block 27 v221 v265 v161 v168))) + (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 (v301 i32) (const.i32 -3)) - (let (v302 i32) (band v290 v301)) - (let (v303 u32) (cast v268)) - (let (v304 u32) (mod.unchecked v303 2)) - (assertz v304) - (let (v305 (ptr i32)) (inttoptr v303)) - (store v305 v302) - (let (v306 u32) (cast v266)) - (let (v307 u32) (mod.unchecked v306 2)) - (assertz v307) - (let (v308 (ptr i32)) (inttoptr v306)) - (let (v309 i32) (load v308)) - (let (v310 i32) (const.i32 2)) - (let (v311 i32) (bor v309 v310)) - (br (block 23 v266 v311))) + (let (v261 u32) (cast v254)) + (let (v262 u32) (add.checked v261 4)) + (let (v263 u32) (mod.unchecked v262 2)) + (assertz 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) (cast v254)) + (let (v270 u32) (add.checked v269 4)) + (let (v271 u32) (mod.unchecked v270 2)) + (assertz v271) + (let (v272 (ptr i32)) (inttoptr v270)) + (store v272 v268) + (let (v273 u32) (cast v235)) + (let (v274 u32) (add.checked v273 4)) + (let (v275 u32) (mod.unchecked v274 2)) + (assertz 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 (v297 u32) (cast v266)) - (let (v298 u32) (mod.unchecked v297 2)) - (assertz v298) - (let (v299 (ptr i32)) (inttoptr v297)) - (let (v300 i32) (load v299)) - (br (block 23 v266 v300))) + (let (v315 i32) (const.i32 -3)) + (let (v316 i32) (band v304 v315)) + (let (v317 u32) (cast v282)) + (let (v318 u32) (mod.unchecked v317 2)) + (assertz v318) + (let (v319 (ptr i32)) (inttoptr v317)) + (store v319 v316) + (let (v320 u32) (cast v280)) + (let (v321 u32) (mod.unchecked v320 2)) + (assertz 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) (cast v280)) + (let (v312 u32) (mod.unchecked v311 2)) + (assertz v312) + (let (v313 (ptr i32)) (inttoptr v311)) + (let (v314 i32) (load v313)) + (br (block 24 v280 v314))) + + (block 33 (br (block 5))) ) @@ -989,73 +1077,14 @@ (br (block 7 v175 v185))) ) - (func (export #wit_bindgen::rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (cast v0)) - (let (v2 u32) (add.checked v1 1048581)) - (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 u8) (trunc v8)) - (let (v10 u32) (cast v7)) - (let (v11 u32) (add.checked v10 1048581)) - (let (v12 (ptr u8)) (inttoptr v11)) - (store v12 v9) - (br (block 2))) - ) - (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 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) + (br (block 1 v5))) (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) (cast v9)) - (let (v11 u32) (add.checked v10 1048580)) - (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)) ) ) diff --git a/tests/integration/expected/components/add_wasm_component.wat b/tests/integration/expected/components/add_wasm_component.wat index c9358ef50..1034420f1 100644 --- a/tests/integration/expected/components/add_wasm_component.wat +++ b/tests/integration/expected/components/add_wasm_component.wat @@ -6,22 +6,16 @@ (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 $miden:add-package/add-interface@1.0.0#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) - i32.const 1048576 + (func $__rust_alloc (;1;) (type 1) (param i32 i32) (result i32) + i32.const 1048580 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;2;) (type 2) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048576 + i32.const 1048580 local.get 2 local.get 3 call $::alloc @@ -37,7 +31,7 @@ i32.lt_u select memory.copy - i32.const 1048576 + i32.const 1048580 local.get 0 local.get 2 local.get 1 @@ -45,309 +39,361 @@ end local.get 4 ) - (func $wee_alloc::alloc_first_fit (;4;) (type 3) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32) + (func $miden:add-package/add-interface@1.0.0#add (;3;) (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 (;4;) (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=1048584 + 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 $wit_bindgen_rt::run_ctors_once (;5;) (type 0) + block ;; label = @1 + i32.const 0 + i32.load8_u offset=1048585 + br_if 0 (;@1;) + call $__wasm_call_ctors + i32.const 0 + i32.const 1 + i32.store8 offset=1048585 + end + ) + (func $wee_alloc::alloc_first_fit (;6;) (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 - i32.eqz br_if 0 (;@1;) - 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 = @2 - local.get 3 - i32.const 8 - i32.add - local.set 7 + 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 - local.get 3 - i32.load offset=8 - local.tee 0 + 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 - br_if 0 (;@4;) - local.get 3 - local.set 1 - br 1 (;@3;) + select + local.set 8 end - loop ;; label = @4 - local.get 7 - local.get 0 - i32.const -2 - i32.and - i32.store + block ;; label = @4 local.get 3 - i32.load offset=4 + i32.load + local.tee 1 i32.const -4 i32.and - local.tee 1 - i32.load - local.set 7 - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.load - local.tee 8 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - block ;; label = @7 - local.get 8 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - local.get 0 - local.get 0 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 0 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 1 (;@5;) - local.get 0 - i32.const -4 - i32.and - local.set 0 - local.get 8 - i32.load - local.set 7 - end - local.get 8 - local.get 7 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 0 - end - local.get 3 - local.get 7 + 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 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@5;) - local.get 1 - local.get 1 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 local.get 1 + i32.const -4 + i32.and + i32.or i32.store - local.get 1 - i32.const 8 - i32.add + 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 - local.set 3 - local.get 1 - i32.load offset=8 - local.tee 0 - i32.const 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 - local.tee 3 - local.get 7 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@3;) + i32.store block ;; label = @4 - block ;; label = @5 - local.get 7 - i32.const 72 - i32.add - local.get 3 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 3 - i32.le_u - br_if 0 (;@5;) - local.get 4 - local.get 7 - i32.and - br_if 2 (;@3;) - local.get 2 - local.get 0 - i32.const -4 - i32.and - i32.store - local.get 1 - i32.load - local.set 0 - local.get 1 - local.set 3 - br 1 (;@4;) - end - i32.const 0 - local.set 0 - local.get 3 - i32.const 0 - i32.store local.get 3 - i32.const -8 - i32.add - local.tee 3 - i64.const 0 - i64.store align=4 - local.get 3 - local.get 1 i32.load + local.tee 9 i32.const -4 i32.and - i32.store - block ;; label = @5 - local.get 1 - i32.load - local.tee 2 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 2 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 3 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - i32.const 3 - i32.and - local.set 0 - end - local.get 3 - local.get 0 - local.get 1 - i32.or - i32.store offset=4 - local.get 7 - local.get 7 - i32.load - i32.const -2 + local.tee 8 + i32.eqz + br_if 0 (;@4;) + local.get 9 + i32.const 2 i32.and - i32.store - local.get 1 - local.get 1 - i32.load - local.tee 0 + br_if 0 (;@4;) + local.get 8 + local.get 8 + i32.load offset=4 i32.const 3 i32.and - local.get 3 + local.get 1 i32.or - local.tee 7 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 3 - i32.load - local.set 0 - br 1 (;@4;) - end + i32.store offset=4 local.get 1 - local.get 7 - i32.const -3 + i32.load offset=4 + i32.const 3 i32.and - i32.store - local.get 3 - i32.load - i32.const 2 - i32.or - local.set 0 + local.set 7 end + local.get 1 + local.get 7 local.get 3 + i32.or + i32.store offset=4 local.get 0 - i32.const 1 + 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 - i32.const 8 - i32.add - return + 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 2 + local.get 1 local.get 0 + i32.const 1 + i32.or i32.store - local.get 0 - local.set 3 - local.get 0 - br_if 0 (;@2;) + 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 (;5;) (type 3) (param i32 i32 i32) (result i32) + (func $::alloc (;7;) (type 3) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -451,7 +497,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;6;) (type 4) (param i32 i32 i32 i32) + (func $::dealloc (;8;) (type 4) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -624,55 +670,22 @@ i32.store end ) - (func $wit_bindgen::rt::run_ctors_once (;7;) (type 0) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048581 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048581 - end - ) - (func $cabi_realloc (;8;) (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=1048580 - 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 + (func $cabi_realloc (;9;) (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;) 1 1 funcref) + (table (;0;) 2 2 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 $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") ) (core instance (;0;) (instantiate 0)) (alias core export 0 "memory" (core memory (;0;))) diff --git a/tests/integration/expected/components/inc_wasm_component.hir b/tests/integration/expected/components/inc_wasm_component.hir index 0c28d8e31..d07b5c2f5 100644 --- a/tests/integration/expected/components/inc_wasm_component.hir +++ b/tests/integration/expected/components/inc_wasm_component.hir @@ -4,6 +4,9 @@ ;; Modules (module #inc_wasm_component + ;; Data Segments + (data (mut) (offset 1048576) 0x01000000) + ;; Constants (const (id 0) 0x00100000) @@ -19,20 +22,9 @@ (ret)) ) - (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 #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048576)) + (let (v3 i32) (const.i32 1048580)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -44,7 +36,7 @@ (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 1048576)) + (let (v6 i32) (const.i32 1048580)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -69,11 +61,91 @@ (let (v19 u32) (cast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048576)) + (let (v21 i32) (const.i32 1048580)) (call #::dealloc v21 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) (cast v9)) + (let (v11 u32) (add.checked v10 1048584)) + (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) (cast v0)) + (let (v2 u32) (add.checked v1 1048585)) + (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 u8) (trunc v8)) + (let (v10 u32) (cast v7)) + (let (v11 u32) (add.checked v10 1048585)) + (let (v12 (ptr u8)) (inttoptr v11)) + (store v12 v9) + (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) @@ -83,480 +155,496 @@ (assertz v6) (let (v7 (ptr i32)) (inttoptr v5)) (let (v8 i32) (load v7)) - (let (v9 i1) (eq v8 0)) - (let (v10 i32) (zext v9)) - (let (v11 i1) (neq v10 0)) - (condbr v11 (block 2) (block 3))) + (let (v9 i1) (neq v8 0)) + (condbr v9 (block 2) (block 3))) (block 1 (param v3 i32) (ret v3)) (block 2 - (let (v330 i32) (const.i32 0)) - (br (block 1 v330))) + (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 (v12 i32) (const.i32 -1)) - (let (v13 i32) (add.wrapping v1 v12)) - (let (v14 i32) (const.i32 0)) - (let (v15 i32) (sub.wrapping v14 v1)) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v16)) - (let (v18 i32) (shl.wrapping v0 v17)) - (br (block 4 v8 v2 v18 v15 v13))) + (let (v10 i32) (const.i32 0)) + (ret v10)) (block 4 - (param v19 i32) - (param v160 i32) - (param v171 i32) - (param v185 i32) + (param v18 i32) + (param v169 i32) + (param v182 i32) (param v197 i32) - (let (v20 i32) (const.i32 8)) - (let (v21 i32) (add.wrapping v19 v20)) - (let (v22 u32) (cast v19)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 2)) - (assertz v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 i32) (const.i32 1)) - (let (v28 i32) (band v26 v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 7) (block 8))) + (param v210 i32) + (let (v19 u32) (cast v18)) + (let (v20 u32) (add.checked v19 8)) + (let (v21 u32) (mod.unchecked v20 2)) + (assertz 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 - (br (block 2))) + (let (v344 i32) (const.i32 0)) + (br (block 1 v344))) (block 6 - (param v161 i32) - (param v168 i32) - (param v170 i32) - (param v184 i32) + (param v172 i32) + (param v179 i32) + (param v181 i32) (param v196 i32) - (param v204 i32) - (param v205 i32) - (let (v162 u32) (cast v161)) - (let (v163 u32) (mod.unchecked v162 2)) - (assertz v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 -4)) - (let (v167 i32) (band v165 v166)) - (let (v169 i32) (sub.wrapping v167 v168)) - (let (v176 u32) (bitcast v169)) - (let (v177 u32) (bitcast v170)) - (let (v178 i1) (lt v176 v177)) - (let (v179 i32) (sext v178)) - (let (v180 i1) (neq v179 0)) - (condbr v180 (block 21 v204 v205 v170 v184 v196) (block 22))) + (param v209 i32) + (param v218 i32) + (param v219 i32) + (let (v173 u32) (cast v172)) + (let (v174 u32) (mod.unchecked v173 2)) + (assertz 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 v21 v26 v19 v160 v171 v185 v197))) + (br (block 9 v18 v23 v169 v182 v197 v210))) (block 8 - (br (block 6 v19 v21 v171 v185 v197 v160 v26))) + (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 v31 i32) - (param v37 i32) - (param v144 i32) - (param v174 i32) - (param v188 i32) - (param v200 i32) - (let (v32 i32) (const.i32 -2)) - (let (v33 i32) (band v31 v32)) - (let (v34 u32) (cast v30)) + (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) (cast v29)) + (let (v34 u32) (add.checked v33 8)) (let (v35 u32) (mod.unchecked v34 2)) (assertz v35) (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v33) - (let (v38 u32) (cast v37)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 2)) - (assertz v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (let (v42 i32) (load v41)) - (let (v43 i32) (const.i32 -4)) - (let (v44 i32) (band v42 v43)) - (let (v45 u32) (cast v44)) - (let (v46 u32) (mod.unchecked v45 2)) - (assertz v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (let (v48 i32) (load v47)) - (let (v49 u32) (cast v37)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i32)) (inttoptr v49)) - (let (v52 i32) (load v51)) - (let (v53 i32) (const.i32 -4)) - (let (v54 i32) (band v52 v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 13) (block 14))) + (store v36 v32) + (let (v37 u32) (cast v29)) + (let (v38 u32) (add.checked v37 4)) + (let (v39 u32) (mod.unchecked v38 2)) + (assertz 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 - (br (block 6 v146 v151 v172 v186 v198 v142 v156))) + (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 v112 i32) - (param v113 i32) - (param v120 i32) - (param v131 i32) - (param v143 i32) - (param v173 i32) - (param v187 i32) - (param v199 i32) - (let (v114 i32) (const.i32 3)) - (let (v115 i32) (band v113 v114)) - (let (v116 u32) (cast v112)) - (let (v117 u32) (add.checked v116 4)) - (let (v118 u32) (mod.unchecked v117 2)) - (assertz v118) - (let (v119 (ptr i32)) (inttoptr v117)) - (store v119 v115) - (let (v121 i32) (const.i32 3)) - (let (v122 i32) (band v120 v121)) - (let (v123 u32) (cast v112)) - (let (v124 u32) (mod.unchecked v123 2)) - (assertz v124) - (let (v125 (ptr i32)) (inttoptr v123)) - (store v125 v122) - (let (v126 i32) (const.i32 2)) - (let (v127 i32) (band v120 v126)) - (let (v128 i1) (eq v127 0)) - (let (v129 i32) (zext v128)) - (let (v130 i1) (neq v129 0)) - (condbr v130 (block 18 v143 v131 v173 v187 v199) (block 19))) + (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) (cast v55)) + (let (v57 u32) (mod.unchecked v56 2)) + (assertz 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 - (param v93 i32) - (param v94 i32) - (param v97 i32) - (param v102 i32) - (param v132 i32) - (param v145 i32) - (param v175 i32) - (param v189 i32) - (param v201 i32) - (let (v95 i32) (const.i32 3)) - (let (v96 i32) (band v94 v95)) - (let (v98 i32) (bor v96 v97)) - (let (v99 u32) (cast v93)) - (let (v100 u32) (mod.unchecked v99 2)) - (assertz v100) - (let (v101 (ptr i32)) (inttoptr v99)) - (store v101 v98) - (let (v103 u32) (cast v102)) - (let (v104 u32) (add.checked v103 4)) - (let (v105 u32) (mod.unchecked v104 2)) - (assertz v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (let (v107 i32) (load v106)) - (let (v108 u32) (cast v102)) - (let (v109 u32) (mod.unchecked v108 2)) - (assertz v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (br (block 11 v102 v107 v111 v132 v145 v175 v189 v201))) + (let (v46 i32) (const.i32 0)) + (let (v47 u32) (cast 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 (v56 i32) (const.i32 2)) - (let (v57 i32) (band v52 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 15) (block 16))) + (let (v45 i32) (const.i32 0)) + (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) (block 14 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (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 (v61 u32) (cast v54)) - (let (v62 u32) (add.checked v61 4)) - (let (v63 u32) (mod.unchecked v62 2)) - (assertz v63) - (let (v64 (ptr i32)) (inttoptr v62)) - (let (v65 i32) (load v64)) - (let (v66 i32) (const.i32 3)) - (let (v67 i32) (band v65 v66)) - (let (v68 i32) (bor v67 v44)) - (let (v69 u32) (cast v54)) - (let (v70 u32) (add.checked v69 4)) - (let (v71 u32) (mod.unchecked v70 2)) - (assertz v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 u32) (cast v37)) - (let (v74 u32) (mod.unchecked v73 2)) - (assertz v74) - (let (v75 (ptr i32)) (inttoptr v73)) - (let (v76 i32) (load v75)) - (let (v77 u32) (cast v37)) + (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) (cast v61)) + (let (v69 u32) (add.checked v68 4)) + (let (v70 u32) (mod.unchecked v69 2)) + (assertz 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) (cast v61)) (let (v78 u32) (add.checked v77 4)) (let (v79 u32) (mod.unchecked v78 2)) (assertz v79) (let (v80 (ptr i32)) (inttoptr v78)) - (let (v81 i32) (load v80)) - (let (v82 i32) (const.i32 -4)) - (let (v83 i32) (band v81 v82)) - (let (v84 i1) (eq v83 0)) - (let (v85 i32) (zext v84)) - (let (v86 i1) (neq v85 0)) - (condbr v86 (block 11 v37 v81 v76 v44 v144 v174 v188 v200) (block 17))) - - (block 16 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (store v80 v76) + (let (v81 u32) (cast v55)) + (let (v82 u32) (add.checked v81 4)) + (let (v83 u32) (mod.unchecked v82 2)) + (assertz 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) (cast v55)) + (let (v89 u32) (mod.unchecked v88 2)) + (assertz 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 - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v76 v87)) - (let (v89 u32) (cast v83)) - (let (v90 u32) (mod.unchecked v89 2)) - (assertz v90) - (let (v91 (ptr i32)) (inttoptr v89)) - (let (v92 i32) (load v91)) - (br (block 12 v83 v92 v88 v37 v44 v144 v174 v188 v200))) + (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) (cast v119)) + (let (v126 u32) (add.checked v125 4)) + (let (v127 u32) (mod.unchecked v126 2)) + (assertz 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) (cast v119)) + (let (v133 u32) (mod.unchecked v132 2)) + (assertz 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 - (param v142 i32) - (param v146 i32) - (param v172 i32) - (param v186 i32) - (param v198 i32) - (let (v147 u32) (cast v142)) - (let (v148 u32) (mod.unchecked v147 2)) - (assertz v148) - (let (v149 (ptr i32)) (inttoptr v147)) - (store v149 v146) - (let (v150 i32) (const.i32 8)) - (let (v151 i32) (add.wrapping v146 v150)) - (let (v152 u32) (cast v146)) - (let (v153 u32) (add.checked v152 8)) - (let (v154 u32) (mod.unchecked v153 2)) - (assertz v154) - (let (v155 (ptr i32)) (inttoptr v153)) - (let (v156 i32) (load v155)) - (let (v157 i32) (const.i32 1)) - (let (v158 i32) (band v156 v157)) - (let (v159 i1) (neq v158 0)) - (condbr v159 (block 9 v151 v156 v146 v142 v172 v186 v198) (block 20))) + (let (v96 u32) (cast v92)) + (let (v97 u32) (mod.unchecked v96 2)) + (assertz 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) (cast v92)) + (let (v107 u32) (mod.unchecked v106 2)) + (assertz v107) + (let (v108 (ptr i32)) (inttoptr v106)) + (store v108 v105) + (let (v110 u32) (cast v109)) + (let (v111 u32) (add.checked v110 4)) + (let (v112 u32) (mod.unchecked v111 2)) + (assertz v112) + (let (v113 (ptr i32)) (inttoptr v111)) + (let (v114 i32) (load v113)) + (let (v115 u32) (cast v109)) + (let (v116 u32) (mod.unchecked v115 2)) + (assertz 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 - (let (v133 u32) (cast v131)) - (let (v134 u32) (mod.unchecked v133 2)) - (assertz v134) - (let (v135 (ptr i32)) (inttoptr v133)) - (let (v136 i32) (load v135)) - (let (v137 i32) (const.i32 2)) - (let (v138 i32) (bor v136 v137)) - (let (v139 u32) (cast v131)) - (let (v140 u32) (mod.unchecked v139 2)) - (assertz v140) - (let (v141 (ptr i32)) (inttoptr v139)) - (store v141 v138) - (br (block 18 v143 v131 v173 v187 v199))) + (param v152 i32) + (param v157 i32) + (param v183 i32) + (param v198 i32) + (param v211 i32) + (let (v158 u32) (cast v152)) + (let (v159 u32) (mod.unchecked v158 2)) + (assertz v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v161 u32) (cast v157)) + (let (v162 u32) (add.checked v161 8)) + (let (v163 u32) (mod.unchecked v162 2)) + (assertz 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 - (br (block 10))) + (let (v143 u32) (cast v140)) + (let (v144 u32) (mod.unchecked v143 2)) + (assertz 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) (cast v140)) + (let (v150 u32) (mod.unchecked v149 2)) + (assertz v150) + (let (v151 (ptr i32)) (inttoptr v149)) + (store v151 v148) + (br (block 19 v153 v140 v184 v199 v212))) (block 21 - (param v321 i32) - (param v322 i32) - (param v327 i32) - (param v328 i32) - (param v329 i32) - (let (v323 u32) (cast v321)) - (let (v324 u32) (mod.unchecked v323 2)) - (assertz v324) - (let (v325 (ptr i32)) (inttoptr v323)) - (store v325 v322) - (let (v326 i1) (neq v322 0)) - (condbr v326 (block 4 v322 v321 v327 v328 v329) (block 32))) + (br (block 10))) (block 22 - (let (v181 i32) (const.i32 72)) - (let (v182 i32) (add.wrapping v168 v181)) - (let (v183 i32) (sub.wrapping v167 v170)) - (let (v190 i32) (band v183 v184)) - (let (v191 u32) (bitcast v182)) - (let (v192 u32) (bitcast v190)) - (let (v193 i1) (lte v191 v192)) - (let (v194 i32) (sext v193)) - (let (v195 i1) (neq v194 0)) - (condbr v195 (block 24) (block 25))) - - (block 23 (param v312 i32) (param v313 i32) - (let (v314 i32) (const.i32 1)) - (let (v315 i32) (bor v313 v314)) - (let (v316 u32) (cast v312)) - (let (v317 u32) (mod.unchecked v316 2)) - (assertz v317) - (let (v318 (ptr i32)) (inttoptr v316)) - (store v318 v315) - (let (v319 i32) (const.i32 8)) - (let (v320 i32) (add.wrapping v312 v319)) - (ret v320)) - - (block 24 - (let (v215 i32) (const.i32 0)) - (let (v216 i32) (const.i32 0)) - (let (v217 u32) (cast v190)) - (let (v218 u32) (mod.unchecked v217 2)) - (assertz v218) - (let (v219 (ptr i32)) (inttoptr v217)) - (store v219 v216) - (let (v220 i32) (const.i32 -8)) - (let (v221 i32) (add.wrapping v190 v220)) - (let (v222 i64) (const.i64 0)) - (let (v223 u32) (cast v221)) - (let (v224 u32) (mod.unchecked v223 2)) - (assertz v224) - (let (v225 (ptr i64)) (inttoptr v223)) - (store v225 v222) - (let (v226 u32) (cast v161)) - (let (v227 u32) (mod.unchecked v226 2)) - (assertz v227) - (let (v228 (ptr i32)) (inttoptr v226)) - (let (v229 i32) (load v228)) - (let (v230 i32) (const.i32 -4)) - (let (v231 i32) (band v229 v230)) - (let (v232 u32) (cast v221)) - (let (v233 u32) (mod.unchecked v232 2)) - (assertz v233) - (let (v234 (ptr i32)) (inttoptr v232)) - (store v234 v231) - (let (v235 u32) (cast v161)) - (let (v236 u32) (mod.unchecked v235 2)) - (assertz v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 i32) (const.i32 -4)) - (let (v240 i32) (band v238 v239)) - (let (v241 i1) (eq v240 0)) - (let (v242 i32) (zext v241)) - (let (v243 i1) (neq v242 0)) - (condbr v243 (block 27 v221 v215 v161 v168) (block 28))) + (param v335 i32) + (param v336 i32) + (param v341 i32) + (param v342 i32) + (param v343 i32) + (let (v337 u32) (cast v335)) + (let (v338 u32) (mod.unchecked v337 2)) + (assertz 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) (cast v326)) + (let (v331 u32) (mod.unchecked v330 2)) + (assertz 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 (v202 i32) (band v196 v168)) - (let (v203 i1) (neq v202 0)) - (condbr v203 (block 21 v204 v205 v170 v184 v196) (block 26))) + (let (v229 i32) (const.i32 0)) + (let (v230 i32) (const.i32 0)) + (let (v231 u32) (cast v203)) + (let (v232 u32) (mod.unchecked v231 2)) + (assertz 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) (cast v235)) + (let (v238 u32) (mod.unchecked v237 2)) + (assertz v238) + (let (v239 (ptr i64)) (inttoptr v237)) + (store v239 v236) + (let (v240 u32) (cast v172)) + (let (v241 u32) (mod.unchecked v240 2)) + (assertz 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) (cast v235)) + (let (v247 u32) (mod.unchecked v246 2)) + (assertz v247) + (let (v248 (ptr i32)) (inttoptr v246)) + (store v248 v245) + (let (v249 u32) (cast v172)) + (let (v250 u32) (mod.unchecked v249 2)) + (assertz 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 (v206 i32) (const.i32 -4)) - (let (v207 i32) (band v205 v206)) - (let (v208 u32) (cast v204)) - (let (v209 u32) (mod.unchecked v208 2)) - (assertz v209) - (let (v210 (ptr i32)) (inttoptr v208)) - (store v210 v207) - (let (v211 u32) (cast v161)) - (let (v212 u32) (mod.unchecked v211 2)) - (assertz v212) - (let (v213 (ptr i32)) (inttoptr v211)) - (let (v214 i32) (load v213)) - (br (block 23 v161 v214))) + (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 - (param v266 i32) - (param v267 i32) - (param v268 i32) - (param v274 i32) - (let (v269 i32) (bor v267 v268)) - (let (v270 u32) (cast v266)) - (let (v271 u32) (add.checked v270 4)) - (let (v272 u32) (mod.unchecked v271 2)) - (assertz v272) - (let (v273 (ptr i32)) (inttoptr v271)) - (store v273 v269) - (let (v275 u32) (cast v274)) - (let (v276 u32) (mod.unchecked v275 2)) - (assertz v276) - (let (v277 (ptr i32)) (inttoptr v275)) - (let (v278 i32) (load v277)) - (let (v279 i32) (const.i32 -2)) - (let (v280 i32) (band v278 v279)) - (let (v281 u32) (cast v274)) - (let (v282 u32) (mod.unchecked v281 2)) - (assertz v282) - (let (v283 (ptr i32)) (inttoptr v281)) - (store v283 v280) - (let (v284 u32) (cast v268)) - (let (v285 u32) (mod.unchecked v284 2)) - (assertz v285) - (let (v286 (ptr i32)) (inttoptr v284)) - (let (v287 i32) (load v286)) - (let (v288 i32) (const.i32 3)) - (let (v289 i32) (band v287 v288)) - (let (v290 i32) (bor v289 v266)) - (let (v291 u32) (cast v268)) - (let (v292 u32) (mod.unchecked v291 2)) - (assertz v292) - (let (v293 (ptr i32)) (inttoptr v291)) - (store v293 v290) - (let (v294 i32) (const.i32 2)) - (let (v295 i32) (band v287 v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 30) (block 31))) + (let (v220 i32) (const.i32 -4)) + (let (v221 i32) (band v219 v220)) + (let (v222 u32) (cast v218)) + (let (v223 u32) (mod.unchecked v222 2)) + (assertz v223) + (let (v224 (ptr i32)) (inttoptr v222)) + (store v224 v221) + (let (v225 u32) (cast v172)) + (let (v226 u32) (mod.unchecked v225 2)) + (assertz v226) + (let (v227 (ptr i32)) (inttoptr v225)) + (let (v228 i32) (load v227)) + (br (block 24 v172 v228))) (block 28 - (let (v244 i32) (const.i32 2)) - (let (v245 i32) (band v238 v244)) - (let (v246 i1) (neq v245 0)) - (condbr v246 (block 27 v221 v215 v161 v168) (block 29))) + (param v280 i32) + (param v281 i32) + (param v282 i32) + (param v288 i32) + (let (v283 i32) (bor v281 v282)) + (let (v284 u32) (cast v280)) + (let (v285 u32) (add.checked v284 4)) + (let (v286 u32) (mod.unchecked v285 2)) + (assertz v286) + (let (v287 (ptr i32)) (inttoptr v285)) + (store v287 v283) + (let (v289 u32) (cast v288)) + (let (v290 u32) (mod.unchecked v289 2)) + (assertz 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) (cast v288)) + (let (v296 u32) (mod.unchecked v295 2)) + (assertz v296) + (let (v297 (ptr i32)) (inttoptr v295)) + (store v297 v294) + (let (v298 u32) (cast v282)) + (let (v299 u32) (mod.unchecked v298 2)) + (assertz 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) (cast v282)) + (let (v306 u32) (mod.unchecked v305 2)) + (assertz 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 (v247 u32) (cast v240)) - (let (v248 u32) (add.checked v247 4)) - (let (v249 u32) (mod.unchecked v248 2)) - (assertz v249) - (let (v250 (ptr i32)) (inttoptr v248)) - (let (v251 i32) (load v250)) - (let (v252 i32) (const.i32 3)) - (let (v253 i32) (band v251 v252)) - (let (v254 i32) (bor v253 v221)) - (let (v255 u32) (cast v240)) - (let (v256 u32) (add.checked v255 4)) - (let (v257 u32) (mod.unchecked v256 2)) - (assertz v257) - (let (v258 (ptr i32)) (inttoptr v256)) - (store v258 v254) - (let (v259 u32) (cast v221)) - (let (v260 u32) (add.checked v259 4)) - (let (v261 u32) (mod.unchecked v260 2)) - (assertz v261) - (let (v262 (ptr i32)) (inttoptr v260)) - (let (v263 i32) (load v262)) - (let (v264 i32) (const.i32 3)) - (let (v265 i32) (band v263 v264)) - (br (block 27 v221 v265 v161 v168))) + (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 (v301 i32) (const.i32 -3)) - (let (v302 i32) (band v290 v301)) - (let (v303 u32) (cast v268)) - (let (v304 u32) (mod.unchecked v303 2)) - (assertz v304) - (let (v305 (ptr i32)) (inttoptr v303)) - (store v305 v302) - (let (v306 u32) (cast v266)) - (let (v307 u32) (mod.unchecked v306 2)) - (assertz v307) - (let (v308 (ptr i32)) (inttoptr v306)) - (let (v309 i32) (load v308)) - (let (v310 i32) (const.i32 2)) - (let (v311 i32) (bor v309 v310)) - (br (block 23 v266 v311))) + (let (v261 u32) (cast v254)) + (let (v262 u32) (add.checked v261 4)) + (let (v263 u32) (mod.unchecked v262 2)) + (assertz 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) (cast v254)) + (let (v270 u32) (add.checked v269 4)) + (let (v271 u32) (mod.unchecked v270 2)) + (assertz v271) + (let (v272 (ptr i32)) (inttoptr v270)) + (store v272 v268) + (let (v273 u32) (cast v235)) + (let (v274 u32) (add.checked v273 4)) + (let (v275 u32) (mod.unchecked v274 2)) + (assertz 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 (v297 u32) (cast v266)) - (let (v298 u32) (mod.unchecked v297 2)) - (assertz v298) - (let (v299 (ptr i32)) (inttoptr v297)) - (let (v300 i32) (load v299)) - (br (block 23 v266 v300))) + (let (v315 i32) (const.i32 -3)) + (let (v316 i32) (band v304 v315)) + (let (v317 u32) (cast v282)) + (let (v318 u32) (mod.unchecked v317 2)) + (assertz v318) + (let (v319 (ptr i32)) (inttoptr v317)) + (store v319 v316) + (let (v320 u32) (cast v280)) + (let (v321 u32) (mod.unchecked v320 2)) + (assertz 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) (cast v280)) + (let (v312 u32) (mod.unchecked v311 2)) + (assertz v312) + (let (v313 (ptr i32)) (inttoptr v311)) + (let (v314 i32) (load v313)) + (br (block 24 v280 v314))) + + (block 33 (br (block 5))) ) @@ -992,73 +1080,14 @@ (br (block 7 v175 v185))) ) - (func (export #wit_bindgen::rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (cast v0)) - (let (v2 u32) (add.checked v1 1048581)) - (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 u8) (trunc v8)) - (let (v10 u32) (cast v7)) - (let (v11 u32) (add.checked v10 1048581)) - (let (v12 (ptr u8)) (inttoptr v11)) - (store v12 v9) - (br (block 2))) - ) - (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 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) + (br (block 1 v5))) (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) (cast v9)) - (let (v11 u32) (add.checked v10 1048580)) - (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)) ) ;; Imports diff --git a/tests/integration/expected/components/inc_wasm_component.wat b/tests/integration/expected/components/inc_wasm_component.wat index 48063992f..bd5c00de8 100644 --- a/tests/integration/expected/components/inc_wasm_component.wat +++ b/tests/integration/expected/components/inc_wasm_component.wat @@ -9,28 +9,22 @@ (core module (;0;) (type (;0;) (func (param i32 i32) (result i32))) (type (;1;) (func)) - (type (;2;) (func (param i32) (result i32))) - (type (;3;) (func (param i32 i32 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 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 (;2;) (type 2) (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 $__rust_alloc (;3;) (type 0) (param i32 i32) (result i32) - i32.const 1048576 + (func $__rust_alloc (;2;) (type 0) (param i32 i32) (result i32) + i32.const 1048580 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;4;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048576 + i32.const 1048580 local.get 2 local.get 3 call $::alloc @@ -46,7 +40,7 @@ i32.lt_u select memory.copy - i32.const 1048576 + i32.const 1048580 local.get 0 local.get 2 local.get 1 @@ -54,309 +48,361 @@ end local.get 4 ) - (func $wee_alloc::alloc_first_fit (;5;) (type 4) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32) + (func $inc (;4;) (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 (;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=1048584 + 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 $wit_bindgen_rt::run_ctors_once (;6;) (type 1) + block ;; label = @1 + i32.const 0 + i32.load8_u offset=1048585 + br_if 0 (;@1;) + call $__wasm_call_ctors + i32.const 0 + i32.const 1 + i32.store8 offset=1048585 + end + ) + (func $wee_alloc::alloc_first_fit (;7;) (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 - i32.eqz br_if 0 (;@1;) - 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 = @2 - local.get 3 - i32.const 8 - i32.add - local.set 7 + 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 - local.get 3 - i32.load offset=8 - local.tee 0 + 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 - br_if 0 (;@4;) - local.get 3 - local.set 1 - br 1 (;@3;) + select + local.set 8 end - loop ;; label = @4 - local.get 7 - local.get 0 - i32.const -2 - i32.and - i32.store + block ;; label = @4 local.get 3 - i32.load offset=4 + i32.load + local.tee 1 i32.const -4 i32.and - local.tee 1 - i32.load - local.set 7 - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.load - local.tee 8 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - block ;; label = @7 - local.get 8 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - local.get 0 - local.get 0 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 0 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 1 (;@5;) - local.get 0 - i32.const -4 - i32.and - local.set 0 - local.get 8 - i32.load - local.set 7 - end - local.get 8 - local.get 7 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 0 - end - local.get 3 - local.get 7 + 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 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@5;) - local.get 1 - local.get 1 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 local.get 1 + i32.const -4 + i32.and + i32.or i32.store - local.get 1 - i32.const 8 - i32.add + 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 - local.set 3 - local.get 1 - i32.load offset=8 - local.tee 0 - i32.const 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 - local.tee 3 - local.get 7 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@3;) + i32.store block ;; label = @4 - block ;; label = @5 - local.get 7 - i32.const 72 - i32.add - local.get 3 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 3 - i32.le_u - br_if 0 (;@5;) - local.get 4 - local.get 7 - i32.and - br_if 2 (;@3;) - local.get 2 - local.get 0 - i32.const -4 - i32.and - i32.store - local.get 1 - i32.load - local.set 0 - local.get 1 - local.set 3 - br 1 (;@4;) - end - i32.const 0 - local.set 0 - local.get 3 - i32.const 0 - i32.store local.get 3 - i32.const -8 - i32.add - local.tee 3 - i64.const 0 - i64.store align=4 - local.get 3 - local.get 1 i32.load + local.tee 9 i32.const -4 i32.and - i32.store - block ;; label = @5 - local.get 1 - i32.load - local.tee 2 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 2 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 3 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - i32.const 3 - i32.and - local.set 0 - end - local.get 3 - local.get 0 - local.get 1 - i32.or - i32.store offset=4 - local.get 7 - local.get 7 - i32.load - i32.const -2 + local.tee 8 + i32.eqz + br_if 0 (;@4;) + local.get 9 + i32.const 2 i32.and - i32.store - local.get 1 - local.get 1 - i32.load - local.tee 0 + br_if 0 (;@4;) + local.get 8 + local.get 8 + i32.load offset=4 i32.const 3 i32.and - local.get 3 + local.get 1 i32.or - local.tee 7 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 3 - i32.load - local.set 0 - br 1 (;@4;) - end + i32.store offset=4 local.get 1 - local.get 7 - i32.const -3 + i32.load offset=4 + i32.const 3 i32.and - i32.store - local.get 3 - i32.load - i32.const 2 - i32.or - local.set 0 + local.set 7 end + local.get 1 + local.get 7 local.get 3 + i32.or + i32.store offset=4 local.get 0 - i32.const 1 + 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 - i32.const 8 - i32.add - return + 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 2 + local.get 1 local.get 0 + i32.const 1 + i32.or i32.store - local.get 0 - local.set 3 - local.get 0 - br_if 0 (;@2;) + 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 (;6;) (type 4) (param i32 i32 i32) (result i32) + (func $::alloc (;8;) (type 4) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -460,7 +506,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;7;) (type 5) (param i32 i32 i32 i32) + (func $::dealloc (;9;) (type 5) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -633,55 +679,22 @@ i32.store end ) - (func $wit_bindgen::rt::run_ctors_once (;8;) (type 1) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048581 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048581 - end - ) - (func $cabi_realloc (;9;) (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=1048580 - 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 + (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;) 1 1 funcref) + (table (;0;) 2 2 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 $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") ) (alias export 0 "add" (func (;0;))) (core func (;0;) (canon lower (func 0))) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir index 1883f5ac3..244044fd4 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir @@ -2245,144 +2245,107 @@ (let (v9 i32) (const.i32 0)) (call #alloc::raw_vec::RawVec::try_allocate_in v7 v8 v9) (let (v10 u32) (cast v4)) - (let (v11 u32) (add.checked v10 12)) + (let (v11 u32) (add.checked v10 8)) (let (v12 u32) (mod.unchecked v11 2)) (assertz v12) (let (v13 (ptr i32)) (inttoptr v11)) (let (v14 i32) (load v13)) (let (v15 u32) (cast v4)) - (let (v16 u32) (add.checked v15 8)) + (let (v16 u32) (add.checked v15 4)) (let (v17 u32) (mod.unchecked v16 2)) (assertz v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 u32) (cast v4)) - (let (v21 u32) (add.checked v20 4)) - (let (v22 u32) (mod.unchecked v21 2)) - (assertz v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i1) (eq v24 0)) - (let (v26 i32) (zext v25)) - (let (v27 i1) (neq v26 0)) - (condbr v27 (block 3) (block 4))) + (let (v20 i1) (eq v19 0)) + (let (v21 i32) (zext v20)) + (let (v22 i1) (neq v21 0)) + (condbr v22 (block 2) (block 3))) - (block 1) + (block 1 + (ret)) (block 2 - (call #alloc::raw_vec::capacity_overflow) - (unreachable)) + (let (v28 u32) (cast v4)) + (let (v29 u32) (add.checked v28 12)) + (let (v30 u32) (mod.unchecked v29 2)) + (assertz v30) + (let (v31 (ptr i32)) (inttoptr v29)) + (let (v32 i32) (load v31)) + (let [(v33 i32) (v34 felt)] (call (#miden::note #get_inputs) v32)) + (let (v35 i32) (const.i32 0)) + (let (v36 u32) (cast v0)) + (let (v37 u32) (add.checked v36 8)) + (let (v38 u32) (mod.unchecked v37 2)) + (assertz v38) + (let (v39 (ptr i32)) (inttoptr v37)) + (store v39 v35) + (let (v40 u32) (cast v0)) + (let (v41 u32) (add.checked v40 4)) + (let (v42 u32) (mod.unchecked v41 2)) + (assertz v42) + (let (v43 (ptr i32)) (inttoptr v41)) + (store v43 v32) + (let (v44 u32) (cast v0)) + (let (v45 u32) (mod.unchecked v44 2)) + (assertz v45) + (let (v46 (ptr i32)) (inttoptr v44)) + (store v46 v14) + (let (v47 i32) (const.i32 16)) + (let (v48 i32) (add.wrapping v4 v47)) + (let (v49 (ptr i32)) (global.symbol #__stack_pointer)) + (store v49 v48) + (br (block 1))) (block 3 - (let [(v31 i32) (v32 felt)] (call (#miden::note #get_inputs) v14)) - (let (v33 i32) (const.i32 0)) - (let (v34 u32) (cast v0)) - (let (v35 u32) (add.checked v34 8)) - (let (v36 u32) (mod.unchecked v35 2)) - (assertz v36) - (let (v37 (ptr i32)) (inttoptr v35)) - (store v37 v33) - (let (v38 u32) (cast v0)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 2)) - (assertz v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (store v41 v14) - (let (v42 u32) (cast v0)) - (let (v43 u32) (mod.unchecked v42 2)) - (assertz v43) - (let (v44 (ptr i32)) (inttoptr v42)) - (store v44 v19) - (let (v45 i32) (const.i32 16)) - (let (v46 i32) (add.wrapping v4 v45)) - (let (v47 (ptr i32)) (global.symbol #__stack_pointer)) - (store v47 v46) - (ret)) - - (block 4 - (let (v28 i1) (eq v19 0)) - (let (v29 i32) (zext v28)) - (let (v30 i1) (neq v29 0)) - (condbr v30 (block 2) (block 5))) - - (block 5 - (call #alloc::alloc::handle_alloc_error v19 v14) + (let (v23 u32) (cast v4)) + (let (v24 u32) (add.checked v23 12)) + (let (v25 u32) (mod.unchecked v24 2)) + (assertz v25) + (let (v26 (ptr i32)) (inttoptr v24)) + (let (v27 i32) (load v26)) + (call #alloc::raw_vec::handle_error v14 v27) (unreachable)) ) (func (export #miden_tx_kernel_sys::add_asset) (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 16)) - (let (v5 i32) (sub.wrapping v3 v4)) - (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) - (store v6 v5) - (let (v7 u32) (cast v1)) + (let (v2 u32) (cast v1)) + (let (v3 u32) (mod.unchecked v2 2)) + (assertz v3) + (let (v4 (ptr felt)) (inttoptr v2)) + (let (v5 felt) (load v4)) + (let (v6 u32) (cast v1)) + (let (v7 u32) (add.checked v6 4)) (let (v8 u32) (mod.unchecked v7 2)) (assertz v8) (let (v9 (ptr felt)) (inttoptr v7)) (let (v10 felt) (load v9)) (let (v11 u32) (cast v1)) - (let (v12 u32) (add.checked v11 4)) + (let (v12 u32) (add.checked v11 8)) (let (v13 u32) (mod.unchecked v12 2)) (assertz v13) (let (v14 (ptr felt)) (inttoptr v12)) (let (v15 felt) (load v14)) (let (v16 u32) (cast v1)) - (let (v17 u32) (add.checked v16 8)) + (let (v17 u32) (add.checked v16 12)) (let (v18 u32) (mod.unchecked v17 2)) (assertz v18) (let (v19 (ptr felt)) (inttoptr v17)) (let (v20 felt) (load v19)) - (let (v21 u32) (cast v1)) - (let (v22 u32) (add.checked v21 12)) - (let (v23 u32) (mod.unchecked v22 2)) - (assertz v23) - (let (v24 (ptr felt)) (inttoptr v22)) - (let (v25 felt) (load v24)) - (let [(v26 felt) (v27 felt) (v28 felt) (v29 felt)] (call (#miden::account #add_asset) v10 v15 v20 v25)) - (let (v30 u32) (cast v5)) - (let (v31 (ptr felt)) (inttoptr v30)) - (store v31 v26) - (let (v32 u32) (add.checked v30 8)) - (let (v33 (ptr felt)) (inttoptr v32)) - (store v33 v27) - (let (v34 u32) (add.checked v30 16)) - (let (v35 (ptr felt)) (inttoptr v34)) - (store v35 v28) - (let (v36 u32) (add.checked v30 24)) - (let (v37 (ptr felt)) (inttoptr v36)) - (store v37 v29) - (let (v38 i32) (const.i32 8)) - (let (v39 i32) (add.wrapping v0 v38)) - (let (v40 i32) (const.i32 8)) - (let (v41 i32) (add.wrapping v5 v40)) - (let (v42 u32) (cast v41)) - (let (v43 u32) (mod.unchecked v42 2)) - (assertz v43) - (let (v44 (ptr i64)) (inttoptr v42)) - (let (v45 i64) (load v44)) - (let (v46 u32) (cast v39)) - (let (v47 u32) (mod.unchecked v46 2)) - (assertz v47) - (let (v48 (ptr i64)) (inttoptr v46)) - (store v48 v45) - (let (v49 u32) (cast v5)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i64)) (inttoptr v49)) - (let (v52 i64) (load v51)) - (let (v53 u32) (cast v0)) - (let (v54 u32) (mod.unchecked v53 2)) - (assertz v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v52) - (let (v56 i32) (const.i32 16)) - (let (v57 i32) (add.wrapping v5 v56)) - (let (v58 (ptr i32)) (global.symbol #__stack_pointer)) - (store v58 v57) + (let [(v21 felt) (v22 felt) (v23 felt) (v24 felt)] (call (#miden::account #add_asset) v5 v10 v15 v20)) + (let (v25 u32) (cast v0)) + (let (v26 (ptr felt)) (inttoptr v25)) + (store v26 v21) + (let (v27 u32) (add.checked v25 8)) + (let (v28 (ptr felt)) (inttoptr v27)) + (store v28 v22) + (let (v29 u32) (add.checked v25 16)) + (let (v30 (ptr felt)) (inttoptr v29)) + (store v30 v23) + (let (v31 u32) (add.checked v25 24)) + (let (v32 (ptr felt)) (inttoptr v31)) + (store v32 v24) (br (block 1))) (block 1 @@ -2392,76 +2355,42 @@ (func (export #miden_tx_kernel_sys::remove_asset) (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 16)) - (let (v5 i32) (sub.wrapping v3 v4)) - (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) - (store v6 v5) - (let (v7 u32) (cast v1)) + (let (v2 u32) (cast v1)) + (let (v3 u32) (mod.unchecked v2 2)) + (assertz v3) + (let (v4 (ptr felt)) (inttoptr v2)) + (let (v5 felt) (load v4)) + (let (v6 u32) (cast v1)) + (let (v7 u32) (add.checked v6 4)) (let (v8 u32) (mod.unchecked v7 2)) (assertz v8) (let (v9 (ptr felt)) (inttoptr v7)) (let (v10 felt) (load v9)) (let (v11 u32) (cast v1)) - (let (v12 u32) (add.checked v11 4)) + (let (v12 u32) (add.checked v11 8)) (let (v13 u32) (mod.unchecked v12 2)) (assertz v13) (let (v14 (ptr felt)) (inttoptr v12)) (let (v15 felt) (load v14)) (let (v16 u32) (cast v1)) - (let (v17 u32) (add.checked v16 8)) + (let (v17 u32) (add.checked v16 12)) (let (v18 u32) (mod.unchecked v17 2)) (assertz v18) (let (v19 (ptr felt)) (inttoptr v17)) (let (v20 felt) (load v19)) - (let (v21 u32) (cast v1)) - (let (v22 u32) (add.checked v21 12)) - (let (v23 u32) (mod.unchecked v22 2)) - (assertz v23) - (let (v24 (ptr felt)) (inttoptr v22)) - (let (v25 felt) (load v24)) - (let [(v26 felt) (v27 felt) (v28 felt) (v29 felt)] (call (#miden::account #remove_asset) v10 v15 v20 v25)) - (let (v30 u32) (cast v5)) - (let (v31 (ptr felt)) (inttoptr v30)) - (store v31 v26) - (let (v32 u32) (add.checked v30 8)) - (let (v33 (ptr felt)) (inttoptr v32)) - (store v33 v27) - (let (v34 u32) (add.checked v30 16)) - (let (v35 (ptr felt)) (inttoptr v34)) - (store v35 v28) - (let (v36 u32) (add.checked v30 24)) - (let (v37 (ptr felt)) (inttoptr v36)) - (store v37 v29) - (let (v38 i32) (const.i32 8)) - (let (v39 i32) (add.wrapping v0 v38)) - (let (v40 i32) (const.i32 8)) - (let (v41 i32) (add.wrapping v5 v40)) - (let (v42 u32) (cast v41)) - (let (v43 u32) (mod.unchecked v42 2)) - (assertz v43) - (let (v44 (ptr i64)) (inttoptr v42)) - (let (v45 i64) (load v44)) - (let (v46 u32) (cast v39)) - (let (v47 u32) (mod.unchecked v46 2)) - (assertz v47) - (let (v48 (ptr i64)) (inttoptr v46)) - (store v48 v45) - (let (v49 u32) (cast v5)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i64)) (inttoptr v49)) - (let (v52 i64) (load v51)) - (let (v53 u32) (cast v0)) - (let (v54 u32) (mod.unchecked v53 2)) - (assertz v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v52) - (let (v56 i32) (const.i32 16)) - (let (v57 i32) (add.wrapping v5 v56)) - (let (v58 (ptr i32)) (global.symbol #__stack_pointer)) - (store v58 v57) + (let [(v21 felt) (v22 felt) (v23 felt) (v24 felt)] (call (#miden::account #remove_asset) v5 v10 v15 v20)) + (let (v25 u32) (cast v0)) + (let (v26 (ptr felt)) (inttoptr v25)) + (store v26 v21) + (let (v27 u32) (add.checked v25 8)) + (let (v28 (ptr felt)) (inttoptr v27)) + (store v28 v22) + (let (v29 u32) (add.checked v25 16)) + (let (v30 (ptr felt)) (inttoptr v29)) + (store v30 v23) + (let (v31 u32) (add.checked v25 24)) + (let (v32 (ptr felt)) (inttoptr v31)) + (store v32 v24) (br (block 1))) (block 1 @@ -2542,67 +2471,64 @@ (let (v9 i32) (const.i32 0)) (call #alloc::raw_vec::RawVec::try_allocate_in v8 v1 v9) (let (v10 u32) (cast v5)) - (let (v11 u32) (add.checked v10 12)) + (let (v11 u32) (add.checked v10 8)) (let (v12 u32) (mod.unchecked v11 2)) (assertz v12) (let (v13 (ptr i32)) (inttoptr v11)) (let (v14 i32) (load v13)) (let (v15 u32) (cast v5)) - (let (v16 u32) (add.checked v15 8)) + (let (v16 u32) (add.checked v15 4)) (let (v17 u32) (mod.unchecked v16 2)) (assertz v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 u32) (cast v5)) - (let (v21 u32) (add.checked v20 4)) - (let (v22 u32) (mod.unchecked v21 2)) - (assertz v22) - (let (v23 (ptr i32)) (inttoptr v21)) - (let (v24 i32) (load v23)) - (let (v25 i1) (eq v24 0)) - (let (v26 i32) (zext v25)) - (let (v27 i1) (neq v26 0)) - (condbr v27 (block 3) (block 4))) + (let (v20 i1) (eq v19 0)) + (let (v21 i32) (zext v20)) + (let (v22 i1) (neq v21 0)) + (condbr v22 (block 2) (block 3))) - (block 1) + (block 1 + (ret)) (block 2 - (call #alloc::raw_vec::capacity_overflow) - (unreachable)) + (let (v28 u32) (cast v5)) + (let (v29 u32) (add.checked v28 12)) + (let (v30 u32) (mod.unchecked v29 2)) + (assertz v30) + (let (v31 (ptr i32)) (inttoptr v29)) + (let (v32 i32) (load v31)) + (let (v33 i32) (const.i32 0)) + (let (v34 u32) (cast v0)) + (let (v35 u32) (add.checked v34 8)) + (let (v36 u32) (mod.unchecked v35 2)) + (assertz v36) + (let (v37 (ptr i32)) (inttoptr v35)) + (store v37 v33) + (let (v38 u32) (cast v0)) + (let (v39 u32) (add.checked v38 4)) + (let (v40 u32) (mod.unchecked v39 2)) + (assertz v40) + (let (v41 (ptr i32)) (inttoptr v39)) + (store v41 v32) + (let (v42 u32) (cast v0)) + (let (v43 u32) (mod.unchecked v42 2)) + (assertz v43) + (let (v44 (ptr i32)) (inttoptr v42)) + (store v44 v14) + (let (v45 i32) (const.i32 16)) + (let (v46 i32) (add.wrapping v5 v45)) + (let (v47 (ptr i32)) (global.symbol #__stack_pointer)) + (store v47 v46) + (br (block 1))) (block 3 - (let (v31 i32) (const.i32 0)) - (let (v32 u32) (cast v0)) - (let (v33 u32) (add.checked v32 8)) - (let (v34 u32) (mod.unchecked v33 2)) - (assertz v34) - (let (v35 (ptr i32)) (inttoptr v33)) - (store v35 v31) - (let (v36 u32) (cast v0)) - (let (v37 u32) (add.checked v36 4)) - (let (v38 u32) (mod.unchecked v37 2)) - (assertz v38) - (let (v39 (ptr i32)) (inttoptr v37)) - (store v39 v14) - (let (v40 u32) (cast v0)) - (let (v41 u32) (mod.unchecked v40 2)) - (assertz v41) - (let (v42 (ptr i32)) (inttoptr v40)) - (store v42 v19) - (let (v43 i32) (const.i32 16)) - (let (v44 i32) (add.wrapping v5 v43)) - (let (v45 (ptr i32)) (global.symbol #__stack_pointer)) - (store v45 v44) - (ret)) - - (block 4 - (let (v28 i1) (eq v19 0)) - (let (v29 i32) (zext v28)) - (let (v30 i1) (neq v29 0)) - (condbr v30 (block 2) (block 5))) - - (block 5 - (call #alloc::alloc::handle_alloc_error v19 v14) + (let (v23 u32) (cast v5)) + (let (v24 u32) (add.checked v23 12)) + (let (v25 u32) (mod.unchecked v24 2)) + (assertz v25) + (let (v26 (ptr i32)) (inttoptr v24)) + (let (v27 i32) (load v26)) + (call #alloc::raw_vec::handle_error v14 v27) (unreachable)) ) @@ -2728,118 +2654,97 @@ (param i32) (param felt) (block 0 (param v0 i32) (param v1 felt) (let (v2 i32) (const.i32 0)) - (let (v3 i64) (const.i64 0)) - (let (v4 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v5 i32) (const.i32 64)) - (let (v6 i32) (sub.wrapping v4 v5)) - (let (v7 (ptr i32)) (global.symbol #__stack_pointer)) - (store v7 v6) - (let (v8 i32) (const.i32 12)) - (let (v9 i32) (add.wrapping v6 v8)) - (let (v10 i64) (cast v1)) - (let (v11 i32) (trunc v10)) - (let (v12 i32) (const.i32 2)) - (let (v13 u32) (bitcast v12)) - (let (v14 i32) (shl.wrapping v11 v13)) - (call #alloc::vec::Vec::with_capacity v9 v14) - (let (v15 u32) (cast v6)) - (let (v16 u32) (add.checked v15 16)) - (let (v17 u32) (mod.unchecked v16 2)) - (assertz v17) - (let (v18 (ptr i32)) (inttoptr v16)) - (let (v19 i32) (load v18)) - (let (v20 i32) (const.i32 40)) - (let (v21 i32) (add.wrapping v6 v20)) - (let [(v22 felt) (v23 felt) (v24 felt) (v25 felt) (v26 i32)] (call (#miden:stdlib/std_mem #pipe_words_to_memory) v1 v19)) - (let (v27 u32) (cast v21)) - (let (v28 (ptr felt)) (inttoptr v27)) - (store v28 v22) - (let (v29 u32) (add.checked v27 8)) - (let (v30 (ptr felt)) (inttoptr v29)) - (store v30 v23) - (let (v31 u32) (add.checked v27 16)) - (let (v32 (ptr felt)) (inttoptr v31)) - (store v32 v24) - (let (v33 u32) (add.checked v27 24)) - (let (v34 (ptr felt)) (inttoptr v33)) - (store v34 v25) - (let (v35 u32) (add.checked v27 32)) - (let (v36 (ptr i32)) (inttoptr v35)) - (store v36 v26) - (let (v37 i32) (const.i32 24)) - (let (v38 i32) (add.wrapping v6 v37)) - (let (v39 i32) (const.i32 8)) - (let (v40 i32) (add.wrapping v38 v39)) - (let (v41 i32) (const.i32 40)) - (let (v42 i32) (add.wrapping v6 v41)) - (let (v43 i32) (const.i32 8)) - (let (v44 i32) (add.wrapping v42 v43)) - (let (v45 u32) (cast v44)) - (let (v46 u32) (mod.unchecked v45 3)) - (assertz v46) - (let (v47 (ptr i64)) (inttoptr v45)) - (let (v48 i64) (load v47)) - (let (v49 u32) (cast v40)) - (let (v50 u32) (mod.unchecked v49 3)) - (assertz v50) - (let (v51 (ptr i64)) (inttoptr v49)) - (store v51 v48) - (let (v52 u32) (cast v6)) - (let (v53 u32) (add.checked v52 40)) - (let (v54 u32) (mod.unchecked v53 3)) - (assertz v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (let (v56 i64) (load v55)) - (let (v57 u32) (cast v6)) - (let (v58 u32) (add.checked v57 24)) - (let (v59 u32) (mod.unchecked v58 3)) - (assertz v59) - (let (v60 (ptr i64)) (inttoptr v58)) - (store v60 v56) - (let (v61 i32) (const.i32 8)) - (let (v62 i32) (add.wrapping v0 v61)) - (let (v63 u32) (cast v62)) + (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 i64) (cast v1)) + (let (v8 i32) (trunc v7)) + (let (v9 i32) (const.i32 2)) + (let (v10 u32) (bitcast v9)) + (let (v11 i32) (shl.wrapping v8 v10)) + (call #alloc::vec::Vec::with_capacity v5 v11) + (let (v12 u32) (cast v5)) + (let (v13 u32) (add.checked v12 4)) + (let (v14 u32) (mod.unchecked v13 2)) + (assertz v14) + (let (v15 (ptr i32)) (inttoptr v13)) + (let (v16 i32) (load v15)) + (let (v17 i32) (const.i32 12)) + (let (v18 i32) (add.wrapping v5 v17)) + (let [(v19 felt) (v20 felt) (v21 felt) (v22 felt) (v23 i32)] (call (#miden:stdlib/std_mem #pipe_words_to_memory) v1 v16)) + (let (v24 u32) (cast v18)) + (let (v25 (ptr felt)) (inttoptr v24)) + (store v25 v19) + (let (v26 u32) (add.checked v24 8)) + (let (v27 (ptr felt)) (inttoptr v26)) + (store v27 v20) + (let (v28 u32) (add.checked v24 16)) + (let (v29 (ptr felt)) (inttoptr v28)) + (store v29 v21) + (let (v30 u32) (add.checked v24 24)) + (let (v31 (ptr felt)) (inttoptr v30)) + (store v31 v22) + (let (v32 u32) (add.checked v24 32)) + (let (v33 (ptr i32)) (inttoptr v32)) + (store v33 v23) + (let (v34 i32) (const.i32 8)) + (let (v35 i32) (add.wrapping v0 v34)) + (let (v36 i32) (const.i32 12)) + (let (v37 i32) (add.wrapping v5 v36)) + (let (v38 i32) (const.i32 8)) + (let (v39 i32) (add.wrapping v37 v38)) + (let (v40 u32) (cast v39)) + (let (v41 u32) (mod.unchecked v40 2)) + (assertz v41) + (let (v42 (ptr i64)) (inttoptr v40)) + (let (v43 i64) (load v42)) + (let (v44 u32) (cast v35)) + (let (v45 u32) (mod.unchecked v44 2)) + (assertz v45) + (let (v46 (ptr i64)) (inttoptr v44)) + (store v46 v43) + (let (v47 u32) (cast v5)) + (let (v48 u32) (add.checked v47 12)) + (let (v49 u32) (mod.unchecked v48 2)) + (assertz v49) + (let (v50 (ptr i64)) (inttoptr v48)) + (let (v51 i64) (load v50)) + (let (v52 u32) (cast v0)) + (let (v53 u32) (mod.unchecked v52 2)) + (assertz v53) + (let (v54 (ptr i64)) (inttoptr v52)) + (store v54 v51) + (let (v55 i32) (const.i32 24)) + (let (v56 i32) (add.wrapping v0 v55)) + (let (v57 i32) (const.i32 8)) + (let (v58 i32) (add.wrapping v5 v57)) + (let (v59 u32) (cast v58)) + (let (v60 u32) (mod.unchecked v59 2)) + (assertz v60) + (let (v61 (ptr i32)) (inttoptr v59)) + (let (v62 i32) (load v61)) + (let (v63 u32) (cast v56)) (let (v64 u32) (mod.unchecked v63 2)) (assertz v64) - (let (v65 (ptr i64)) (inttoptr v63)) - (store v65 v48) - (let (v66 u32) (cast v0)) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v62) + (let (v66 u32) (cast v5)) (let (v67 u32) (mod.unchecked v66 2)) (assertz v67) (let (v68 (ptr i64)) (inttoptr v66)) - (store v68 v56) - (let (v69 u32) (cast v6)) - (let (v70 u32) (add.checked v69 12)) - (let (v71 u32) (mod.unchecked v70 2)) - (assertz v71) - (let (v72 (ptr i64)) (inttoptr v70)) - (let (v73 i64) (load v72)) - (let (v74 u32) (cast v0)) - (let (v75 u32) (add.checked v74 16)) - (let (v76 u32) (mod.unchecked v75 2)) - (assertz v76) - (let (v77 (ptr i64)) (inttoptr v75)) - (store v77 v73) - (let (v78 i32) (const.i32 24)) - (let (v79 i32) (add.wrapping v0 v78)) - (let (v80 i32) (const.i32 12)) - (let (v81 i32) (add.wrapping v6 v80)) - (let (v82 i32) (const.i32 8)) - (let (v83 i32) (add.wrapping v81 v82)) - (let (v84 u32) (cast v83)) - (let (v85 u32) (mod.unchecked v84 2)) - (assertz v85) - (let (v86 (ptr i32)) (inttoptr v84)) - (let (v87 i32) (load v86)) - (let (v88 u32) (cast v79)) - (let (v89 u32) (mod.unchecked v88 2)) - (assertz v89) - (let (v90 (ptr i32)) (inttoptr v88)) - (store v90 v87) - (let (v91 i32) (const.i32 64)) - (let (v92 i32) (add.wrapping v6 v91)) - (let (v93 (ptr i32)) (global.symbol #__stack_pointer)) - (store v93 v92) + (let (v69 i64) (load v68)) + (let (v70 u32) (cast v0)) + (let (v71 u32) (add.checked v70 16)) + (let (v72 u32) (mod.unchecked v71 2)) + (assertz v72) + (let (v73 (ptr i64)) (inttoptr v71)) + (store v73 v69) + (let (v74 i32) (const.i32 32)) + (let (v75 i32) (add.wrapping v5 v74)) + (let (v76 (ptr i32)) (global.symbol #__stack_pointer)) + (store v76 v75) (br (block 1))) (block 1 @@ -2850,148 +2755,127 @@ (param i32) (param felt) (block 0 (param v0 i32) (param v1 felt) (let (v2 i32) (const.i32 0)) - (let (v3 i64) (const.i64 0)) - (let (v4 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v5 i32) (const.i32 96)) - (let (v6 i32) (sub.wrapping v4 v5)) - (let (v7 (ptr i32)) (global.symbol #__stack_pointer)) - (store v7 v6) - (let (v8 i32) (const.i32 12)) - (let (v9 i32) (add.wrapping v6 v8)) - (let (v10 i64) (cast v1)) - (let (v11 i32) (trunc v10)) - (let (v12 i32) (const.i32 2)) - (let (v13 u32) (bitcast v12)) - (let (v14 i32) (shl.wrapping v11 v13)) - (call #alloc::vec::Vec::with_capacity v9 v14) - (let (v15 u32) (cast v6)) - (let (v16 u32) (add.checked v15 16)) - (let (v17 u32) (mod.unchecked v16 2)) - (assertz v17) - (let (v18 (ptr i32)) (inttoptr v16)) - (let (v19 i32) (load v18)) - (let (v20 i64) (const.i64 0)) - (let (v21 felt) (cast v20)) - (let (v22 i32) (const.i32 4)) - (let (v23 u32) (bitcast v22)) - (let (v24 i32) (shl.wrapping v11 v23)) - (let (v25 i32) (add.wrapping v19 v24)) - (let (v26 i32) (const.i32 40)) - (let (v27 i32) (add.wrapping v6 v26)) - (let [(v28 felt) (v29 felt) (v30 felt) (v31 felt) (v32 felt) (v33 felt) (v34 felt) (v35 felt) (v36 felt) (v37 felt) (v38 felt) (v39 felt) (v40 i32)] (call (#miden:stdlib/std_mem #pipe_double_words_to_memory) v21 v21 v21 v21 v21 v21 v21 v21 v21 v21 v21 v21 v19 v25)) - (let (v41 u32) (cast v27)) - (let (v42 (ptr felt)) (inttoptr v41)) - (store v42 v28) - (let (v43 u32) (add.checked v41 8)) - (let (v44 (ptr felt)) (inttoptr v43)) - (store v44 v29) - (let (v45 u32) (add.checked v41 16)) - (let (v46 (ptr felt)) (inttoptr v45)) - (store v46 v30) - (let (v47 u32) (add.checked v41 24)) - (let (v48 (ptr felt)) (inttoptr v47)) - (store v48 v31) - (let (v49 u32) (add.checked v41 32)) - (let (v50 (ptr felt)) (inttoptr v49)) - (store v50 v32) - (let (v51 u32) (add.checked v41 40)) - (let (v52 (ptr felt)) (inttoptr v51)) - (store v52 v33) - (let (v53 u32) (add.checked v41 48)) - (let (v54 (ptr felt)) (inttoptr v53)) - (store v54 v34) - (let (v55 u32) (add.checked v41 56)) - (let (v56 (ptr felt)) (inttoptr v55)) - (store v56 v35) - (let (v57 u32) (add.checked v41 64)) - (let (v58 (ptr felt)) (inttoptr v57)) - (store v58 v36) - (let (v59 u32) (add.checked v41 72)) - (let (v60 (ptr felt)) (inttoptr v59)) - (store v60 v37) - (let (v61 u32) (add.checked v41 80)) - (let (v62 (ptr felt)) (inttoptr v61)) - (store v62 v38) - (let (v63 u32) (add.checked v41 88)) - (let (v64 (ptr felt)) (inttoptr v63)) - (store v64 v39) - (let (v65 u32) (add.checked v41 96)) - (let (v66 (ptr i32)) (inttoptr v65)) - (store v66 v40) - (let (v67 i32) (const.i32 24)) - (let (v68 i32) (add.wrapping v6 v67)) - (let (v69 i32) (const.i32 8)) - (let (v70 i32) (add.wrapping v68 v69)) - (let (v71 i32) (const.i32 40)) - (let (v72 i32) (add.wrapping v6 v71)) - (let (v73 i32) (const.i32 24)) - (let (v74 i32) (add.wrapping v72 v73)) - (let (v75 u32) (cast v74)) - (let (v76 u32) (mod.unchecked v75 3)) - (assertz v76) - (let (v77 (ptr i64)) (inttoptr v75)) - (let (v78 i64) (load v77)) - (let (v79 u32) (cast v70)) - (let (v80 u32) (mod.unchecked v79 3)) - (assertz v80) - (let (v81 (ptr i64)) (inttoptr v79)) - (store v81 v78) - (let (v82 u32) (cast v6)) - (let (v83 u32) (add.checked v82 56)) - (let (v84 u32) (mod.unchecked v83 3)) - (assertz v84) - (let (v85 (ptr i64)) (inttoptr v83)) - (let (v86 i64) (load v85)) - (let (v87 u32) (cast v6)) - (let (v88 u32) (add.checked v87 24)) - (let (v89 u32) (mod.unchecked v88 3)) - (assertz v89) - (let (v90 (ptr i64)) (inttoptr v88)) - (store v90 v86) - (let (v91 i32) (const.i32 8)) - (let (v92 i32) (add.wrapping v0 v91)) - (let (v93 u32) (cast v92)) + (let (v3 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v4 i32) (const.i32 64)) + (let (v5 i32) (sub.wrapping v3 v4)) + (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) + (store v6 v5) + (let (v7 i64) (cast v1)) + (let (v8 i32) (trunc v7)) + (let (v9 i32) (const.i32 2)) + (let (v10 u32) (bitcast v9)) + (let (v11 i32) (shl.wrapping v8 v10)) + (call #alloc::vec::Vec::with_capacity v5 v11) + (let (v12 u32) (cast v5)) + (let (v13 u32) (add.checked v12 4)) + (let (v14 u32) (mod.unchecked v13 2)) + (assertz v14) + (let (v15 (ptr i32)) (inttoptr v13)) + (let (v16 i32) (load v15)) + (let (v17 i64) (const.i64 0)) + (let (v18 felt) (cast v17)) + (let (v19 i32) (const.i32 4)) + (let (v20 u32) (bitcast v19)) + (let (v21 i32) (shl.wrapping v8 v20)) + (let (v22 i32) (add.wrapping v16 v21)) + (let (v23 i32) (const.i32 12)) + (let (v24 i32) (add.wrapping v5 v23)) + (let [(v25 felt) (v26 felt) (v27 felt) (v28 felt) (v29 felt) (v30 felt) (v31 felt) (v32 felt) (v33 felt) (v34 felt) (v35 felt) (v36 felt) (v37 i32)] (call (#miden:stdlib/std_mem #pipe_double_words_to_memory) v18 v18 v18 v18 v18 v18 v18 v18 v18 v18 v18 v18 v16 v22)) + (let (v38 u32) (cast v24)) + (let (v39 (ptr felt)) (inttoptr v38)) + (store v39 v25) + (let (v40 u32) (add.checked v38 8)) + (let (v41 (ptr felt)) (inttoptr v40)) + (store v41 v26) + (let (v42 u32) (add.checked v38 16)) + (let (v43 (ptr felt)) (inttoptr v42)) + (store v43 v27) + (let (v44 u32) (add.checked v38 24)) + (let (v45 (ptr felt)) (inttoptr v44)) + (store v45 v28) + (let (v46 u32) (add.checked v38 32)) + (let (v47 (ptr felt)) (inttoptr v46)) + (store v47 v29) + (let (v48 u32) (add.checked v38 40)) + (let (v49 (ptr felt)) (inttoptr v48)) + (store v49 v30) + (let (v50 u32) (add.checked v38 48)) + (let (v51 (ptr felt)) (inttoptr v50)) + (store v51 v31) + (let (v52 u32) (add.checked v38 56)) + (let (v53 (ptr felt)) (inttoptr v52)) + (store v53 v32) + (let (v54 u32) (add.checked v38 64)) + (let (v55 (ptr felt)) (inttoptr v54)) + (store v55 v33) + (let (v56 u32) (add.checked v38 72)) + (let (v57 (ptr felt)) (inttoptr v56)) + (store v57 v34) + (let (v58 u32) (add.checked v38 80)) + (let (v59 (ptr felt)) (inttoptr v58)) + (store v59 v35) + (let (v60 u32) (add.checked v38 88)) + (let (v61 (ptr felt)) (inttoptr v60)) + (store v61 v36) + (let (v62 u32) (add.checked v38 96)) + (let (v63 (ptr i32)) (inttoptr v62)) + (store v63 v37) + (let (v64 i32) (const.i32 8)) + (let (v65 i32) (add.wrapping v0 v64)) + (let (v66 i32) (const.i32 12)) + (let (v67 i32) (add.wrapping v5 v66)) + (let (v68 i32) (const.i32 24)) + (let (v69 i32) (add.wrapping v67 v68)) + (let (v70 u32) (cast v69)) + (let (v71 u32) (mod.unchecked v70 2)) + (assertz v71) + (let (v72 (ptr i64)) (inttoptr v70)) + (let (v73 i64) (load v72)) + (let (v74 u32) (cast v65)) + (let (v75 u32) (mod.unchecked v74 2)) + (assertz v75) + (let (v76 (ptr i64)) (inttoptr v74)) + (store v76 v73) + (let (v77 u32) (cast v5)) + (let (v78 u32) (add.checked v77 28)) + (let (v79 u32) (mod.unchecked v78 2)) + (assertz v79) + (let (v80 (ptr i64)) (inttoptr v78)) + (let (v81 i64) (load v80)) + (let (v82 u32) (cast v0)) + (let (v83 u32) (mod.unchecked v82 2)) + (assertz v83) + (let (v84 (ptr i64)) (inttoptr v82)) + (store v84 v81) + (let (v85 i32) (const.i32 24)) + (let (v86 i32) (add.wrapping v0 v85)) + (let (v87 i32) (const.i32 8)) + (let (v88 i32) (add.wrapping v5 v87)) + (let (v89 u32) (cast v88)) + (let (v90 u32) (mod.unchecked v89 2)) + (assertz v90) + (let (v91 (ptr i32)) (inttoptr v89)) + (let (v92 i32) (load v91)) + (let (v93 u32) (cast v86)) (let (v94 u32) (mod.unchecked v93 2)) (assertz v94) - (let (v95 (ptr i64)) (inttoptr v93)) - (store v95 v78) - (let (v96 u32) (cast v0)) + (let (v95 (ptr i32)) (inttoptr v93)) + (store v95 v92) + (let (v96 u32) (cast v5)) (let (v97 u32) (mod.unchecked v96 2)) (assertz v97) (let (v98 (ptr i64)) (inttoptr v96)) - (store v98 v86) - (let (v99 u32) (cast v6)) - (let (v100 u32) (add.checked v99 12)) - (let (v101 u32) (mod.unchecked v100 2)) - (assertz v101) - (let (v102 (ptr i64)) (inttoptr v100)) - (let (v103 i64) (load v102)) - (let (v104 u32) (cast v0)) - (let (v105 u32) (add.checked v104 16)) - (let (v106 u32) (mod.unchecked v105 2)) - (assertz v106) - (let (v107 (ptr i64)) (inttoptr v105)) - (store v107 v103) - (let (v108 i32) (const.i32 24)) - (let (v109 i32) (add.wrapping v0 v108)) - (let (v110 i32) (const.i32 12)) - (let (v111 i32) (add.wrapping v6 v110)) - (let (v112 i32) (const.i32 8)) - (let (v113 i32) (add.wrapping v111 v112)) - (let (v114 u32) (cast v113)) - (let (v115 u32) (mod.unchecked v114 2)) - (assertz v115) - (let (v116 (ptr i32)) (inttoptr v114)) - (let (v117 i32) (load v116)) - (let (v118 u32) (cast v109)) - (let (v119 u32) (mod.unchecked v118 2)) - (assertz v119) - (let (v120 (ptr i32)) (inttoptr v118)) - (store v120 v117) - (let (v121 i32) (const.i32 96)) - (let (v122 i32) (add.wrapping v6 v121)) - (let (v123 (ptr i32)) (global.symbol #__stack_pointer)) - (store v123 v122) + (let (v99 i64) (load v98)) + (let (v100 u32) (cast v0)) + (let (v101 u32) (add.checked v100 16)) + (let (v102 u32) (mod.unchecked v101 2)) + (assertz v102) + (let (v103 (ptr i64)) (inttoptr v101)) + (store v103 v99) + (let (v104 i32) (const.i32 64)) + (let (v105 i32) (add.wrapping v5 v104)) + (let (v106 (ptr i32)) (global.symbol #__stack_pointer)) + (store v106 v105) (br (block 1))) (block 1 @@ -3016,7 +2900,7 @@ (ret)) ) - (func (export #alloc::alloc::handle_alloc_error) + (func (export #alloc::raw_vec::handle_error) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (unreachable)) @@ -3024,22 +2908,6 @@ (block 1) ) - (func (export #alloc::raw_vec::capacity_overflow) - - (block 0 - (unreachable)) - - (block 1) - ) - - (func (export #core::slice::::copy_from_slice::len_mismatch_fail) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (unreachable)) - - (block 1) - ) - (func (export #core::slice::::copy_from_slice) (param i32) (param i32) (param i32) (param i32) (param i32) (block 0 @@ -3068,6 +2936,14 @@ (ret)) ) + (func (export #core::slice::::copy_from_slice::len_mismatch_fail) + (param i32) (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) (param v2 i32) + (unreachable)) + + (block 1) + ) + (func (export #get_wallet_magic_number.command_export) (result felt) (block 0 (let (v1 felt) (call #get_wallet_magic_number)) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat index 41bf1019c..ea52b1295 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat @@ -1449,53 +1449,39 @@ i32.const 0 call $alloc::raw_vec::RawVec::try_allocate_in local.get 1 - i32.load offset=12 - local.set 2 - local.get 1 i32.load offset=8 - local.set 3 + local.set 2 block ;; label = @1 - block ;; label = @2 - local.get 1 - i32.load offset=4 - i32.eqz - br_if 0 (;@2;) - local.get 3 - i32.eqz - br_if 1 (;@1;) - local.get 3 - local.get 2 - call $alloc::alloc::handle_alloc_error - unreachable - end - local.get 2 - call $miden_tx_kernel_sys::externs::extern_note_get_inputs - drop - local.get 0 - i32.const 0 - i32.store offset=8 - local.get 0 + local.get 1 + i32.load offset=4 + i32.eqz + br_if 0 (;@1;) local.get 2 - i32.store offset=4 - local.get 0 - local.get 3 - i32.store local.get 1 - i32.const 16 - i32.add - global.set $__stack_pointer - return + i32.load offset=12 + call $alloc::raw_vec::handle_error + unreachable end - call $alloc::raw_vec::capacity_overflow - unreachable - ) - (func $miden_tx_kernel_sys::add_asset (;54;) (type 20) (param i32 i32) - (local i32) - global.get $__stack_pointer + local.get 1 + i32.load offset=12 + local.tee 3 + call $miden_tx_kernel_sys::externs::extern_note_get_inputs + drop + local.get 0 + i32.const 0 + i32.store offset=8 + local.get 0 + local.get 3 + i32.store offset=4 + local.get 0 + local.get 2 + i32.store + local.get 1 i32.const 16 - i32.sub - local.tee 2 + i32.add global.set $__stack_pointer + ) + (func $miden_tx_kernel_sys::add_asset (;54;) (type 20) (param i32 i32) local.get 1 f32.load local.get 1 @@ -1504,32 +1490,10 @@ f32.load offset=8 local.get 1 f32.load offset=12 - local.get 2 - call $miden_tx_kernel_sys::externs::extern_account_add_asset - local.get 0 - i32.const 8 - i32.add - local.get 2 - i32.const 8 - i32.add - i64.load align=4 - i64.store align=4 local.get 0 - local.get 2 - i64.load align=4 - i64.store align=4 - local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer + call $miden_tx_kernel_sys::externs::extern_account_add_asset ) (func $miden_tx_kernel_sys::remove_asset (;55;) (type 20) (param i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 2 - global.set $__stack_pointer local.get 1 f32.load local.get 1 @@ -1538,24 +1502,8 @@ f32.load offset=8 local.get 1 f32.load offset=12 - local.get 2 - call $miden_tx_kernel_sys::externs::extern_account_remove_asset - local.get 0 - i32.const 8 - i32.add - local.get 2 - i32.const 8 - i32.add - i64.load align=4 - i64.store align=4 local.get 0 - local.get 2 - i64.load align=4 - i64.store align=4 - local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer + call $miden_tx_kernel_sys::externs::extern_account_remove_asset ) (func $miden_tx_kernel_sys::create_note (;56;) (type 23) (param i32 f32 f32 i32) (result f32) local.get 0 @@ -1592,42 +1540,35 @@ i32.const 0 call $alloc::raw_vec::RawVec::try_allocate_in local.get 2 - i32.load offset=12 - local.set 3 - local.get 2 i32.load offset=8 local.set 1 block ;; label = @1 - block ;; label = @2 - local.get 2 - i32.load offset=4 - i32.eqz - br_if 0 (;@2;) - local.get 1 - i32.eqz - br_if 1 (;@1;) - local.get 1 - local.get 3 - call $alloc::alloc::handle_alloc_error - unreachable - end - local.get 0 - i32.const 0 - i32.store offset=8 - local.get 0 - local.get 3 - i32.store offset=4 - local.get 0 + local.get 2 + i32.load offset=4 + i32.eqz + br_if 0 (;@1;) local.get 1 - i32.store local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer - return + i32.load offset=12 + call $alloc::raw_vec::handle_error + unreachable end - call $alloc::raw_vec::capacity_overflow - unreachable + local.get 2 + i32.load offset=12 + local.set 3 + local.get 0 + i32.const 0 + i32.store offset=8 + local.get 0 + local.get 3 + i32.store offset=4 + local.get 0 + local.get 1 + i32.store + local.get 2 + i32.const 16 + i32.add + global.set $__stack_pointer ) (func $alloc::raw_vec::RawVec::try_allocate_in (;58;) (type 19) (param i32 i32 i32) (local i32) @@ -1704,15 +1645,13 @@ i32.store ) (func $miden_stdlib_sys::stdlib::mem::pipe_words_to_memory (;59;) (type 21) (param i32 f32) - (local i32 i64 i64) + (local i32) global.get $__stack_pointer - i32.const 64 + i32.const 32 i32.sub local.tee 2 global.set $__stack_pointer local.get 2 - i32.const 12 - i32.add local.get 1 call $miden_stdlib_sys::intrinsics::felt::extern_as_u64 i32.wrap_i64 @@ -1721,66 +1660,50 @@ call $alloc::vec::Vec::with_capacity local.get 1 local.get 2 - i32.load offset=16 + i32.load offset=4 local.get 2 - i32.const 40 + i32.const 12 i32.add call $miden_stdlib_sys::stdlib::mem::extern_pipe_words_to_memory - local.get 2 - i32.const 24 - i32.add + local.get 0 i32.const 8 i32.add local.get 2 - i32.const 40 + i32.const 12 i32.add i32.const 8 i32.add - i64.load - local.tee 3 - i64.store - local.get 2 - local.get 2 - i64.load offset=40 - local.tee 4 - i64.store offset=24 - local.get 0 - i32.const 8 - i32.add - local.get 3 - i64.store align=4 - local.get 0 - local.get 4 + i64.load align=4 i64.store align=4 local.get 0 local.get 2 i64.load offset=12 align=4 - i64.store offset=16 align=4 + i64.store align=4 local.get 0 i32.const 24 i32.add local.get 2 - i32.const 12 - i32.add i32.const 8 i32.add i32.load i32.store + local.get 0 local.get 2 - i32.const 64 + i64.load align=4 + i64.store offset=16 align=4 + local.get 2 + i32.const 32 i32.add global.set $__stack_pointer ) (func $miden_stdlib_sys::stdlib::mem::pipe_double_words_to_memory (;60;) (type 21) (param i32 f32) - (local i32 i32 i32 i64 i64) + (local i32 i32 i32) global.get $__stack_pointer - i32.const 96 + i32.const 64 i32.sub local.tee 2 global.set $__stack_pointer local.get 2 - i32.const 12 - i32.add local.get 1 call $miden_stdlib_sys::intrinsics::felt::extern_as_u64 i32.wrap_i64 @@ -1789,7 +1712,7 @@ i32.shl call $alloc::vec::Vec::with_capacity local.get 2 - i32.load offset=16 + i32.load offset=4 local.set 4 i64.const 0 call $miden_stdlib_sys::intrinsics::felt::extern_from_u64_unchecked @@ -1812,51 +1735,37 @@ i32.shl i32.add local.get 2 - i32.const 40 + i32.const 12 i32.add call $miden_stdlib_sys::stdlib::mem::extern_pipe_double_words_to_memory - local.get 2 - i32.const 24 - i32.add + local.get 0 i32.const 8 i32.add local.get 2 - i32.const 40 + i32.const 12 i32.add i32.const 24 i32.add - i64.load - local.tee 5 - i64.store - local.get 2 - local.get 2 - i64.load offset=56 - local.tee 6 - i64.store offset=24 - local.get 0 - i32.const 8 - i32.add - local.get 5 - i64.store align=4 - local.get 0 - local.get 6 + i64.load align=4 i64.store align=4 local.get 0 local.get 2 - i64.load offset=12 align=4 - i64.store offset=16 align=4 + i64.load offset=28 align=4 + i64.store align=4 local.get 0 i32.const 24 i32.add local.get 2 - i32.const 12 - i32.add i32.const 8 i32.add i32.load i32.store + local.get 0 local.get 2 - i32.const 96 + i64.load align=4 + i64.store offset=16 align=4 + local.get 2 + i32.const 64 i32.add global.set $__stack_pointer ) @@ -1865,19 +1774,11 @@ call $dummy call $dummy ) - (func $alloc::alloc::handle_alloc_error (;63;) (type 20) (param i32 i32) + (func $alloc::raw_vec::handle_error (;63;) (type 20) (param i32 i32) unreachable unreachable ) - (func $alloc::raw_vec::capacity_overflow (;64;) (type 26) - unreachable - unreachable - ) - (func $core::slice::::copy_from_slice::len_mismatch_fail (;65;) (type 19) (param i32 i32 i32) - unreachable - unreachable - ) - (func $core::slice::::copy_from_slice (;66;) (type 27) (param i32 i32 i32 i32 i32) + (func $core::slice::::copy_from_slice (;64;) (type 27) (param i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 local.get 3 @@ -1895,61 +1796,65 @@ call $core::slice::::copy_from_slice::len_mismatch_fail unreachable ) - (func $get_wallet_magic_number.command_export (;67;) (type 11) (result f32) + (func $core::slice::::copy_from_slice::len_mismatch_fail (;65;) (type 19) (param i32 i32 i32) + unreachable + unreachable + ) + (func $get_wallet_magic_number.command_export (;66;) (type 11) (result f32) call $get_wallet_magic_number call $__wasm_call_dtors ) - (func $test_add_asset.command_export (;68;) (type 11) (result f32) + (func $test_add_asset.command_export (;67;) (type 11) (result f32) call $test_add_asset call $__wasm_call_dtors ) - (func $test_felt_ops_smoke.command_export (;69;) (type 1) (param f32 f32) (result f32) + (func $test_felt_ops_smoke.command_export (;68;) (type 1) (param f32 f32) (result f32) local.get 0 local.get 1 call $test_felt_ops_smoke call $__wasm_call_dtors ) - (func $note_script.command_export (;70;) (type 11) (result f32) + (func $note_script.command_export (;69;) (type 11) (result f32) call $note_script call $__wasm_call_dtors ) - (func $test_blake3_hash_1to1.command_export (;71;) (type 20) (param i32 i32) + (func $test_blake3_hash_1to1.command_export (;70;) (type 20) (param i32 i32) local.get 0 local.get 1 call $test_blake3_hash_1to1 call $__wasm_call_dtors ) - (func $test_blake3_hash_2to1.command_export (;72;) (type 19) (param i32 i32 i32) + (func $test_blake3_hash_2to1.command_export (;71;) (type 19) (param i32 i32 i32) local.get 0 local.get 1 local.get 2 call $test_blake3_hash_2to1 call $__wasm_call_dtors ) - (func $test_rpo_falcon512_verify.command_export (;73;) (type 20) (param i32 i32) + (func $test_rpo_falcon512_verify.command_export (;72;) (type 20) (param i32 i32) local.get 0 local.get 1 call $test_rpo_falcon512_verify call $__wasm_call_dtors ) - (func $test_pipe_words_to_memory.command_export (;74;) (type 21) (param i32 f32) + (func $test_pipe_words_to_memory.command_export (;73;) (type 21) (param i32 f32) local.get 0 local.get 1 call $test_pipe_words_to_memory call $__wasm_call_dtors ) - (func $test_pipe_double_words_to_memory.command_export (;75;) (type 21) (param i32 f32) + (func $test_pipe_double_words_to_memory.command_export (;74;) (type 21) (param i32 f32) local.get 0 local.get 1 call $test_pipe_double_words_to_memory call $__wasm_call_dtors ) - (func $test_remove_asset.command_export (;76;) (type 22) (param i32) (result f32) + (func $test_remove_asset.command_export (;75;) (type 22) (param i32) (result f32) local.get 0 call $test_remove_asset call $__wasm_call_dtors ) - (func $test_create_note.command_export (;77;) (type 23) (param i32 f32 f32 i32) (result f32) + (func $test_create_note.command_export (;76;) (type 23) (param i32 f32 f32 i32) (result f32) local.get 0 local.get 1 local.get 2 diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir index 216a4183d..dbdee4fae 100644 --- a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.hir @@ -58,76 +58,42 @@ (func (export #miden_tx_kernel_sys::add_asset) (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 16)) - (let (v5 i32) (sub.wrapping v3 v4)) - (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) - (store v6 v5) - (let (v7 u32) (cast v1)) + (let (v2 u32) (cast v1)) + (let (v3 u32) (mod.unchecked v2 2)) + (assertz v3) + (let (v4 (ptr felt)) (inttoptr v2)) + (let (v5 felt) (load v4)) + (let (v6 u32) (cast v1)) + (let (v7 u32) (add.checked v6 4)) (let (v8 u32) (mod.unchecked v7 2)) (assertz v8) (let (v9 (ptr felt)) (inttoptr v7)) (let (v10 felt) (load v9)) (let (v11 u32) (cast v1)) - (let (v12 u32) (add.checked v11 4)) + (let (v12 u32) (add.checked v11 8)) (let (v13 u32) (mod.unchecked v12 2)) (assertz v13) (let (v14 (ptr felt)) (inttoptr v12)) (let (v15 felt) (load v14)) (let (v16 u32) (cast v1)) - (let (v17 u32) (add.checked v16 8)) + (let (v17 u32) (add.checked v16 12)) (let (v18 u32) (mod.unchecked v17 2)) (assertz v18) (let (v19 (ptr felt)) (inttoptr v17)) (let (v20 felt) (load v19)) - (let (v21 u32) (cast v1)) - (let (v22 u32) (add.checked v21 12)) - (let (v23 u32) (mod.unchecked v22 2)) - (assertz v23) - (let (v24 (ptr felt)) (inttoptr v22)) - (let (v25 felt) (load v24)) - (let [(v26 felt) (v27 felt) (v28 felt) (v29 felt)] (call (#miden::account #add_asset) v10 v15 v20 v25)) - (let (v30 u32) (cast v5)) - (let (v31 (ptr felt)) (inttoptr v30)) - (store v31 v26) - (let (v32 u32) (add.checked v30 8)) - (let (v33 (ptr felt)) (inttoptr v32)) - (store v33 v27) - (let (v34 u32) (add.checked v30 16)) - (let (v35 (ptr felt)) (inttoptr v34)) - (store v35 v28) - (let (v36 u32) (add.checked v30 24)) - (let (v37 (ptr felt)) (inttoptr v36)) - (store v37 v29) - (let (v38 i32) (const.i32 8)) - (let (v39 i32) (add.wrapping v0 v38)) - (let (v40 i32) (const.i32 8)) - (let (v41 i32) (add.wrapping v5 v40)) - (let (v42 u32) (cast v41)) - (let (v43 u32) (mod.unchecked v42 2)) - (assertz v43) - (let (v44 (ptr i64)) (inttoptr v42)) - (let (v45 i64) (load v44)) - (let (v46 u32) (cast v39)) - (let (v47 u32) (mod.unchecked v46 2)) - (assertz v47) - (let (v48 (ptr i64)) (inttoptr v46)) - (store v48 v45) - (let (v49 u32) (cast v5)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i64)) (inttoptr v49)) - (let (v52 i64) (load v51)) - (let (v53 u32) (cast v0)) - (let (v54 u32) (mod.unchecked v53 2)) - (assertz v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v52) - (let (v56 i32) (const.i32 16)) - (let (v57 i32) (add.wrapping v5 v56)) - (let (v58 (ptr i32)) (global.symbol #__stack_pointer)) - (store v58 v57) + (let [(v21 felt) (v22 felt) (v23 felt) (v24 felt)] (call (#miden::account #add_asset) v5 v10 v15 v20)) + (let (v25 u32) (cast v0)) + (let (v26 (ptr felt)) (inttoptr v25)) + (store v26 v21) + (let (v27 u32) (add.checked v25 8)) + (let (v28 (ptr felt)) (inttoptr v27)) + (store v28 v22) + (let (v29 u32) (add.checked v25 16)) + (let (v30 (ptr felt)) (inttoptr v29)) + (store v30 v23) + (let (v31 u32) (add.checked v25 24)) + (let (v32 (ptr felt)) (inttoptr v31)) + (store v32 v24) (br (block 1))) (block 1 @@ -137,76 +103,42 @@ (func (export #miden_tx_kernel_sys::remove_asset) (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 16)) - (let (v5 i32) (sub.wrapping v3 v4)) - (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) - (store v6 v5) - (let (v7 u32) (cast v1)) + (let (v2 u32) (cast v1)) + (let (v3 u32) (mod.unchecked v2 2)) + (assertz v3) + (let (v4 (ptr felt)) (inttoptr v2)) + (let (v5 felt) (load v4)) + (let (v6 u32) (cast v1)) + (let (v7 u32) (add.checked v6 4)) (let (v8 u32) (mod.unchecked v7 2)) (assertz v8) (let (v9 (ptr felt)) (inttoptr v7)) (let (v10 felt) (load v9)) (let (v11 u32) (cast v1)) - (let (v12 u32) (add.checked v11 4)) + (let (v12 u32) (add.checked v11 8)) (let (v13 u32) (mod.unchecked v12 2)) (assertz v13) (let (v14 (ptr felt)) (inttoptr v12)) (let (v15 felt) (load v14)) (let (v16 u32) (cast v1)) - (let (v17 u32) (add.checked v16 8)) + (let (v17 u32) (add.checked v16 12)) (let (v18 u32) (mod.unchecked v17 2)) (assertz v18) (let (v19 (ptr felt)) (inttoptr v17)) (let (v20 felt) (load v19)) - (let (v21 u32) (cast v1)) - (let (v22 u32) (add.checked v21 12)) - (let (v23 u32) (mod.unchecked v22 2)) - (assertz v23) - (let (v24 (ptr felt)) (inttoptr v22)) - (let (v25 felt) (load v24)) - (let [(v26 felt) (v27 felt) (v28 felt) (v29 felt)] (call (#miden::account #remove_asset) v10 v15 v20 v25)) - (let (v30 u32) (cast v5)) - (let (v31 (ptr felt)) (inttoptr v30)) - (store v31 v26) - (let (v32 u32) (add.checked v30 8)) - (let (v33 (ptr felt)) (inttoptr v32)) - (store v33 v27) - (let (v34 u32) (add.checked v30 16)) - (let (v35 (ptr felt)) (inttoptr v34)) - (store v35 v28) - (let (v36 u32) (add.checked v30 24)) - (let (v37 (ptr felt)) (inttoptr v36)) - (store v37 v29) - (let (v38 i32) (const.i32 8)) - (let (v39 i32) (add.wrapping v0 v38)) - (let (v40 i32) (const.i32 8)) - (let (v41 i32) (add.wrapping v5 v40)) - (let (v42 u32) (cast v41)) - (let (v43 u32) (mod.unchecked v42 2)) - (assertz v43) - (let (v44 (ptr i64)) (inttoptr v42)) - (let (v45 i64) (load v44)) - (let (v46 u32) (cast v39)) - (let (v47 u32) (mod.unchecked v46 2)) - (assertz v47) - (let (v48 (ptr i64)) (inttoptr v46)) - (store v48 v45) - (let (v49 u32) (cast v5)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i64)) (inttoptr v49)) - (let (v52 i64) (load v51)) - (let (v53 u32) (cast v0)) - (let (v54 u32) (mod.unchecked v53 2)) - (assertz v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v52) - (let (v56 i32) (const.i32 16)) - (let (v57 i32) (add.wrapping v5 v56)) - (let (v58 (ptr i32)) (global.symbol #__stack_pointer)) - (store v58 v57) + (let [(v21 felt) (v22 felt) (v23 felt) (v24 felt)] (call (#miden::account #remove_asset) v5 v10 v15 v20)) + (let (v25 u32) (cast v0)) + (let (v26 (ptr felt)) (inttoptr v25)) + (store v26 v21) + (let (v27 u32) (add.checked v25 8)) + (let (v28 (ptr felt)) (inttoptr v27)) + (store v28 v22) + (let (v29 u32) (add.checked v25 16)) + (let (v30 (ptr felt)) (inttoptr v29)) + (store v30 v23) + (let (v31 u32) (add.checked v25 24)) + (let (v32 (ptr felt)) (inttoptr v31)) + (store v32 v24) (br (block 1))) (block 1 diff --git a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat index e936efdef..46061ef14 100644 --- a/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat +++ b/tests/integration/expected/rust_sdk_basic_wallet/rust_sdk_basic_wallet.wat @@ -45,12 +45,6 @@ global.set $__stack_pointer ) (func $miden_tx_kernel_sys::add_asset (;5;) (type 4) (param i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 2 - global.set $__stack_pointer local.get 1 f32.load local.get 1 @@ -59,32 +53,10 @@ f32.load offset=8 local.get 1 f32.load offset=12 - local.get 2 - call $miden_tx_kernel_sys::externs::extern_account_add_asset local.get 0 - i32.const 8 - i32.add - local.get 2 - i32.const 8 - i32.add - i64.load align=4 - i64.store align=4 - local.get 0 - local.get 2 - i64.load align=4 - i64.store align=4 - local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer + call $miden_tx_kernel_sys::externs::extern_account_add_asset ) (func $miden_tx_kernel_sys::remove_asset (;6;) (type 4) (param i32 i32) - (local i32) - global.get $__stack_pointer - i32.const 16 - i32.sub - local.tee 2 - global.set $__stack_pointer local.get 1 f32.load local.get 1 @@ -93,24 +65,8 @@ f32.load offset=8 local.get 1 f32.load offset=12 - local.get 2 - call $miden_tx_kernel_sys::externs::extern_account_remove_asset local.get 0 - i32.const 8 - i32.add - local.get 2 - i32.const 8 - i32.add - i64.load align=4 - i64.store align=4 - local.get 0 - local.get 2 - i64.load align=4 - i64.store align=4 - local.get 2 - i32.const 16 - i32.add - global.set $__stack_pointer + call $miden_tx_kernel_sys::externs::extern_account_remove_asset ) (func $miden_tx_kernel_sys::create_note (;7;) (type 5) (param i32 f32 f32 i32) (result f32) local.get 0 diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir index 60487219e..20b880e9e 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir @@ -39,6 +39,9 @@ ) (module #basic_wallet + ;; Data Segments + (data (mut) (offset 1048576) 0x01000000) + ;; Constants (const (id 0) 0x00100000) @@ -54,6 +57,50 @@ (ret)) ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) + (block 0 (param v0 i32) (param v1 i32) + (let (v3 i32) (const.i32 1048580)) + (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 1048580)) + (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 v22 i32) + (br (block 1 v22))) + + (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) (cast v7)) + (let (v18 (ptr u8)) (inttoptr v17)) + (let (v19 u32) (cast v0)) + (let (v20 (ptr u8)) (inttoptr v19)) + (memcpy v20 v18 v16) + (let (v21 i32) (const.i32 1048580)) + (call #::dealloc v21 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) @@ -63,7 +110,7 @@ (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_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)) @@ -93,87 +140,109 @@ (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_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) (cast v12)) (let (v15 u32) (mod.unchecked v14 3)) (assertz v15) (let (v16 (ptr i64)) (inttoptr v14)) (let (v17 i64) (load v16)) - (let (v18 i32) (const.i32 8)) - (let (v19 i32) (add.wrapping v12 v18)) - (let (v20 u32) (cast v19)) - (let (v21 u32) (mod.unchecked v20 3)) - (assertz v21) - (let (v22 (ptr i64)) (inttoptr v20)) - (let (v23 i64) (load v22)) - (let (v24 i32) (const.i32 16)) - (let (v25 i32) (add.wrapping v12 v24)) - (let (v26 u32) (cast v25)) - (let (v27 u32) (mod.unchecked v26 3)) - (assertz v27) - (let (v28 (ptr i64)) (inttoptr v26)) - (let (v29 i64) (load v28)) - (let (v30 i32) (const.i32 24)) - (let (v31 i32) (add.wrapping v12 v30)) - (let (v32 u32) (cast v31)) - (let (v33 u32) (mod.unchecked v32 3)) - (assertz v33) - (let (v34 (ptr i64)) (inttoptr v32)) - (let (v35 i64) (load v34)) - (let (v36 i64) (call (#miden:base/tx@1.0.0 #create-note) v17 v23 v29 v35 v4 v5 v6 v7 v8)) - (let (v37 i32) (const.i32 32)) - (let (v38 i32) (add.wrapping v12 v37)) - (let (v39 (ptr i32)) (global.symbol #__stack_pointer)) - (store v39 v38) + (let (v18 u32) (cast v12)) + (let (v19 u32) (add.checked v18 8)) + (let (v20 u32) (mod.unchecked v19 3)) + (assertz v20) + (let (v21 (ptr i64)) (inttoptr v19)) + (let (v22 i64) (load v21)) + (let (v23 u32) (cast v12)) + (let (v24 u32) (add.checked v23 16)) + (let (v25 u32) (mod.unchecked v24 3)) + (assertz v25) + (let (v26 (ptr i64)) (inttoptr v24)) + (let (v27 i64) (load v26)) + (let (v28 u32) (cast v12)) + (let (v29 u32) (add.checked v28 24)) + (let (v30 u32) (mod.unchecked v29 3)) + (assertz 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 #__rust_alloc) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048576)) - (let (v4 i32) (call #::alloc v3 v1 v0)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #__rust_realloc) + (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 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048576)) - (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))) + (let (v5 i1) (neq v1 0)) + (condbr v5 (block 4) (block 5))) (block 1 (param v4 i32) (ret v4)) - (block 2 (param v22 i32) - (br (block 1 v22))) + (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) (cast v9)) + (let (v11 u32) (add.checked v10 1048584)) + (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) (cast v0)) + (let (v2 u32) (add.checked v1 1048585)) + (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 - (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) (cast v7)) - (let (v18 (ptr u8)) (inttoptr v17)) - (let (v19 u32) (cast v0)) - (let (v20 (ptr u8)) (inttoptr v19)) - (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048576)) - (call #::dealloc v21 v0 v2 v1) - (br (block 2 v7))) + (call #__wasm_call_ctors) + (let (v7 i32) (const.i32 0)) + (let (v8 i32) (const.i32 1)) + (let (v9 u8) (trunc v8)) + (let (v10 u32) (cast v7)) + (let (v11 u32) (add.checked v10 1048585)) + (let (v12 (ptr u8)) (inttoptr v11)) + (store v12 v9) + (br (block 2))) ) (func (export #wee_alloc::alloc_first_fit) @@ -185,480 +254,496 @@ (assertz v6) (let (v7 (ptr i32)) (inttoptr v5)) (let (v8 i32) (load v7)) - (let (v9 i1) (eq v8 0)) - (let (v10 i32) (zext v9)) - (let (v11 i1) (neq v10 0)) - (condbr v11 (block 2) (block 3))) + (let (v9 i1) (neq v8 0)) + (condbr v9 (block 2) (block 3))) (block 1 (param v3 i32) (ret v3)) (block 2 - (let (v330 i32) (const.i32 0)) - (br (block 1 v330))) + (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 (v12 i32) (const.i32 -1)) - (let (v13 i32) (add.wrapping v1 v12)) - (let (v14 i32) (const.i32 0)) - (let (v15 i32) (sub.wrapping v14 v1)) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v16)) - (let (v18 i32) (shl.wrapping v0 v17)) - (br (block 4 v8 v2 v18 v15 v13))) + (let (v10 i32) (const.i32 0)) + (ret v10)) (block 4 - (param v19 i32) - (param v160 i32) - (param v171 i32) - (param v185 i32) + (param v18 i32) + (param v169 i32) + (param v182 i32) (param v197 i32) - (let (v20 i32) (const.i32 8)) - (let (v21 i32) (add.wrapping v19 v20)) - (let (v22 u32) (cast v19)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 2)) - (assertz v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 i32) (const.i32 1)) - (let (v28 i32) (band v26 v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 7) (block 8))) + (param v210 i32) + (let (v19 u32) (cast v18)) + (let (v20 u32) (add.checked v19 8)) + (let (v21 u32) (mod.unchecked v20 2)) + (assertz 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 - (br (block 2))) + (let (v344 i32) (const.i32 0)) + (br (block 1 v344))) (block 6 - (param v161 i32) - (param v168 i32) - (param v170 i32) - (param v184 i32) + (param v172 i32) + (param v179 i32) + (param v181 i32) (param v196 i32) - (param v204 i32) - (param v205 i32) - (let (v162 u32) (cast v161)) - (let (v163 u32) (mod.unchecked v162 2)) - (assertz v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 -4)) - (let (v167 i32) (band v165 v166)) - (let (v169 i32) (sub.wrapping v167 v168)) - (let (v176 u32) (bitcast v169)) - (let (v177 u32) (bitcast v170)) - (let (v178 i1) (lt v176 v177)) - (let (v179 i32) (sext v178)) - (let (v180 i1) (neq v179 0)) - (condbr v180 (block 21 v204 v205 v170 v184 v196) (block 22))) + (param v209 i32) + (param v218 i32) + (param v219 i32) + (let (v173 u32) (cast v172)) + (let (v174 u32) (mod.unchecked v173 2)) + (assertz 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 v21 v26 v19 v160 v171 v185 v197))) + (br (block 9 v18 v23 v169 v182 v197 v210))) (block 8 - (br (block 6 v19 v21 v171 v185 v197 v160 v26))) + (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 v31 i32) - (param v37 i32) - (param v144 i32) - (param v174 i32) - (param v188 i32) - (param v200 i32) - (let (v32 i32) (const.i32 -2)) - (let (v33 i32) (band v31 v32)) - (let (v34 u32) (cast v30)) + (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) (cast v29)) + (let (v34 u32) (add.checked v33 8)) (let (v35 u32) (mod.unchecked v34 2)) (assertz v35) (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v33) - (let (v38 u32) (cast v37)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 2)) - (assertz v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (let (v42 i32) (load v41)) - (let (v43 i32) (const.i32 -4)) - (let (v44 i32) (band v42 v43)) - (let (v45 u32) (cast v44)) - (let (v46 u32) (mod.unchecked v45 2)) - (assertz v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (let (v48 i32) (load v47)) - (let (v49 u32) (cast v37)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i32)) (inttoptr v49)) - (let (v52 i32) (load v51)) - (let (v53 i32) (const.i32 -4)) - (let (v54 i32) (band v52 v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 13) (block 14))) + (store v36 v32) + (let (v37 u32) (cast v29)) + (let (v38 u32) (add.checked v37 4)) + (let (v39 u32) (mod.unchecked v38 2)) + (assertz 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 - (br (block 6 v146 v151 v172 v186 v198 v142 v156))) + (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 v112 i32) - (param v113 i32) - (param v120 i32) - (param v131 i32) - (param v143 i32) - (param v173 i32) - (param v187 i32) - (param v199 i32) - (let (v114 i32) (const.i32 3)) - (let (v115 i32) (band v113 v114)) - (let (v116 u32) (cast v112)) - (let (v117 u32) (add.checked v116 4)) - (let (v118 u32) (mod.unchecked v117 2)) - (assertz v118) - (let (v119 (ptr i32)) (inttoptr v117)) - (store v119 v115) - (let (v121 i32) (const.i32 3)) - (let (v122 i32) (band v120 v121)) - (let (v123 u32) (cast v112)) - (let (v124 u32) (mod.unchecked v123 2)) - (assertz v124) - (let (v125 (ptr i32)) (inttoptr v123)) - (store v125 v122) - (let (v126 i32) (const.i32 2)) - (let (v127 i32) (band v120 v126)) - (let (v128 i1) (eq v127 0)) - (let (v129 i32) (zext v128)) - (let (v130 i1) (neq v129 0)) - (condbr v130 (block 18 v143 v131 v173 v187 v199) (block 19))) + (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) (cast v55)) + (let (v57 u32) (mod.unchecked v56 2)) + (assertz 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 - (param v93 i32) - (param v94 i32) - (param v97 i32) - (param v102 i32) - (param v132 i32) - (param v145 i32) - (param v175 i32) - (param v189 i32) - (param v201 i32) - (let (v95 i32) (const.i32 3)) - (let (v96 i32) (band v94 v95)) - (let (v98 i32) (bor v96 v97)) - (let (v99 u32) (cast v93)) - (let (v100 u32) (mod.unchecked v99 2)) - (assertz v100) - (let (v101 (ptr i32)) (inttoptr v99)) - (store v101 v98) - (let (v103 u32) (cast v102)) - (let (v104 u32) (add.checked v103 4)) - (let (v105 u32) (mod.unchecked v104 2)) - (assertz v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (let (v107 i32) (load v106)) - (let (v108 u32) (cast v102)) - (let (v109 u32) (mod.unchecked v108 2)) - (assertz v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (br (block 11 v102 v107 v111 v132 v145 v175 v189 v201))) + (let (v46 i32) (const.i32 0)) + (let (v47 u32) (cast 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 (v56 i32) (const.i32 2)) - (let (v57 i32) (band v52 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 15) (block 16))) + (let (v45 i32) (const.i32 0)) + (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) (block 14 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (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 (v61 u32) (cast v54)) - (let (v62 u32) (add.checked v61 4)) - (let (v63 u32) (mod.unchecked v62 2)) - (assertz v63) - (let (v64 (ptr i32)) (inttoptr v62)) - (let (v65 i32) (load v64)) - (let (v66 i32) (const.i32 3)) - (let (v67 i32) (band v65 v66)) - (let (v68 i32) (bor v67 v44)) - (let (v69 u32) (cast v54)) - (let (v70 u32) (add.checked v69 4)) - (let (v71 u32) (mod.unchecked v70 2)) - (assertz v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 u32) (cast v37)) - (let (v74 u32) (mod.unchecked v73 2)) - (assertz v74) - (let (v75 (ptr i32)) (inttoptr v73)) - (let (v76 i32) (load v75)) - (let (v77 u32) (cast v37)) + (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) (cast v61)) + (let (v69 u32) (add.checked v68 4)) + (let (v70 u32) (mod.unchecked v69 2)) + (assertz 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) (cast v61)) (let (v78 u32) (add.checked v77 4)) (let (v79 u32) (mod.unchecked v78 2)) (assertz v79) (let (v80 (ptr i32)) (inttoptr v78)) - (let (v81 i32) (load v80)) - (let (v82 i32) (const.i32 -4)) - (let (v83 i32) (band v81 v82)) - (let (v84 i1) (eq v83 0)) - (let (v85 i32) (zext v84)) - (let (v86 i1) (neq v85 0)) - (condbr v86 (block 11 v37 v81 v76 v44 v144 v174 v188 v200) (block 17))) - - (block 16 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (store v80 v76) + (let (v81 u32) (cast v55)) + (let (v82 u32) (add.checked v81 4)) + (let (v83 u32) (mod.unchecked v82 2)) + (assertz 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) (cast v55)) + (let (v89 u32) (mod.unchecked v88 2)) + (assertz 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 - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v76 v87)) - (let (v89 u32) (cast v83)) - (let (v90 u32) (mod.unchecked v89 2)) - (assertz v90) - (let (v91 (ptr i32)) (inttoptr v89)) - (let (v92 i32) (load v91)) - (br (block 12 v83 v92 v88 v37 v44 v144 v174 v188 v200))) + (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) (cast v119)) + (let (v126 u32) (add.checked v125 4)) + (let (v127 u32) (mod.unchecked v126 2)) + (assertz 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) (cast v119)) + (let (v133 u32) (mod.unchecked v132 2)) + (assertz 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 - (param v142 i32) - (param v146 i32) - (param v172 i32) - (param v186 i32) - (param v198 i32) - (let (v147 u32) (cast v142)) - (let (v148 u32) (mod.unchecked v147 2)) - (assertz v148) - (let (v149 (ptr i32)) (inttoptr v147)) - (store v149 v146) - (let (v150 i32) (const.i32 8)) - (let (v151 i32) (add.wrapping v146 v150)) - (let (v152 u32) (cast v146)) - (let (v153 u32) (add.checked v152 8)) - (let (v154 u32) (mod.unchecked v153 2)) - (assertz v154) - (let (v155 (ptr i32)) (inttoptr v153)) - (let (v156 i32) (load v155)) - (let (v157 i32) (const.i32 1)) - (let (v158 i32) (band v156 v157)) - (let (v159 i1) (neq v158 0)) - (condbr v159 (block 9 v151 v156 v146 v142 v172 v186 v198) (block 20))) + (let (v96 u32) (cast v92)) + (let (v97 u32) (mod.unchecked v96 2)) + (assertz 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) (cast v92)) + (let (v107 u32) (mod.unchecked v106 2)) + (assertz v107) + (let (v108 (ptr i32)) (inttoptr v106)) + (store v108 v105) + (let (v110 u32) (cast v109)) + (let (v111 u32) (add.checked v110 4)) + (let (v112 u32) (mod.unchecked v111 2)) + (assertz v112) + (let (v113 (ptr i32)) (inttoptr v111)) + (let (v114 i32) (load v113)) + (let (v115 u32) (cast v109)) + (let (v116 u32) (mod.unchecked v115 2)) + (assertz 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 - (let (v133 u32) (cast v131)) - (let (v134 u32) (mod.unchecked v133 2)) - (assertz v134) - (let (v135 (ptr i32)) (inttoptr v133)) - (let (v136 i32) (load v135)) - (let (v137 i32) (const.i32 2)) - (let (v138 i32) (bor v136 v137)) - (let (v139 u32) (cast v131)) - (let (v140 u32) (mod.unchecked v139 2)) - (assertz v140) - (let (v141 (ptr i32)) (inttoptr v139)) - (store v141 v138) - (br (block 18 v143 v131 v173 v187 v199))) + (param v152 i32) + (param v157 i32) + (param v183 i32) + (param v198 i32) + (param v211 i32) + (let (v158 u32) (cast v152)) + (let (v159 u32) (mod.unchecked v158 2)) + (assertz v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v161 u32) (cast v157)) + (let (v162 u32) (add.checked v161 8)) + (let (v163 u32) (mod.unchecked v162 2)) + (assertz 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 - (br (block 10))) + (let (v143 u32) (cast v140)) + (let (v144 u32) (mod.unchecked v143 2)) + (assertz 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) (cast v140)) + (let (v150 u32) (mod.unchecked v149 2)) + (assertz v150) + (let (v151 (ptr i32)) (inttoptr v149)) + (store v151 v148) + (br (block 19 v153 v140 v184 v199 v212))) (block 21 - (param v321 i32) - (param v322 i32) - (param v327 i32) - (param v328 i32) - (param v329 i32) - (let (v323 u32) (cast v321)) - (let (v324 u32) (mod.unchecked v323 2)) - (assertz v324) - (let (v325 (ptr i32)) (inttoptr v323)) - (store v325 v322) - (let (v326 i1) (neq v322 0)) - (condbr v326 (block 4 v322 v321 v327 v328 v329) (block 32))) + (br (block 10))) (block 22 - (let (v181 i32) (const.i32 72)) - (let (v182 i32) (add.wrapping v168 v181)) - (let (v183 i32) (sub.wrapping v167 v170)) - (let (v190 i32) (band v183 v184)) - (let (v191 u32) (bitcast v182)) - (let (v192 u32) (bitcast v190)) - (let (v193 i1) (lte v191 v192)) - (let (v194 i32) (sext v193)) - (let (v195 i1) (neq v194 0)) - (condbr v195 (block 24) (block 25))) - - (block 23 (param v312 i32) (param v313 i32) - (let (v314 i32) (const.i32 1)) - (let (v315 i32) (bor v313 v314)) - (let (v316 u32) (cast v312)) - (let (v317 u32) (mod.unchecked v316 2)) - (assertz v317) - (let (v318 (ptr i32)) (inttoptr v316)) - (store v318 v315) - (let (v319 i32) (const.i32 8)) - (let (v320 i32) (add.wrapping v312 v319)) - (ret v320)) - - (block 24 - (let (v215 i32) (const.i32 0)) - (let (v216 i32) (const.i32 0)) - (let (v217 u32) (cast v190)) - (let (v218 u32) (mod.unchecked v217 2)) - (assertz v218) - (let (v219 (ptr i32)) (inttoptr v217)) - (store v219 v216) - (let (v220 i32) (const.i32 -8)) - (let (v221 i32) (add.wrapping v190 v220)) - (let (v222 i64) (const.i64 0)) - (let (v223 u32) (cast v221)) - (let (v224 u32) (mod.unchecked v223 2)) - (assertz v224) - (let (v225 (ptr i64)) (inttoptr v223)) - (store v225 v222) - (let (v226 u32) (cast v161)) - (let (v227 u32) (mod.unchecked v226 2)) - (assertz v227) - (let (v228 (ptr i32)) (inttoptr v226)) - (let (v229 i32) (load v228)) - (let (v230 i32) (const.i32 -4)) - (let (v231 i32) (band v229 v230)) - (let (v232 u32) (cast v221)) - (let (v233 u32) (mod.unchecked v232 2)) - (assertz v233) - (let (v234 (ptr i32)) (inttoptr v232)) - (store v234 v231) - (let (v235 u32) (cast v161)) - (let (v236 u32) (mod.unchecked v235 2)) - (assertz v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 i32) (const.i32 -4)) - (let (v240 i32) (band v238 v239)) - (let (v241 i1) (eq v240 0)) - (let (v242 i32) (zext v241)) - (let (v243 i1) (neq v242 0)) - (condbr v243 (block 27 v221 v215 v161 v168) (block 28))) + (param v335 i32) + (param v336 i32) + (param v341 i32) + (param v342 i32) + (param v343 i32) + (let (v337 u32) (cast v335)) + (let (v338 u32) (mod.unchecked v337 2)) + (assertz 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) (cast v326)) + (let (v331 u32) (mod.unchecked v330 2)) + (assertz 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 (v202 i32) (band v196 v168)) - (let (v203 i1) (neq v202 0)) - (condbr v203 (block 21 v204 v205 v170 v184 v196) (block 26))) + (let (v229 i32) (const.i32 0)) + (let (v230 i32) (const.i32 0)) + (let (v231 u32) (cast v203)) + (let (v232 u32) (mod.unchecked v231 2)) + (assertz 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) (cast v235)) + (let (v238 u32) (mod.unchecked v237 2)) + (assertz v238) + (let (v239 (ptr i64)) (inttoptr v237)) + (store v239 v236) + (let (v240 u32) (cast v172)) + (let (v241 u32) (mod.unchecked v240 2)) + (assertz 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) (cast v235)) + (let (v247 u32) (mod.unchecked v246 2)) + (assertz v247) + (let (v248 (ptr i32)) (inttoptr v246)) + (store v248 v245) + (let (v249 u32) (cast v172)) + (let (v250 u32) (mod.unchecked v249 2)) + (assertz 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 (v206 i32) (const.i32 -4)) - (let (v207 i32) (band v205 v206)) - (let (v208 u32) (cast v204)) - (let (v209 u32) (mod.unchecked v208 2)) - (assertz v209) - (let (v210 (ptr i32)) (inttoptr v208)) - (store v210 v207) - (let (v211 u32) (cast v161)) - (let (v212 u32) (mod.unchecked v211 2)) - (assertz v212) - (let (v213 (ptr i32)) (inttoptr v211)) - (let (v214 i32) (load v213)) - (br (block 23 v161 v214))) + (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 - (param v266 i32) - (param v267 i32) - (param v268 i32) - (param v274 i32) - (let (v269 i32) (bor v267 v268)) - (let (v270 u32) (cast v266)) - (let (v271 u32) (add.checked v270 4)) - (let (v272 u32) (mod.unchecked v271 2)) - (assertz v272) - (let (v273 (ptr i32)) (inttoptr v271)) - (store v273 v269) - (let (v275 u32) (cast v274)) - (let (v276 u32) (mod.unchecked v275 2)) - (assertz v276) - (let (v277 (ptr i32)) (inttoptr v275)) - (let (v278 i32) (load v277)) - (let (v279 i32) (const.i32 -2)) - (let (v280 i32) (band v278 v279)) - (let (v281 u32) (cast v274)) - (let (v282 u32) (mod.unchecked v281 2)) - (assertz v282) - (let (v283 (ptr i32)) (inttoptr v281)) - (store v283 v280) - (let (v284 u32) (cast v268)) - (let (v285 u32) (mod.unchecked v284 2)) - (assertz v285) - (let (v286 (ptr i32)) (inttoptr v284)) - (let (v287 i32) (load v286)) - (let (v288 i32) (const.i32 3)) - (let (v289 i32) (band v287 v288)) - (let (v290 i32) (bor v289 v266)) - (let (v291 u32) (cast v268)) - (let (v292 u32) (mod.unchecked v291 2)) - (assertz v292) - (let (v293 (ptr i32)) (inttoptr v291)) - (store v293 v290) - (let (v294 i32) (const.i32 2)) - (let (v295 i32) (band v287 v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 30) (block 31))) + (let (v220 i32) (const.i32 -4)) + (let (v221 i32) (band v219 v220)) + (let (v222 u32) (cast v218)) + (let (v223 u32) (mod.unchecked v222 2)) + (assertz v223) + (let (v224 (ptr i32)) (inttoptr v222)) + (store v224 v221) + (let (v225 u32) (cast v172)) + (let (v226 u32) (mod.unchecked v225 2)) + (assertz v226) + (let (v227 (ptr i32)) (inttoptr v225)) + (let (v228 i32) (load v227)) + (br (block 24 v172 v228))) (block 28 - (let (v244 i32) (const.i32 2)) - (let (v245 i32) (band v238 v244)) - (let (v246 i1) (neq v245 0)) - (condbr v246 (block 27 v221 v215 v161 v168) (block 29))) + (param v280 i32) + (param v281 i32) + (param v282 i32) + (param v288 i32) + (let (v283 i32) (bor v281 v282)) + (let (v284 u32) (cast v280)) + (let (v285 u32) (add.checked v284 4)) + (let (v286 u32) (mod.unchecked v285 2)) + (assertz v286) + (let (v287 (ptr i32)) (inttoptr v285)) + (store v287 v283) + (let (v289 u32) (cast v288)) + (let (v290 u32) (mod.unchecked v289 2)) + (assertz 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) (cast v288)) + (let (v296 u32) (mod.unchecked v295 2)) + (assertz v296) + (let (v297 (ptr i32)) (inttoptr v295)) + (store v297 v294) + (let (v298 u32) (cast v282)) + (let (v299 u32) (mod.unchecked v298 2)) + (assertz 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) (cast v282)) + (let (v306 u32) (mod.unchecked v305 2)) + (assertz 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 (v247 u32) (cast v240)) - (let (v248 u32) (add.checked v247 4)) - (let (v249 u32) (mod.unchecked v248 2)) - (assertz v249) - (let (v250 (ptr i32)) (inttoptr v248)) - (let (v251 i32) (load v250)) - (let (v252 i32) (const.i32 3)) - (let (v253 i32) (band v251 v252)) - (let (v254 i32) (bor v253 v221)) - (let (v255 u32) (cast v240)) - (let (v256 u32) (add.checked v255 4)) - (let (v257 u32) (mod.unchecked v256 2)) - (assertz v257) - (let (v258 (ptr i32)) (inttoptr v256)) - (store v258 v254) - (let (v259 u32) (cast v221)) - (let (v260 u32) (add.checked v259 4)) - (let (v261 u32) (mod.unchecked v260 2)) - (assertz v261) - (let (v262 (ptr i32)) (inttoptr v260)) - (let (v263 i32) (load v262)) - (let (v264 i32) (const.i32 3)) - (let (v265 i32) (band v263 v264)) - (br (block 27 v221 v265 v161 v168))) + (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 (v301 i32) (const.i32 -3)) - (let (v302 i32) (band v290 v301)) - (let (v303 u32) (cast v268)) - (let (v304 u32) (mod.unchecked v303 2)) - (assertz v304) - (let (v305 (ptr i32)) (inttoptr v303)) - (store v305 v302) - (let (v306 u32) (cast v266)) - (let (v307 u32) (mod.unchecked v306 2)) - (assertz v307) - (let (v308 (ptr i32)) (inttoptr v306)) - (let (v309 i32) (load v308)) - (let (v310 i32) (const.i32 2)) - (let (v311 i32) (bor v309 v310)) - (br (block 23 v266 v311))) + (let (v261 u32) (cast v254)) + (let (v262 u32) (add.checked v261 4)) + (let (v263 u32) (mod.unchecked v262 2)) + (assertz 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) (cast v254)) + (let (v270 u32) (add.checked v269 4)) + (let (v271 u32) (mod.unchecked v270 2)) + (assertz v271) + (let (v272 (ptr i32)) (inttoptr v270)) + (store v272 v268) + (let (v273 u32) (cast v235)) + (let (v274 u32) (add.checked v273 4)) + (let (v275 u32) (mod.unchecked v274 2)) + (assertz 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 (v297 u32) (cast v266)) - (let (v298 u32) (mod.unchecked v297 2)) - (assertz v298) - (let (v299 (ptr i32)) (inttoptr v297)) - (let (v300 i32) (load v299)) - (br (block 23 v266 v300))) + (let (v315 i32) (const.i32 -3)) + (let (v316 i32) (band v304 v315)) + (let (v317 u32) (cast v282)) + (let (v318 u32) (mod.unchecked v317 2)) + (assertz v318) + (let (v319 (ptr i32)) (inttoptr v317)) + (store v319 v316) + (let (v320 u32) (cast v280)) + (let (v321 u32) (mod.unchecked v320 2)) + (assertz 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) (cast v280)) + (let (v312 u32) (mod.unchecked v311 2)) + (assertz v312) + (let (v313 (ptr i32)) (inttoptr v311)) + (let (v314 i32) (load v313)) + (br (block 24 v280 v314))) + + (block 33 (br (block 5))) ) @@ -1094,73 +1179,14 @@ (br (block 7 v175 v185))) ) - (func (export #wit_bindgen::rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (cast v0)) - (let (v2 u32) (add.checked v1 1048581)) - (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 u8) (trunc v8)) - (let (v10 u32) (cast v7)) - (let (v11 u32) (add.checked v10 1048581)) - (let (v12 (ptr u8)) (inttoptr v11)) - (store v12 v9) - (br (block 2))) - ) - (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 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) + (br (block 1 v5))) (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) (cast v9)) - (let (v11 u32) (add.checked v10 1048580)) - (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)) ) ;; Imports diff --git a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat index 1c47e6480..b3d4fc04a 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat @@ -50,24 +50,57 @@ (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 i64 i64 i64 i64))) - (type (;4;) (func (param i64 i64 i64 i64 i64 i64 i64 i64 i64))) - (type (;5;) (func (param i32 i32) (result i32))) - (type (;6;) (func (param i32 i32 i32 i32) (result i32))) + (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 $miden:basic-wallet/basic-wallet@1.0.0#receive-asset (;4;) (type 3) (param i64 i64 i64 i64) + (func $__rust_alloc (;4;) (type 3) (param i32 i32) (result i32) + i32.const 1048580 + local.get 1 + local.get 0 + call $::alloc + ) + (func $__rust_realloc (;5;) (type 4) (param i32 i32 i32 i32) (result i32) + (local i32) + block ;; label = @1 + i32.const 1048580 + 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 1048580 + 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 (;6;) (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 + call $wit_bindgen_rt::run_ctors_once local.get 0 local.get 1 local.get 2 @@ -79,14 +112,14 @@ i32.add global.set $__stack_pointer ) - (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;5;) (type 4) (param i64 i64 i64 i64 i64 i64 i64 i64 i64) + (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;7;) (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 + call $wit_bindgen_rt::run_ctors_once local.get 0 local.get 1 local.get 2 @@ -96,17 +129,11 @@ local.get 9 i64.load local.get 9 - i32.const 8 - i32.add - i64.load + i64.load offset=8 local.get 9 - i32.const 16 - i32.add - i64.load + i64.load offset=16 local.get 9 - i32.const 24 - i32.add - i64.load + i64.load offset=24 local.get 4 local.get 5 local.get 6 @@ -119,342 +146,355 @@ i32.add global.set $__stack_pointer ) - (func $__rust_alloc (;6;) (type 5) (param i32 i32) (result i32) - i32.const 1048576 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;7;) (type 6) (param i32 i32 i32 i32) (result i32) - (local i32) + (func $wit_bindgen_rt::cabi_realloc (;8;) (type 4) (param i32 i32 i32 i32) (result i32) block ;; label = @1 - i32.const 1048576 + 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=1048584 + 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 - 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 1048576 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc + unreachable + unreachable end - local.get 4 + local.get 2 ) - (func $wee_alloc::alloc_first_fit (;8;) (type 7) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32) + (func $wit_bindgen_rt::run_ctors_once (;9;) (type 2) + block ;; label = @1 + i32.const 0 + i32.load8_u offset=1048585 + br_if 0 (;@1;) + call $__wasm_call_ctors + i32.const 0 + i32.const 1 + i32.store8 offset=1048585 + 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 - i32.eqz br_if 0 (;@1;) - 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 = @2 - local.get 3 - i32.const 8 - i32.add - local.set 7 + 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 - local.get 3 - i32.load offset=8 - local.tee 0 + 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 - br_if 0 (;@4;) - local.get 3 - local.set 1 - br 1 (;@3;) + select + local.set 8 end - loop ;; label = @4 - local.get 7 - local.get 0 - i32.const -2 - i32.and - i32.store + block ;; label = @4 local.get 3 - i32.load offset=4 + i32.load + local.tee 1 i32.const -4 i32.and - local.tee 1 - i32.load - local.set 7 - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.load - local.tee 8 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - block ;; label = @7 - local.get 8 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - local.get 0 - local.get 0 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 0 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 1 (;@5;) - local.get 0 - i32.const -4 - i32.and - local.set 0 - local.get 8 - i32.load - local.set 7 - end - local.get 8 - local.get 7 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 0 - end - local.get 3 - local.get 7 + 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 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@5;) - local.get 1 - local.get 1 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 local.get 1 + i32.const -4 + i32.and + i32.or i32.store - local.get 1 - i32.const 8 - i32.add + 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 - local.set 3 - local.get 1 - i32.load offset=8 - local.tee 0 - i32.const 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 - local.tee 3 - local.get 7 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@3;) + i32.store block ;; label = @4 - block ;; label = @5 - local.get 7 - i32.const 72 - i32.add - local.get 3 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 3 - i32.le_u - br_if 0 (;@5;) - local.get 4 - local.get 7 - i32.and - br_if 2 (;@3;) - local.get 2 - local.get 0 - i32.const -4 - i32.and - i32.store - local.get 1 - i32.load - local.set 0 - local.get 1 - local.set 3 - br 1 (;@4;) - end - i32.const 0 - local.set 0 - local.get 3 - i32.const 0 - i32.store local.get 3 - i32.const -8 - i32.add - local.tee 3 - i64.const 0 - i64.store align=4 - local.get 3 - local.get 1 i32.load + local.tee 9 i32.const -4 i32.and - i32.store - block ;; label = @5 - local.get 1 - i32.load - local.tee 2 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 2 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 3 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - i32.const 3 - i32.and - local.set 0 - end - local.get 3 - local.get 0 - local.get 1 - i32.or - i32.store offset=4 - local.get 7 - local.get 7 - i32.load - i32.const -2 + local.tee 8 + i32.eqz + br_if 0 (;@4;) + local.get 9 + i32.const 2 i32.and - i32.store - local.get 1 - local.get 1 - i32.load - local.tee 0 + br_if 0 (;@4;) + local.get 8 + local.get 8 + i32.load offset=4 i32.const 3 i32.and - local.get 3 + local.get 1 i32.or - local.tee 7 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 3 - i32.load - local.set 0 - br 1 (;@4;) - end + i32.store offset=4 local.get 1 - local.get 7 - i32.const -3 + i32.load offset=4 + i32.const 3 i32.and - i32.store - local.get 3 - i32.load - i32.const 2 - i32.or - local.set 0 + local.set 7 end + local.get 1 + local.get 7 local.get 3 + i32.or + i32.store offset=4 local.get 0 - i32.const 1 + 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 - i32.const 8 - i32.add - return + 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 2 + local.get 1 local.get 0 + i32.const 1 + i32.or i32.store - local.get 0 - local.set 3 - local.get 0 - br_if 0 (;@2;) + 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 7) (param i32 i32 i32) (result i32) + (func $::alloc (;11;) (type 7) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -558,7 +598,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;10;) (type 8) (param i32 i32 i32 i32) + (func $::dealloc (;12;) (type 8) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -731,56 +771,23 @@ i32.store end ) - (func $wit_bindgen::rt::run_ctors_once (;11;) (type 2) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048581 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048581 - end - ) - (func $cabi_realloc (;12;) (type 6) (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=1048580 - 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 + (func $cabi_realloc (;13;) (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;) 1 1 funcref) + (table (;0;) 2 2 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 $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") ) (core module (;1;) (type (;0;) (func (param i64 i64 i64 i64 i32))) 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 index a1e9496cb..39cf838d4 100644 --- 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 @@ -29,6 +29,9 @@ ) (module #basic_wallet_p2id_note + ;; Data Segments + (data (mut) (offset 1048576) 0x01000000) + ;; Constants (const (id 0) 0x00100000) @@ -44,6 +47,50 @@ (ret)) ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) + (block 0 (param v0 i32) (param v1 i32) + (let (v3 i32) (const.i32 1048580)) + (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 1048580)) + (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 v22 i32) + (br (block 1 v22))) + + (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) (cast v7)) + (let (v18 (ptr u8)) (inttoptr v17)) + (let (v19 u32) (cast v0)) + (let (v20 (ptr u8)) (inttoptr v19)) + (memcpy v20 v18 v16) + (let (v21 i32) (const.i32 1048580)) + (call #::dealloc v21 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)) @@ -52,21 +99,27 @@ (let (v3 i32) (sub.wrapping v1 v2)) (let (v4 (ptr i32)) (global.symbol #__stack_pointer)) (store v4 v3) - (call #wit_bindgen::rt::run_ctors_once) - (let (v5 i32) (const.i32 8)) - (let (v6 i32) (add.wrapping v3 v5)) - (call (#wit-component:shim #indirect-miden:base/note@1.0.0-get-inputs) v6) - (let (v7 i32) (const.i32 12)) - (let (v8 i32) (add.wrapping v3 v7)) - (let (v9 u32) (cast v8)) - (let (v10 u32) (mod.unchecked v9 2)) - (assertz v10) - (let (v11 (ptr i32)) (inttoptr v9)) - (let (v12 i32) (load v11)) - (let (v13 i1) (eq v12 0)) - (let (v14 i32) (zext v13)) - (let (v15 i1) (neq v14 0)) - (condbr v15 (block 2) (block 3))) + (call #wit_bindgen_rt::run_ctors_once) + (let (v5 i64) (const.i64 0)) + (let (v6 u32) (cast v3)) + (let (v7 u32) (add.checked v6 8)) + (let (v8 u32) (mod.unchecked v7 3)) + (assertz v8) + (let (v9 (ptr i64)) (inttoptr v7)) + (store v9 v5) + (let (v10 i32) (const.i32 8)) + (let (v11 i32) (add.wrapping v3 v10)) + (call (#wit-component:shim #indirect-miden:base/note@1.0.0-get-inputs) v11) + (let (v12 u32) (cast v3)) + (let (v13 u32) (add.checked v12 12)) + (let (v14 u32) (mod.unchecked v13 2)) + (assertz v14) + (let (v15 (ptr i32)) (inttoptr v13)) + (let (v16 i32) (load v15)) + (let (v17 i1) (eq v16 0)) + (let (v18 i32) (zext v17)) + (let (v19 i1) (neq v18 0)) + (condbr v19 (block 2) (block 3))) (block 1) @@ -74,160 +127,191 @@ (unreachable)) (block 3 - (let (v16 u32) (cast v3)) - (let (v17 u32) (add.checked v16 8)) - (let (v18 u32) (mod.unchecked v17 2)) - (assertz v18) - (let (v19 (ptr i32)) (inttoptr v17)) - (let (v20 i32) (load v19)) - (let (v21 u32) (cast v20)) - (let (v22 u32) (mod.unchecked v21 3)) + (let (v20 u32) (cast v3)) + (let (v21 u32) (add.checked v20 8)) + (let (v22 u32) (mod.unchecked v21 2)) (assertz v22) - (let (v23 (ptr i64)) (inttoptr v21)) - (let (v24 i64) (load v23)) - (let (v25 i64) (call (#miden:base/core-types@1.0.0 #account-id-from-felt) v24)) - (let (v26 i64) (call (#miden:base/account@1.0.0 #get-id))) - (let (v27 i1) (neq v25 v26)) - (let (v28 i32) (zext v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 2) (block 4))) + (let (v23 (ptr i32)) (inttoptr v21)) + (let (v24 i32) (load v23)) + (let (v25 u32) (cast v24)) + (let (v26 u32) (mod.unchecked v25 3)) + (assertz v26) + (let (v27 (ptr i64)) (inttoptr v25)) + (let (v28 i64) (load v27)) + (let (v29 i64) (call (#miden:base/core-types@1.0.0 #account-id-from-felt) v28)) + (let (v30 i64) (call (#miden:base/account@1.0.0 #get-id))) + (let (v31 i1) (neq v29 v30)) + (let (v32 i32) (zext v31)) + (let (v33 i1) (neq v32 0)) + (condbr v33 (block 2) (block 4))) (block 4 - (let (v30 i32) (const.i32 8)) - (let (v31 i32) (add.wrapping v3 v30)) - (call (#wit-component:shim #indirect-miden:base/note@1.0.0-get-assets) v31) - (let (v32 i32) (const.i32 12)) - (let (v33 i32) (add.wrapping v3 v32)) - (let (v34 u32) (cast v33)) - (let (v35 u32) (mod.unchecked v34 2)) - (assertz v35) - (let (v36 (ptr i32)) (inttoptr v34)) - (let (v37 i32) (load v36)) - (let (v38 i1) (eq v37 0)) - (let (v39 i32) (zext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 5 v20 v12 v3) (block 6))) - - (block 5 (param v84 i32) (param v87 i32) (param v92 i32) - (let (v83 i32) (const.i32 1048576)) - (let (v86 i32) (const.i32 8)) - (let (v89 i32) (const.i32 3)) - (let (v90 u32) (bitcast v89)) - (let (v91 i32) (shl.wrapping v87 v90)) - (call #::dealloc v83 v84 v86 v91) - (let (v94 i32) (const.i32 16)) - (let (v95 i32) (add.wrapping v92 v94)) - (let (v96 (ptr i32)) (global.symbol #__stack_pointer)) - (store v96 v95) - (ret)) - - (block 6 + (let (v34 i64) (const.i64 0)) + (let (v35 u32) (cast v3)) + (let (v36 u32) (add.checked v35 8)) + (let (v37 u32) (mod.unchecked v36 3)) + (assertz v37) + (let (v38 (ptr i64)) (inttoptr v36)) + (store v38 v34) + (let (v39 i32) (const.i32 8)) + (let (v40 i32) (add.wrapping v3 v39)) + (call (#wit-component:shim #indirect-miden:base/note@1.0.0-get-assets) v40) (let (v41 u32) (cast v3)) - (let (v42 u32) (add.checked v41 8)) + (let (v42 u32) (add.checked v41 12)) (let (v43 u32) (mod.unchecked v42 2)) (assertz v43) (let (v44 (ptr i32)) (inttoptr v42)) (let (v45 i32) (load v44)) - (let (v46 i32) (const.i32 5)) - (let (v47 u32) (bitcast v46)) - (let (v48 i32) (shl.wrapping v37 v47)) - (let (v49 i32) (add.wrapping v45 v48)) - (br (block 7 v45 v49 v45 v37 v20 v12 v3))) + (let (v46 i1) (eq v45 0)) + (let (v47 i32) (zext v46)) + (let (v48 i1) (neq v47 0)) + (condbr v48 (block 5 v24 v16 v3) (block 6))) + + (block 5 (param v92 i32) (param v95 i32) (param v100 i32) + (let (v91 i32) (const.i32 1048580)) + (let (v94 i32) (const.i32 8)) + (let (v97 i32) (const.i32 3)) + (let (v98 u32) (bitcast v97)) + (let (v99 i32) (shl.wrapping v95 v98)) + (call #::dealloc v91 v92 v94 v99) + (let (v102 i32) (const.i32 16)) + (let (v103 i32) (add.wrapping v100 v102)) + (let (v104 (ptr i32)) (global.symbol #__stack_pointer)) + (store v104 v103) + (ret)) + + (block 6 + (let (v49 u32) (cast v3)) + (let (v50 u32) (add.checked v49 8)) + (let (v51 u32) (mod.unchecked v50 2)) + (assertz v51) + (let (v52 (ptr i32)) (inttoptr v50)) + (let (v53 i32) (load v52)) + (let (v54 i32) (const.i32 5)) + (let (v55 u32) (bitcast v54)) + (let (v56 i32) (shl.wrapping v45 v55)) + (let (v57 i32) (add.wrapping v53 v56)) + (br (block 7 v53 v57 v53 v45 v24 v16 v3))) (block 7 - (param v50 i32) - (param v72 i32) - (param v77 i32) - (param v79 i32) + (param v58 i32) + (param v80 i32) (param v85 i32) - (param v88 i32) + (param v87 i32) (param v93 i32) - (let (v51 u32) (cast v50)) - (let (v52 u32) (mod.unchecked v51 3)) - (assertz v52) - (let (v53 (ptr i64)) (inttoptr v51)) - (let (v54 i64) (load v53)) - (let (v55 u32) (cast v50)) - (let (v56 u32) (add.checked v55 8)) - (let (v57 u32) (mod.unchecked v56 3)) - (assertz v57) - (let (v58 (ptr i64)) (inttoptr v56)) - (let (v59 i64) (load v58)) - (let (v60 u32) (cast v50)) - (let (v61 u32) (add.checked v60 16)) - (let (v62 u32) (mod.unchecked v61 3)) - (assertz v62) - (let (v63 (ptr i64)) (inttoptr v61)) - (let (v64 i64) (load v63)) - (let (v65 u32) (cast v50)) - (let (v66 u32) (add.checked v65 24)) - (let (v67 u32) (mod.unchecked v66 3)) - (assertz v67) - (let (v68 (ptr i64)) (inttoptr v66)) - (let (v69 i64) (load v68)) - (call (#miden:basic-wallet/basic-wallet@1.0.0 #receive-asset) v54 v59 v64 v69) - (let (v70 i32) (const.i32 32)) - (let (v71 i32) (add.wrapping v50 v70)) - (let (v73 i1) (neq v71 v72)) - (let (v74 i32) (zext v73)) - (let (v75 i1) (neq v74 0)) - (condbr v75 (block 7 v71 v72 v77 v79 v85 v88 v93) (block 9))) + (param v96 i32) + (param v101 i32) + (let (v59 u32) (cast v58)) + (let (v60 u32) (mod.unchecked v59 3)) + (assertz v60) + (let (v61 (ptr i64)) (inttoptr v59)) + (let (v62 i64) (load v61)) + (let (v63 u32) (cast v58)) + (let (v64 u32) (add.checked v63 8)) + (let (v65 u32) (mod.unchecked v64 3)) + (assertz v65) + (let (v66 (ptr i64)) (inttoptr v64)) + (let (v67 i64) (load v66)) + (let (v68 u32) (cast v58)) + (let (v69 u32) (add.checked v68 16)) + (let (v70 u32) (mod.unchecked v69 3)) + (assertz v70) + (let (v71 (ptr i64)) (inttoptr v69)) + (let (v72 i64) (load v71)) + (let (v73 u32) (cast v58)) + (let (v74 u32) (add.checked v73 24)) + (let (v75 u32) (mod.unchecked v74 3)) + (assertz v75) + (let (v76 (ptr i64)) (inttoptr v74)) + (let (v77 i64) (load v76)) + (call (#miden:basic-wallet/basic-wallet@1.0.0 #receive-asset) v62 v67 v72 v77) + (let (v78 i32) (const.i32 32)) + (let (v79 i32) (add.wrapping v58 v78)) + (let (v81 i1) (neq v79 v80)) + (let (v82 i32) (zext v81)) + (let (v83 i1) (neq v82 0)) + (condbr v83 (block 7 v79 v80 v85 v87 v93 v96 v101) (block 9))) (block 8 - (let (v76 i32) (const.i32 1048576)) - (let (v78 i32) (const.i32 8)) - (let (v80 i32) (const.i32 5)) - (let (v81 u32) (bitcast v80)) - (let (v82 i32) (shl.wrapping v79 v81)) - (call #::dealloc v76 v77 v78 v82) - (br (block 5 v85 v88 v93))) + (let (v84 i32) (const.i32 1048580)) + (let (v86 i32) (const.i32 8)) + (let (v88 i32) (const.i32 5)) + (let (v89 u32) (bitcast v88)) + (let (v90 i32) (shl.wrapping v87 v89)) + (call #::dealloc v84 v85 v86 v90) + (br (block 5 v93 v96 v101))) (block 9 (br (block 8))) ) - (func (export #__rust_alloc) (param i32) (param i32) (result i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048576)) - (let (v4 i32) (call #::alloc v3 v1 v0)) - (br (block 1 v4))) - - (block 1 (param v2 i32) - (ret v2)) - ) - - (func (export #__rust_realloc) + (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 i32) (const.i32 0)) - (let (v6 i32) (const.i32 1048576)) - (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))) + (let (v5 i1) (neq v1 0)) + (condbr v5 (block 4) (block 5))) (block 1 (param v4 i32) (ret v4)) - (block 2 (param v22 i32) - (br (block 1 v22))) + (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) (cast v9)) + (let (v11 u32) (add.checked v10 1048584)) + (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) (cast v0)) + (let (v2 u32) (add.checked v1 1048585)) + (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 - (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) (cast v7)) - (let (v18 (ptr u8)) (inttoptr v17)) - (let (v19 u32) (cast v0)) - (let (v20 (ptr u8)) (inttoptr v19)) - (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048576)) - (call #::dealloc v21 v0 v2 v1) - (br (block 2 v7))) + (call #__wasm_call_ctors) + (let (v7 i32) (const.i32 0)) + (let (v8 i32) (const.i32 1)) + (let (v9 u8) (trunc v8)) + (let (v10 u32) (cast v7)) + (let (v11 u32) (add.checked v10 1048585)) + (let (v12 (ptr u8)) (inttoptr v11)) + (store v12 v9) + (br (block 2))) ) (func (export #wee_alloc::alloc_first_fit) @@ -239,480 +323,496 @@ (assertz v6) (let (v7 (ptr i32)) (inttoptr v5)) (let (v8 i32) (load v7)) - (let (v9 i1) (eq v8 0)) - (let (v10 i32) (zext v9)) - (let (v11 i1) (neq v10 0)) - (condbr v11 (block 2) (block 3))) + (let (v9 i1) (neq v8 0)) + (condbr v9 (block 2) (block 3))) (block 1 (param v3 i32) (ret v3)) (block 2 - (let (v330 i32) (const.i32 0)) - (br (block 1 v330))) + (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 (v12 i32) (const.i32 -1)) - (let (v13 i32) (add.wrapping v1 v12)) - (let (v14 i32) (const.i32 0)) - (let (v15 i32) (sub.wrapping v14 v1)) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v16)) - (let (v18 i32) (shl.wrapping v0 v17)) - (br (block 4 v8 v2 v18 v15 v13))) + (let (v10 i32) (const.i32 0)) + (ret v10)) (block 4 - (param v19 i32) - (param v160 i32) - (param v171 i32) - (param v185 i32) + (param v18 i32) + (param v169 i32) + (param v182 i32) (param v197 i32) - (let (v20 i32) (const.i32 8)) - (let (v21 i32) (add.wrapping v19 v20)) - (let (v22 u32) (cast v19)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 2)) - (assertz v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 i32) (const.i32 1)) - (let (v28 i32) (band v26 v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 7) (block 8))) + (param v210 i32) + (let (v19 u32) (cast v18)) + (let (v20 u32) (add.checked v19 8)) + (let (v21 u32) (mod.unchecked v20 2)) + (assertz 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 - (br (block 2))) + (let (v344 i32) (const.i32 0)) + (br (block 1 v344))) (block 6 - (param v161 i32) - (param v168 i32) - (param v170 i32) - (param v184 i32) + (param v172 i32) + (param v179 i32) + (param v181 i32) (param v196 i32) - (param v204 i32) - (param v205 i32) - (let (v162 u32) (cast v161)) - (let (v163 u32) (mod.unchecked v162 2)) - (assertz v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (let (v165 i32) (load v164)) - (let (v166 i32) (const.i32 -4)) - (let (v167 i32) (band v165 v166)) - (let (v169 i32) (sub.wrapping v167 v168)) - (let (v176 u32) (bitcast v169)) - (let (v177 u32) (bitcast v170)) - (let (v178 i1) (lt v176 v177)) - (let (v179 i32) (sext v178)) - (let (v180 i1) (neq v179 0)) - (condbr v180 (block 21 v204 v205 v170 v184 v196) (block 22))) + (param v209 i32) + (param v218 i32) + (param v219 i32) + (let (v173 u32) (cast v172)) + (let (v174 u32) (mod.unchecked v173 2)) + (assertz 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 v21 v26 v19 v160 v171 v185 v197))) + (br (block 9 v18 v23 v169 v182 v197 v210))) (block 8 - (br (block 6 v19 v21 v171 v185 v197 v160 v26))) + (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 v31 i32) - (param v37 i32) - (param v144 i32) - (param v174 i32) - (param v188 i32) - (param v200 i32) - (let (v32 i32) (const.i32 -2)) - (let (v33 i32) (band v31 v32)) - (let (v34 u32) (cast v30)) + (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) (cast v29)) + (let (v34 u32) (add.checked v33 8)) (let (v35 u32) (mod.unchecked v34 2)) (assertz v35) (let (v36 (ptr i32)) (inttoptr v34)) - (store v36 v33) - (let (v38 u32) (cast v37)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 2)) - (assertz v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (let (v42 i32) (load v41)) - (let (v43 i32) (const.i32 -4)) - (let (v44 i32) (band v42 v43)) - (let (v45 u32) (cast v44)) - (let (v46 u32) (mod.unchecked v45 2)) - (assertz v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (let (v48 i32) (load v47)) - (let (v49 u32) (cast v37)) - (let (v50 u32) (mod.unchecked v49 2)) - (assertz v50) - (let (v51 (ptr i32)) (inttoptr v49)) - (let (v52 i32) (load v51)) - (let (v53 i32) (const.i32 -4)) - (let (v54 i32) (band v52 v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 13) (block 14))) + (store v36 v32) + (let (v37 u32) (cast v29)) + (let (v38 u32) (add.checked v37 4)) + (let (v39 u32) (mod.unchecked v38 2)) + (assertz 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 - (br (block 6 v146 v151 v172 v186 v198 v142 v156))) + (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 v112 i32) - (param v113 i32) - (param v120 i32) - (param v131 i32) - (param v143 i32) - (param v173 i32) - (param v187 i32) - (param v199 i32) - (let (v114 i32) (const.i32 3)) - (let (v115 i32) (band v113 v114)) - (let (v116 u32) (cast v112)) - (let (v117 u32) (add.checked v116 4)) - (let (v118 u32) (mod.unchecked v117 2)) - (assertz v118) - (let (v119 (ptr i32)) (inttoptr v117)) - (store v119 v115) - (let (v121 i32) (const.i32 3)) - (let (v122 i32) (band v120 v121)) - (let (v123 u32) (cast v112)) - (let (v124 u32) (mod.unchecked v123 2)) - (assertz v124) - (let (v125 (ptr i32)) (inttoptr v123)) - (store v125 v122) - (let (v126 i32) (const.i32 2)) - (let (v127 i32) (band v120 v126)) - (let (v128 i1) (eq v127 0)) - (let (v129 i32) (zext v128)) - (let (v130 i1) (neq v129 0)) - (condbr v130 (block 18 v143 v131 v173 v187 v199) (block 19))) + (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) (cast v55)) + (let (v57 u32) (mod.unchecked v56 2)) + (assertz 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 - (param v93 i32) - (param v94 i32) - (param v97 i32) - (param v102 i32) - (param v132 i32) - (param v145 i32) - (param v175 i32) - (param v189 i32) - (param v201 i32) - (let (v95 i32) (const.i32 3)) - (let (v96 i32) (band v94 v95)) - (let (v98 i32) (bor v96 v97)) - (let (v99 u32) (cast v93)) - (let (v100 u32) (mod.unchecked v99 2)) - (assertz v100) - (let (v101 (ptr i32)) (inttoptr v99)) - (store v101 v98) - (let (v103 u32) (cast v102)) - (let (v104 u32) (add.checked v103 4)) - (let (v105 u32) (mod.unchecked v104 2)) - (assertz v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (let (v107 i32) (load v106)) - (let (v108 u32) (cast v102)) - (let (v109 u32) (mod.unchecked v108 2)) - (assertz v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (br (block 11 v102 v107 v111 v132 v145 v175 v189 v201))) + (let (v46 i32) (const.i32 0)) + (let (v47 u32) (cast 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 (v56 i32) (const.i32 2)) - (let (v57 i32) (band v52 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 15) (block 16))) + (let (v45 i32) (const.i32 0)) + (br (block 11 v29 v43 v41 v45 v156 v187 v202 v215))) (block 14 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (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 (v61 u32) (cast v54)) - (let (v62 u32) (add.checked v61 4)) - (let (v63 u32) (mod.unchecked v62 2)) - (assertz v63) - (let (v64 (ptr i32)) (inttoptr v62)) - (let (v65 i32) (load v64)) - (let (v66 i32) (const.i32 3)) - (let (v67 i32) (band v65 v66)) - (let (v68 i32) (bor v67 v44)) - (let (v69 u32) (cast v54)) - (let (v70 u32) (add.checked v69 4)) - (let (v71 u32) (mod.unchecked v70 2)) - (assertz v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (store v72 v68) - (let (v73 u32) (cast v37)) - (let (v74 u32) (mod.unchecked v73 2)) - (assertz v74) - (let (v75 (ptr i32)) (inttoptr v73)) - (let (v76 i32) (load v75)) - (let (v77 u32) (cast v37)) + (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) (cast v61)) + (let (v69 u32) (add.checked v68 4)) + (let (v70 u32) (mod.unchecked v69 2)) + (assertz 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) (cast v61)) (let (v78 u32) (add.checked v77 4)) (let (v79 u32) (mod.unchecked v78 2)) (assertz v79) (let (v80 (ptr i32)) (inttoptr v78)) - (let (v81 i32) (load v80)) - (let (v82 i32) (const.i32 -4)) - (let (v83 i32) (band v81 v82)) - (let (v84 i1) (eq v83 0)) - (let (v85 i32) (zext v84)) - (let (v86 i1) (neq v85 0)) - (condbr v86 (block 11 v37 v81 v76 v44 v144 v174 v188 v200) (block 17))) - - (block 16 - (br (block 12 v44 v48 v54 v37 v44 v144 v174 v188 v200))) + (store v80 v76) + (let (v81 u32) (cast v55)) + (let (v82 u32) (add.checked v81 4)) + (let (v83 u32) (mod.unchecked v82 2)) + (assertz 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) (cast v55)) + (let (v89 u32) (mod.unchecked v88 2)) + (assertz 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 - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v76 v87)) - (let (v89 u32) (cast v83)) - (let (v90 u32) (mod.unchecked v89 2)) - (assertz v90) - (let (v91 (ptr i32)) (inttoptr v89)) - (let (v92 i32) (load v91)) - (br (block 12 v83 v92 v88 v37 v44 v144 v174 v188 v200))) + (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) (cast v119)) + (let (v126 u32) (add.checked v125 4)) + (let (v127 u32) (mod.unchecked v126 2)) + (assertz 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) (cast v119)) + (let (v133 u32) (mod.unchecked v132 2)) + (assertz 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 - (param v142 i32) - (param v146 i32) - (param v172 i32) - (param v186 i32) - (param v198 i32) - (let (v147 u32) (cast v142)) - (let (v148 u32) (mod.unchecked v147 2)) - (assertz v148) - (let (v149 (ptr i32)) (inttoptr v147)) - (store v149 v146) - (let (v150 i32) (const.i32 8)) - (let (v151 i32) (add.wrapping v146 v150)) - (let (v152 u32) (cast v146)) - (let (v153 u32) (add.checked v152 8)) - (let (v154 u32) (mod.unchecked v153 2)) - (assertz v154) - (let (v155 (ptr i32)) (inttoptr v153)) - (let (v156 i32) (load v155)) - (let (v157 i32) (const.i32 1)) - (let (v158 i32) (band v156 v157)) - (let (v159 i1) (neq v158 0)) - (condbr v159 (block 9 v151 v156 v146 v142 v172 v186 v198) (block 20))) + (let (v96 u32) (cast v92)) + (let (v97 u32) (mod.unchecked v96 2)) + (assertz 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) (cast v92)) + (let (v107 u32) (mod.unchecked v106 2)) + (assertz v107) + (let (v108 (ptr i32)) (inttoptr v106)) + (store v108 v105) + (let (v110 u32) (cast v109)) + (let (v111 u32) (add.checked v110 4)) + (let (v112 u32) (mod.unchecked v111 2)) + (assertz v112) + (let (v113 (ptr i32)) (inttoptr v111)) + (let (v114 i32) (load v113)) + (let (v115 u32) (cast v109)) + (let (v116 u32) (mod.unchecked v115 2)) + (assertz 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 - (let (v133 u32) (cast v131)) - (let (v134 u32) (mod.unchecked v133 2)) - (assertz v134) - (let (v135 (ptr i32)) (inttoptr v133)) - (let (v136 i32) (load v135)) - (let (v137 i32) (const.i32 2)) - (let (v138 i32) (bor v136 v137)) - (let (v139 u32) (cast v131)) - (let (v140 u32) (mod.unchecked v139 2)) - (assertz v140) - (let (v141 (ptr i32)) (inttoptr v139)) - (store v141 v138) - (br (block 18 v143 v131 v173 v187 v199))) + (param v152 i32) + (param v157 i32) + (param v183 i32) + (param v198 i32) + (param v211 i32) + (let (v158 u32) (cast v152)) + (let (v159 u32) (mod.unchecked v158 2)) + (assertz v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v161 u32) (cast v157)) + (let (v162 u32) (add.checked v161 8)) + (let (v163 u32) (mod.unchecked v162 2)) + (assertz 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 - (br (block 10))) + (let (v143 u32) (cast v140)) + (let (v144 u32) (mod.unchecked v143 2)) + (assertz 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) (cast v140)) + (let (v150 u32) (mod.unchecked v149 2)) + (assertz v150) + (let (v151 (ptr i32)) (inttoptr v149)) + (store v151 v148) + (br (block 19 v153 v140 v184 v199 v212))) (block 21 - (param v321 i32) - (param v322 i32) - (param v327 i32) - (param v328 i32) - (param v329 i32) - (let (v323 u32) (cast v321)) - (let (v324 u32) (mod.unchecked v323 2)) - (assertz v324) - (let (v325 (ptr i32)) (inttoptr v323)) - (store v325 v322) - (let (v326 i1) (neq v322 0)) - (condbr v326 (block 4 v322 v321 v327 v328 v329) (block 32))) + (br (block 10))) (block 22 - (let (v181 i32) (const.i32 72)) - (let (v182 i32) (add.wrapping v168 v181)) - (let (v183 i32) (sub.wrapping v167 v170)) - (let (v190 i32) (band v183 v184)) - (let (v191 u32) (bitcast v182)) - (let (v192 u32) (bitcast v190)) - (let (v193 i1) (lte v191 v192)) - (let (v194 i32) (sext v193)) - (let (v195 i1) (neq v194 0)) - (condbr v195 (block 24) (block 25))) - - (block 23 (param v312 i32) (param v313 i32) - (let (v314 i32) (const.i32 1)) - (let (v315 i32) (bor v313 v314)) - (let (v316 u32) (cast v312)) - (let (v317 u32) (mod.unchecked v316 2)) - (assertz v317) - (let (v318 (ptr i32)) (inttoptr v316)) - (store v318 v315) - (let (v319 i32) (const.i32 8)) - (let (v320 i32) (add.wrapping v312 v319)) - (ret v320)) - - (block 24 - (let (v215 i32) (const.i32 0)) - (let (v216 i32) (const.i32 0)) - (let (v217 u32) (cast v190)) - (let (v218 u32) (mod.unchecked v217 2)) - (assertz v218) - (let (v219 (ptr i32)) (inttoptr v217)) - (store v219 v216) - (let (v220 i32) (const.i32 -8)) - (let (v221 i32) (add.wrapping v190 v220)) - (let (v222 i64) (const.i64 0)) - (let (v223 u32) (cast v221)) - (let (v224 u32) (mod.unchecked v223 2)) - (assertz v224) - (let (v225 (ptr i64)) (inttoptr v223)) - (store v225 v222) - (let (v226 u32) (cast v161)) - (let (v227 u32) (mod.unchecked v226 2)) - (assertz v227) - (let (v228 (ptr i32)) (inttoptr v226)) - (let (v229 i32) (load v228)) - (let (v230 i32) (const.i32 -4)) - (let (v231 i32) (band v229 v230)) - (let (v232 u32) (cast v221)) - (let (v233 u32) (mod.unchecked v232 2)) - (assertz v233) - (let (v234 (ptr i32)) (inttoptr v232)) - (store v234 v231) - (let (v235 u32) (cast v161)) - (let (v236 u32) (mod.unchecked v235 2)) - (assertz v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 i32) (const.i32 -4)) - (let (v240 i32) (band v238 v239)) - (let (v241 i1) (eq v240 0)) - (let (v242 i32) (zext v241)) - (let (v243 i1) (neq v242 0)) - (condbr v243 (block 27 v221 v215 v161 v168) (block 28))) + (param v335 i32) + (param v336 i32) + (param v341 i32) + (param v342 i32) + (param v343 i32) + (let (v337 u32) (cast v335)) + (let (v338 u32) (mod.unchecked v337 2)) + (assertz 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) (cast v326)) + (let (v331 u32) (mod.unchecked v330 2)) + (assertz 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 (v202 i32) (band v196 v168)) - (let (v203 i1) (neq v202 0)) - (condbr v203 (block 21 v204 v205 v170 v184 v196) (block 26))) + (let (v229 i32) (const.i32 0)) + (let (v230 i32) (const.i32 0)) + (let (v231 u32) (cast v203)) + (let (v232 u32) (mod.unchecked v231 2)) + (assertz 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) (cast v235)) + (let (v238 u32) (mod.unchecked v237 2)) + (assertz v238) + (let (v239 (ptr i64)) (inttoptr v237)) + (store v239 v236) + (let (v240 u32) (cast v172)) + (let (v241 u32) (mod.unchecked v240 2)) + (assertz 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) (cast v235)) + (let (v247 u32) (mod.unchecked v246 2)) + (assertz v247) + (let (v248 (ptr i32)) (inttoptr v246)) + (store v248 v245) + (let (v249 u32) (cast v172)) + (let (v250 u32) (mod.unchecked v249 2)) + (assertz 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 (v206 i32) (const.i32 -4)) - (let (v207 i32) (band v205 v206)) - (let (v208 u32) (cast v204)) - (let (v209 u32) (mod.unchecked v208 2)) - (assertz v209) - (let (v210 (ptr i32)) (inttoptr v208)) - (store v210 v207) - (let (v211 u32) (cast v161)) - (let (v212 u32) (mod.unchecked v211 2)) - (assertz v212) - (let (v213 (ptr i32)) (inttoptr v211)) - (let (v214 i32) (load v213)) - (br (block 23 v161 v214))) + (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 - (param v266 i32) - (param v267 i32) - (param v268 i32) - (param v274 i32) - (let (v269 i32) (bor v267 v268)) - (let (v270 u32) (cast v266)) - (let (v271 u32) (add.checked v270 4)) - (let (v272 u32) (mod.unchecked v271 2)) - (assertz v272) - (let (v273 (ptr i32)) (inttoptr v271)) - (store v273 v269) - (let (v275 u32) (cast v274)) - (let (v276 u32) (mod.unchecked v275 2)) - (assertz v276) - (let (v277 (ptr i32)) (inttoptr v275)) - (let (v278 i32) (load v277)) - (let (v279 i32) (const.i32 -2)) - (let (v280 i32) (band v278 v279)) - (let (v281 u32) (cast v274)) - (let (v282 u32) (mod.unchecked v281 2)) - (assertz v282) - (let (v283 (ptr i32)) (inttoptr v281)) - (store v283 v280) - (let (v284 u32) (cast v268)) - (let (v285 u32) (mod.unchecked v284 2)) - (assertz v285) - (let (v286 (ptr i32)) (inttoptr v284)) - (let (v287 i32) (load v286)) - (let (v288 i32) (const.i32 3)) - (let (v289 i32) (band v287 v288)) - (let (v290 i32) (bor v289 v266)) - (let (v291 u32) (cast v268)) - (let (v292 u32) (mod.unchecked v291 2)) - (assertz v292) - (let (v293 (ptr i32)) (inttoptr v291)) - (store v293 v290) - (let (v294 i32) (const.i32 2)) - (let (v295 i32) (band v287 v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 30) (block 31))) + (let (v220 i32) (const.i32 -4)) + (let (v221 i32) (band v219 v220)) + (let (v222 u32) (cast v218)) + (let (v223 u32) (mod.unchecked v222 2)) + (assertz v223) + (let (v224 (ptr i32)) (inttoptr v222)) + (store v224 v221) + (let (v225 u32) (cast v172)) + (let (v226 u32) (mod.unchecked v225 2)) + (assertz v226) + (let (v227 (ptr i32)) (inttoptr v225)) + (let (v228 i32) (load v227)) + (br (block 24 v172 v228))) (block 28 - (let (v244 i32) (const.i32 2)) - (let (v245 i32) (band v238 v244)) - (let (v246 i1) (neq v245 0)) - (condbr v246 (block 27 v221 v215 v161 v168) (block 29))) + (param v280 i32) + (param v281 i32) + (param v282 i32) + (param v288 i32) + (let (v283 i32) (bor v281 v282)) + (let (v284 u32) (cast v280)) + (let (v285 u32) (add.checked v284 4)) + (let (v286 u32) (mod.unchecked v285 2)) + (assertz v286) + (let (v287 (ptr i32)) (inttoptr v285)) + (store v287 v283) + (let (v289 u32) (cast v288)) + (let (v290 u32) (mod.unchecked v289 2)) + (assertz 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) (cast v288)) + (let (v296 u32) (mod.unchecked v295 2)) + (assertz v296) + (let (v297 (ptr i32)) (inttoptr v295)) + (store v297 v294) + (let (v298 u32) (cast v282)) + (let (v299 u32) (mod.unchecked v298 2)) + (assertz 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) (cast v282)) + (let (v306 u32) (mod.unchecked v305 2)) + (assertz 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 (v247 u32) (cast v240)) - (let (v248 u32) (add.checked v247 4)) - (let (v249 u32) (mod.unchecked v248 2)) - (assertz v249) - (let (v250 (ptr i32)) (inttoptr v248)) - (let (v251 i32) (load v250)) - (let (v252 i32) (const.i32 3)) - (let (v253 i32) (band v251 v252)) - (let (v254 i32) (bor v253 v221)) - (let (v255 u32) (cast v240)) - (let (v256 u32) (add.checked v255 4)) - (let (v257 u32) (mod.unchecked v256 2)) - (assertz v257) - (let (v258 (ptr i32)) (inttoptr v256)) - (store v258 v254) - (let (v259 u32) (cast v221)) - (let (v260 u32) (add.checked v259 4)) - (let (v261 u32) (mod.unchecked v260 2)) - (assertz v261) - (let (v262 (ptr i32)) (inttoptr v260)) - (let (v263 i32) (load v262)) - (let (v264 i32) (const.i32 3)) - (let (v265 i32) (band v263 v264)) - (br (block 27 v221 v265 v161 v168))) + (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 (v301 i32) (const.i32 -3)) - (let (v302 i32) (band v290 v301)) - (let (v303 u32) (cast v268)) - (let (v304 u32) (mod.unchecked v303 2)) - (assertz v304) - (let (v305 (ptr i32)) (inttoptr v303)) - (store v305 v302) - (let (v306 u32) (cast v266)) - (let (v307 u32) (mod.unchecked v306 2)) - (assertz v307) - (let (v308 (ptr i32)) (inttoptr v306)) - (let (v309 i32) (load v308)) - (let (v310 i32) (const.i32 2)) - (let (v311 i32) (bor v309 v310)) - (br (block 23 v266 v311))) + (let (v261 u32) (cast v254)) + (let (v262 u32) (add.checked v261 4)) + (let (v263 u32) (mod.unchecked v262 2)) + (assertz 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) (cast v254)) + (let (v270 u32) (add.checked v269 4)) + (let (v271 u32) (mod.unchecked v270 2)) + (assertz v271) + (let (v272 (ptr i32)) (inttoptr v270)) + (store v272 v268) + (let (v273 u32) (cast v235)) + (let (v274 u32) (add.checked v273 4)) + (let (v275 u32) (mod.unchecked v274 2)) + (assertz 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 (v297 u32) (cast v266)) - (let (v298 u32) (mod.unchecked v297 2)) - (assertz v298) - (let (v299 (ptr i32)) (inttoptr v297)) - (let (v300 i32) (load v299)) - (br (block 23 v266 v300))) + (let (v315 i32) (const.i32 -3)) + (let (v316 i32) (band v304 v315)) + (let (v317 u32) (cast v282)) + (let (v318 u32) (mod.unchecked v317 2)) + (assertz v318) + (let (v319 (ptr i32)) (inttoptr v317)) + (store v319 v316) + (let (v320 u32) (cast v280)) + (let (v321 u32) (mod.unchecked v320 2)) + (assertz 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) (cast v280)) + (let (v312 u32) (mod.unchecked v311 2)) + (assertz v312) + (let (v313 (ptr i32)) (inttoptr v311)) + (let (v314 i32) (load v313)) + (br (block 24 v280 v314))) + + (block 33 (br (block 5))) ) @@ -1148,73 +1248,14 @@ (br (block 7 v175 v185))) ) - (func (export #wit_bindgen::rt::run_ctors_once) - (block 0 - (let (v0 i32) (const.i32 0)) - (let (v1 u32) (cast v0)) - (let (v2 u32) (add.checked v1 1048581)) - (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 u8) (trunc v8)) - (let (v10 u32) (cast v7)) - (let (v11 u32) (add.checked v10 1048581)) - (let (v12 (ptr u8)) (inttoptr v11)) - (store v12 v9) - (br (block 2))) - ) - (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 i1) (neq v1 0)) - (condbr v5 (block 4) (block 5))) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) + (br (block 1 v5))) (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) (cast v9)) - (let (v11 u32) (add.checked v10 1048580)) - (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)) ) ;; Imports 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 index de2b7eef3..3a78deda2 100644 --- 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 @@ -67,23 +67,57 @@ (import "miden:base/note@1.0.0" "get-assets" (func $basic_wallet_p2id_note::bindings::miden::base::note::get_assets::wit_import (;3;) (type 0))) (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 3))) (func $__wasm_call_ctors (;5;) (type 4)) - (func $miden:base/note-script@1.0.0#note-script (;6;) (type 4) + (func $__rust_alloc (;6;) (type 5) (param i32 i32) (result i32) + i32.const 1048580 + local.get 1 + local.get 0 + call $::alloc + ) + (func $__rust_realloc (;7;) (type 6) (param i32 i32 i32 i32) (result i32) + (local i32) + block ;; label = @1 + i32.const 1048580 + 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 1048580 + 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 (;8;) (type 4) (local i32 i32 i32 i32 i32 i32 i32) global.get $__stack_pointer i32.const 16 i32.sub local.tee 0 global.set $__stack_pointer - call $wit_bindgen::rt::run_ctors_once + call $wit_bindgen_rt::run_ctors_once + local.get 0 + i64.const 0 + i64.store offset=8 local.get 0 i32.const 8 i32.add call $basic_wallet_p2id_note::bindings::miden::base::note::get_inputs::wit_import block ;; label = @1 local.get 0 - i32.const 12 - i32.add - i32.load + i32.load offset=12 local.tee 1 i32.eqz br_if 0 (;@1;) @@ -96,14 +130,15 @@ i64.ne br_if 0 (;@1;) local.get 0 + i64.const 0 + i64.store offset=8 + local.get 0 i32.const 8 i32.add call $basic_wallet_p2id_note::bindings::miden::base::note::get_assets::wit_import block ;; label = @2 local.get 0 - i32.const 12 - i32.add - i32.load + i32.load offset=12 local.tee 3 i32.eqz br_if 0 (;@2;) @@ -135,7 +170,7 @@ i32.ne br_if 0 (;@3;) end - i32.const 1048576 + i32.const 1048580 local.get 4 i32.const 8 local.get 3 @@ -143,7 +178,7 @@ i32.shl call $::dealloc end - i32.const 1048576 + i32.const 1048580 local.get 2 i32.const 8 local.get 1 @@ -159,342 +194,355 @@ unreachable unreachable ) - (func $__rust_alloc (;7;) (type 5) (param i32 i32) (result i32) - i32.const 1048576 - local.get 1 - local.get 0 - call $::alloc - ) - (func $__rust_realloc (;8;) (type 6) (param i32 i32 i32 i32) (result i32) - (local i32) + (func $wit_bindgen_rt::cabi_realloc (;9;) (type 6) (param i32 i32 i32 i32) (result i32) block ;; label = @1 - i32.const 1048576 + 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=1048584 + 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 - 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 1048576 - local.get 0 - local.get 2 - local.get 1 - call $::dealloc + unreachable + unreachable + end + local.get 2 + ) + (func $wit_bindgen_rt::run_ctors_once (;10;) (type 4) + block ;; label = @1 + i32.const 0 + i32.load8_u offset=1048585 + br_if 0 (;@1;) + call $__wasm_call_ctors + i32.const 0 + i32.const 1 + i32.store8 offset=1048585 end - local.get 4 ) - (func $wee_alloc::alloc_first_fit (;9;) (type 7) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32) + (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 - i32.eqz br_if 0 (;@1;) - 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 = @2 - local.get 3 - i32.const 8 - i32.add - local.set 7 + 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 - local.get 3 - i32.load offset=8 - local.tee 0 + 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 - br_if 0 (;@4;) - local.get 3 - local.set 1 - br 1 (;@3;) + select + local.set 8 end - loop ;; label = @4 - local.get 7 - local.get 0 - i32.const -2 - i32.and - i32.store + block ;; label = @4 local.get 3 - i32.load offset=4 + i32.load + local.tee 1 i32.const -4 i32.and - local.tee 1 - i32.load - local.set 7 - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.load - local.tee 8 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - block ;; label = @7 - local.get 8 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - local.get 0 - local.get 0 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 0 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 1 (;@5;) - local.get 0 - i32.const -4 - i32.and - local.set 0 - local.get 8 - i32.load - local.set 7 - end - local.get 8 - local.get 7 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 0 - end - local.get 3 - local.get 7 + 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 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@5;) - local.get 1 - local.get 1 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 local.get 1 + i32.const -4 + i32.and + i32.or i32.store - local.get 1 - i32.const 8 - i32.add + 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 - local.set 3 - local.get 1 - i32.load offset=8 - local.tee 0 - i32.const 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 - local.tee 3 - local.get 7 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@3;) + i32.store block ;; label = @4 - block ;; label = @5 - local.get 7 - i32.const 72 - i32.add - local.get 3 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 3 - i32.le_u - br_if 0 (;@5;) - local.get 4 - local.get 7 - i32.and - br_if 2 (;@3;) - local.get 2 - local.get 0 - i32.const -4 - i32.and - i32.store - local.get 1 - i32.load - local.set 0 - local.get 1 - local.set 3 - br 1 (;@4;) - end - i32.const 0 - local.set 0 - local.get 3 - i32.const 0 - i32.store local.get 3 - i32.const -8 - i32.add - local.tee 3 - i64.const 0 - i64.store align=4 - local.get 3 - local.get 1 i32.load + local.tee 9 i32.const -4 i32.and - i32.store - block ;; label = @5 - local.get 1 - i32.load - local.tee 2 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 2 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 3 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - i32.const 3 - i32.and - local.set 0 - end - local.get 3 - local.get 0 - local.get 1 - i32.or - i32.store offset=4 - local.get 7 - local.get 7 - i32.load - i32.const -2 + local.tee 8 + i32.eqz + br_if 0 (;@4;) + local.get 9 + i32.const 2 i32.and - i32.store - local.get 1 - local.get 1 - i32.load - local.tee 0 + br_if 0 (;@4;) + local.get 8 + local.get 8 + i32.load offset=4 i32.const 3 i32.and - local.get 3 + local.get 1 i32.or - local.tee 7 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 3 - i32.load - local.set 0 - br 1 (;@4;) - end + i32.store offset=4 local.get 1 - local.get 7 - i32.const -3 + i32.load offset=4 + i32.const 3 i32.and - i32.store - local.get 3 - i32.load - i32.const 2 - i32.or - local.set 0 + local.set 7 end + local.get 1 + local.get 7 local.get 3 + i32.or + i32.store offset=4 local.get 0 - i32.const 1 + 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 - i32.const 8 - i32.add - return + 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 2 + local.get 1 local.get 0 + i32.const 1 + i32.or i32.store - local.get 0 - local.set 3 - local.get 0 - br_if 0 (;@2;) + 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 (;10;) (type 7) (param i32 i32 i32) (result i32) + (func $::alloc (;12;) (type 7) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -598,7 +646,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;11;) (type 8) (param i32 i32 i32 i32) + (func $::dealloc (;13;) (type 8) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -771,55 +819,22 @@ i32.store end ) - (func $wit_bindgen::rt::run_ctors_once (;12;) (type 4) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048581 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048581 - end - ) - (func $cabi_realloc (;13;) (type 6) (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=1048580 - 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 + (func $cabi_realloc (;14;) (type 6) (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;) 1 1 funcref) + (table (;0;) 2 2 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 $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") ) (core module (;1;) (type (;0;) (func (param i32))) diff --git a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat b/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat index 8b7f2843c..5514a0e6a 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat @@ -1,38 +1,24 @@ (component (core module (;0;) (type (;0;) (func)) - (type (;1;) (func (param i64) (result i64))) - (type (;2;) (func (param i64 i64 i64 i64) (result i32))) - (type (;3;) (func (param i32 i64 i64 i64 i64) (result i32))) - (type (;4;) (func (param i32 i32) (result i32))) - (type (;5;) (func (param i32 i32 i32 i32) (result i32))) + (type (;1;) (func (param i32 i32) (result i32))) + (type (;2;) (func (param i32 i32 i32 i32) (result i32))) + (type (;3;) (func (param i64) (result i64))) + (type (;4;) (func (param i64 i64 i64 i64) (result i32))) + (type (;5;) (func (param i32 i64 i64 i64 i64) (result i32))) (type (;6;) (func (param i32 i32 i32) (result i32))) (type (;7;) (func (param i32 i32 i32 i32))) (func $__wasm_call_ctors (;0;) (type 0)) - (func $miden:base/core-types@1.0.0#account-id-from-felt (;1;) (type 1) (param i64) (result i64) - call $wit_bindgen::rt::run_ctors_once - local.get 0 - ) - (func $miden:base/types@1.0.0#from-core-asset (;2;) (type 2) (param i64 i64 i64 i64) (result i32) - call $wit_bindgen::rt::run_ctors_once - unreachable - unreachable - ) - (func $miden:base/types@1.0.0#to-core-asset (;3;) (type 3) (param i32 i64 i64 i64 i64) (result i32) - call $wit_bindgen::rt::run_ctors_once - unreachable - unreachable - ) - (func $__rust_alloc (;4;) (type 4) (param i32 i32) (result i32) - i32.const 1048576 + (func $__rust_alloc (;1;) (type 1) (param i32 i32) (result i32) + i32.const 1048580 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;5;) (type 5) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;2;) (type 2) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048576 + i32.const 1048580 local.get 2 local.get 3 call $::alloc @@ -48,7 +34,7 @@ i32.lt_u select memory.copy - i32.const 1048576 + i32.const 1048580 local.get 0 local.get 2 local.get 1 @@ -56,309 +42,369 @@ end local.get 4 ) - (func $wee_alloc::alloc_first_fit (;6;) (type 6) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32) + (func $miden:base/core-types@1.0.0#account-id-from-felt (;3;) (type 3) (param i64) (result i64) + call $wit_bindgen_rt::run_ctors_once + local.get 0 + ) + (func $miden:base/types@1.0.0#from-core-asset (;4;) (type 4) (param i64 i64 i64 i64) (result i32) + call $wit_bindgen_rt::run_ctors_once + unreachable + unreachable + ) + (func $miden:base/types@1.0.0#to-core-asset (;5;) (type 5) (param i32 i64 i64 i64 i64) (result i32) + call $wit_bindgen_rt::run_ctors_once + unreachable + unreachable + ) + (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=1048584 + 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 $wit_bindgen_rt::run_ctors_once (;7;) (type 0) + block ;; label = @1 + i32.const 0 + i32.load8_u offset=1048585 + br_if 0 (;@1;) + call $__wasm_call_ctors + i32.const 0 + i32.const 1 + i32.store8 offset=1048585 + end + ) + (func $wee_alloc::alloc_first_fit (;8;) (type 6) (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 - i32.eqz br_if 0 (;@1;) - 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 = @2 - local.get 3 - i32.const 8 - i32.add - local.set 7 + 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 - local.get 3 - i32.load offset=8 - local.tee 0 + 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 - br_if 0 (;@4;) - local.get 3 - local.set 1 - br 1 (;@3;) + select + local.set 8 end - loop ;; label = @4 - local.get 7 - local.get 0 - i32.const -2 - i32.and - i32.store + block ;; label = @4 local.get 3 - i32.load offset=4 + i32.load + local.tee 1 i32.const -4 i32.and - local.tee 1 - i32.load - local.set 7 - block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.load - local.tee 8 - i32.const -4 - i32.and - local.tee 0 - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - block ;; label = @7 - local.get 8 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@7;) - local.get 1 - local.set 8 - br 1 (;@6;) - end - local.get 0 - local.get 0 - i32.load offset=4 - i32.const 3 - i32.and - local.get 1 - i32.or - i32.store offset=4 - local.get 3 - i32.load - local.set 0 - local.get 3 - i32.load offset=4 - local.tee 7 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 1 (;@5;) - local.get 0 - i32.const -4 - i32.and - local.set 0 - local.get 8 - i32.load - local.set 7 - end - local.get 8 - local.get 7 - i32.const 3 - i32.and - local.get 0 - i32.or - i32.store - local.get 3 - i32.load offset=4 - local.set 7 - local.get 3 - i32.load - local.set 0 - end - local.get 3 - local.get 7 + 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 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - i32.eqz - br_if 0 (;@5;) - local.get 1 - local.get 1 - i32.load - i32.const 2 - i32.or - i32.store - end - local.get 2 local.get 1 + i32.const -4 + i32.and + i32.or i32.store - local.get 1 - i32.const 8 - i32.add + 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 - local.set 3 - local.get 1 - i32.load offset=8 - local.tee 0 - i32.const 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 - local.tee 3 - local.get 7 - i32.sub - local.get 6 - i32.lt_u - br_if 0 (;@3;) + i32.store block ;; label = @4 - block ;; label = @5 - local.get 7 - i32.const 72 - i32.add - local.get 3 - local.get 6 - i32.sub - local.get 5 - i32.and - local.tee 3 - i32.le_u - br_if 0 (;@5;) - local.get 4 - local.get 7 - i32.and - br_if 2 (;@3;) - local.get 2 - local.get 0 - i32.const -4 - i32.and - i32.store - local.get 1 - i32.load - local.set 0 - local.get 1 - local.set 3 - br 1 (;@4;) - end - i32.const 0 - local.set 0 - local.get 3 - i32.const 0 - i32.store local.get 3 - i32.const -8 - i32.add - local.tee 3 - i64.const 0 - i64.store align=4 - local.get 3 - local.get 1 i32.load + local.tee 9 i32.const -4 i32.and - i32.store - block ;; label = @5 - local.get 1 - i32.load - local.tee 2 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@5;) - local.get 2 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 8 - local.get 8 - i32.load offset=4 - i32.const 3 - i32.and - local.get 3 - i32.or - i32.store offset=4 - local.get 3 - i32.load offset=4 - i32.const 3 - i32.and - local.set 0 - end - local.get 3 - local.get 0 - local.get 1 - i32.or - i32.store offset=4 - local.get 7 - local.get 7 - i32.load - i32.const -2 + local.tee 8 + i32.eqz + br_if 0 (;@4;) + local.get 9 + i32.const 2 i32.and - i32.store - local.get 1 - local.get 1 - i32.load - local.tee 0 + br_if 0 (;@4;) + local.get 8 + local.get 8 + i32.load offset=4 i32.const 3 i32.and - local.get 3 + local.get 1 i32.or - local.tee 7 - i32.store - block ;; label = @5 - local.get 0 - i32.const 2 - i32.and - br_if 0 (;@5;) - local.get 3 - i32.load - local.set 0 - br 1 (;@4;) - end + i32.store offset=4 local.get 1 - local.get 7 - i32.const -3 + i32.load offset=4 + i32.const 3 i32.and - i32.store - local.get 3 - i32.load - i32.const 2 - i32.or - local.set 0 + local.set 7 end + local.get 1 + local.get 7 local.get 3 + i32.or + i32.store offset=4 local.get 0 - i32.const 1 + 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 - i32.const 8 - i32.add - return + 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 2 + local.get 1 local.get 0 + i32.const 1 + i32.or i32.store - local.get 0 - local.set 3 - local.get 0 - br_if 0 (;@2;) + 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 (;7;) (type 6) (param i32 i32 i32) (result i32) + (func $::alloc (;9;) (type 6) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -462,7 +508,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;8;) (type 7) (param i32 i32 i32 i32) + (func $::dealloc (;10;) (type 7) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -635,50 +681,14 @@ i32.store end ) - (func $wit_bindgen::rt::run_ctors_once (;9;) (type 0) - block ;; label = @1 - i32.const 0 - i32.load8_u offset=1048581 - br_if 0 (;@1;) - call $__wasm_call_ctors - i32.const 0 - i32.const 1 - i32.store8 offset=1048581 - end - ) - (func $cabi_realloc (;10;) (type 5) (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=1048580 - 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 + (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;) 1 1 funcref) + (table (;0;) 2 2 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) @@ -686,6 +696,9 @@ (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 $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") ) (core instance (;0;) (instantiate 0)) (alias core export 0 "memory" (core memory (;0;))) diff --git a/tests/integration/src/cargo_proj/mod.rs b/tests/integration/src/cargo_proj/mod.rs index 31561b0c9..2c8a4bcb8 100644 --- a/tests/integration/src/cargo_proj/mod.rs +++ b/tests/integration/src/cargo_proj/mod.rs @@ -465,9 +465,6 @@ pub fn is_nightly() -> bool { /// Returns `true` if the local filesystem has low-resolution mtimes. pub fn is_coarse_mtime() -> bool { - // If the filetime crate is being used to emulate HFS then - // return `true`, without looking at the actual hardware. - cfg!(emulate_second_only_system) || // This should actually be a test that `$CARGO_TARGET_DIR` is on an HFS // filesystem, (or any filesystem with low-resolution mtimes). However, // that's tricky to detect, so for now just deal with CI. diff --git a/tests/integration/src/rust_masm_tests/components.rs b/tests/integration/src/rust_masm_tests/components.rs index 17f4db4a2..00d3ea459 100644 --- a/tests/integration/src/rust_masm_tests/components.rs +++ b/tests/integration/src/rust_masm_tests/components.rs @@ -20,7 +20,7 @@ fn wcm_no_imports() { authors = [] [dependencies] - wit-bindgen = { version = "0.17.0", default-features = false, features = ["realloc"] } + wit-bindgen-rt = "0.28" wee_alloc = { version = "0.4.5", default-features = false} [lib] @@ -46,7 +46,7 @@ fn wcm_no_imports() { loop {} } - extern crate wit_bindgen; + bindings::export!(Component with_types_in bindings); mod bindings; @@ -136,7 +136,7 @@ fn wcm_import() { authors = [] [dependencies] - wit-bindgen = { version = "0.17.0", default-features = false, features = ["realloc"] } + wit-bindgen-rt = "0.28" wee_alloc = { version = "0.4.5", default-features = false} [lib] @@ -165,7 +165,7 @@ fn wcm_import() { loop {} } - extern crate wit_bindgen; + bindings::export!(Component with_types_in bindings); mod bindings; diff --git a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock index 1c0deedb8..076215714 100644 --- a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock +++ b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock @@ -22,7 +22,7 @@ checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" [[package]] name = "miden-sdk" -version = "0.0.0" +version = "0.0.1" dependencies = [ "miden-stdlib-sys", "miden-tx-kernel-sys", @@ -38,11 +38,11 @@ dependencies = [ [[package]] name = "miden-stdlib-sys" -version = "0.0.0" +version = "0.0.1" [[package]] name = "miden-tx-kernel-sys" -version = "0.0.0" +version = "0.0.1" dependencies = [ "miden-stdlib-sys", ] diff --git a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock b/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock index dcc218715..e48ef9474 100644 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock +++ b/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.lock @@ -7,15 +7,9 @@ name = "basic-wallet" version = "0.0.0" dependencies = [ "wee_alloc", - "wit-bindgen", + "wit-bindgen-rt", ] -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - [[package]] name = "cfg-if" version = "0.1.10" @@ -69,10 +63,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "wit-bindgen" -version = "0.17.0" +name = "wit-bindgen-rt" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6237168d93497b26dacdab157b08ad2787d74cdce10f89735f791b2a225eba4d" -dependencies = [ - "bitflags", -] +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 index 841a8b849..e0eac15b0 100644 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.toml +++ b/tests/rust-apps-wasm/wit-sdk/basic-wallet/Cargo.toml @@ -12,7 +12,7 @@ edition = "2021" publish = false [dependencies] -wit-bindgen = { version = "0.17.0", default-features = false, features = ["realloc"] } +wit-bindgen-rt = "0.28" wee_alloc = { version = "0.4.5", default-features = false} [lib] 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 index 7e2ed5fc4..9477639c2 100644 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/bindings.rs @@ -1,1051 +1,1240 @@ -// Generated by `wit-bindgen` 0.16.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! +// Options used: +#[allow(dead_code)] pub mod miden { - pub mod base { - - #[allow(clippy::all)] - pub mod core_types { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - /// 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() + #[allow(dead_code)] + pub mod base { + #[allow(dead_code, clippy::all)] + pub mod core_types { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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 }, + } + } + } } - } - /// 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(dead_code, clippy::all)] + pub mod account { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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(unused_unsafe, clippy::all)] - /// Creates a new account ID from a field element. - pub fn account_id_from_felt(felt: Felt,) -> AccountId{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner0)); - AccountId{ - inner: Felt{ - inner: ret as u64, - }, - } + + #[allow(dead_code, clippy::all)] + pub mod tx { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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(clippy::all)] - pub mod account { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-initial-hash"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-current-hash"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let super::super::super::miden::base::core_types::Felt{ inner:inner0, } = index; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-item"] - fn wit_import(_: i64, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner0), ptr1); - let l2 = *((ptr1 + 0) as *const i64); - let l3 = *((ptr1 + 8) as *const i64); - let l4 = *((ptr1 + 16) as *const i64); - let l5 = *((ptr1 + 24) as *const i64); - 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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 64]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - 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.as_mut_ptr() as i32; - #[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, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner0), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), wit_bindgen::rt::as_i64(inner6), ptr7); - let l8 = *((ptr7 + 0) as *const i64); - let l9 = *((ptr7 + 8) as *const i64); - let l10 = *((ptr7 + 16) as *const i64); - let l11 = *((ptr7 + 24) as *const i64); - let l12 = *((ptr7 + 32) as *const i64); - let l13 = *((ptr7 + 40) as *const i64); - let l14 = *((ptr7 + 48) as *const i64); - let l15 = *((ptr7 + 56) as *const i64); - (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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5)); - wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - 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.as_mut_ptr() as i32; - #[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, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), ptr6); - let l7 = *((ptr6 + 0) as *const i64); - let l8 = *((ptr6 + 8) as *const i64); - let l9 = *((ptr6 + 16) as *const i64); - let l10 = *((ptr6 + 24) as *const i64); - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - 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.as_mut_ptr() as i32; - #[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, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), ptr6); - let l7 = *((ptr6 + 0) as *const i64); - let l8 = *((ptr6 + 8) as *const i64); - let l9 = *((ptr6 + 16) as *const i64); - let l10 = *((ptr6 + 24) as *const i64); - 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(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)] + #[cfg(target_arch = "wasm32")] + 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) } - } - #[allow(unused_unsafe, clippy::all)] - /// Returns the commitment to the account vault. - pub fn get_vault_commitment() -> VaultCommitment{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-vault-commitment"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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, - }), - } + #[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) } - } - + };); } - - - #[allow(clippy::all)] - pub mod tx { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-block-hash"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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, - }), - } + #[doc(hidden)] + pub(crate) use __export_miden_basic_wallet_basic_wallet_1_0_0_cabi; + } } - } - #[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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[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(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - (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, - }) + } +} +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() } - } - #[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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[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(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - (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, - }) + } + + impl AsI64 for i64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 } - } - #[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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), wit_bindgen::rt::as_i64(inner7), wit_bindgen::rt::as_i64(inner10), wit_bindgen::rt::as_i64(inner11), wit_bindgen::rt::as_i64(inner12), wit_bindgen::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, - }, - } + } + + impl AsI64 for u64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 } - } - } - - } -} -pub mod exports { - pub mod miden { - pub mod basic_wallet { - - #[allow(clippy::all)] - pub mod basic_wallet { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_section; - 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; - const _: () = { - - #[doc(hidden)] - #[export_name = "miden:basic-wallet/basic-wallet@1.0.0#receive-asset"] - #[allow(non_snake_case)] - unsafe extern "C" fn __export_receive_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - // Before executing any other code, use this function to run all static - // constructors, if they have not yet been run. This is a hack required - // to work around wasi-libc ctors calling import functions to initialize - // the environment. - // - // This functionality will be removed once rust 1.69.0 is stable, at which - // point wasi-libc will no longer have this behavior. - // - // See - // https://github.com/bytecodealliance/preview2-prototyping/issues/99 - // for more details. - #[cfg(target_arch="wasm32")] - wit_bindgen::rt::run_ctors_once(); - - <_GuestImpl as Guest>::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, - }), - }); - } - }; - const _: () = { - - #[doc(hidden)] - #[export_name = "miden:basic-wallet/basic-wallet@1.0.0#send-asset"] - #[allow(non_snake_case)] - 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,) { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - // Before executing any other code, use this function to run all static - // constructors, if they have not yet been run. This is a hack required - // to work around wasi-libc ctors calling import functions to initialize - // the environment. - // - // This functionality will be removed once rust 1.69.0 is stable, at which - // point wasi-libc will no longer have this behavior. - // - // See - // https://github.com/bytecodealliance/preview2-prototyping/issues/99 - // for more details. - #[cfg(target_arch="wasm32")] - wit_bindgen::rt::run_ctors_once(); - - <_GuestImpl as Guest>::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, - }), - }); - } - }; - use super::super::super::super::super::Component as _GuestImpl; - pub trait Guest { - fn receive_asset(core_asset: CoreAsset,); - fn send_asset(core_asset: CoreAsset,tag: Tag,recipient: Recipient,); + 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:basic-wallet-world"] +#[link_section = "component-type:wit-bindgen:0.25.0:basic-wallet-world:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2717] = [3, 0, 18, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 45, 119, 111, 114, 108, 100, 0, 97, 115, 109, 13, 0, 1, 0, 7, 227, 4, 1, 65, 7, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 1, 66, 10, 2, 3, 2, 1, 1, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 3, 116, 97, 103, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 4, 1, 64, 1, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 1, 0, 4, 0, 13, 114, 101, 99, 101, 105, 118, 101, 45, 97, 115, 115, 101, 116, 1, 6, 1, 64, 3, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 3, 116, 97, 103, 3, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 5, 1, 0, 4, 0, 10, 115, 101, 110, 100, 45, 97, 115, 115, 101, 116, 1, 7, 4, 1, 37, 109, 105, 100, 101, 110, 58, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 47, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 64, 49, 46, 48, 46, 48, 5, 4, 11, 18, 1, 0, 12, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 3, 0, 0, 7, 143, 15, 1, 65, 2, 1, 65, 22, 1, 66, 30, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 1, 4, 102, 101, 108, 116, 1, 0, 5, 4, 0, 20, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 45, 102, 114, 111, 109, 45, 102, 101, 108, 116, 1, 28, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 1, 66, 47, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 1, 64, 0, 0, 9, 4, 0, 6, 103, 101, 116, 45, 105, 100, 1, 22, 1, 64, 0, 0, 11, 4, 0, 9, 103, 101, 116, 45, 110, 111, 110, 99, 101, 1, 23, 1, 64, 0, 0, 13, 4, 0, 16, 103, 101, 116, 45, 105, 110, 105, 116, 105, 97, 108, 45, 104, 97, 115, 104, 1, 24, 4, 0, 16, 103, 101, 116, 45, 99, 117, 114, 114, 101, 110, 116, 45, 104, 97, 115, 104, 1, 24, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 1, 0, 4, 0, 10, 105, 110, 99, 114, 45, 110, 111, 110, 99, 101, 1, 25, 1, 64, 1, 5, 105, 110, 100, 101, 120, 1, 0, 15, 4, 0, 8, 103, 101, 116, 45, 105, 116, 101, 109, 1, 26, 1, 111, 2, 17, 15, 1, 64, 2, 5, 105, 110, 100, 101, 120, 1, 5, 118, 97, 108, 117, 101, 15, 0, 27, 4, 0, 8, 115, 101, 116, 45, 105, 116, 101, 109, 1, 28, 1, 64, 1, 9, 99, 111, 100, 101, 45, 114, 111, 111, 116, 19, 1, 0, 4, 0, 8, 115, 101, 116, 45, 99, 111, 100, 101, 1, 29, 1, 64, 1, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 9, 0, 1, 4, 0, 11, 103, 101, 116, 45, 98, 97, 108, 97, 110, 99, 101, 1, 30, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 127, 4, 0, 22, 104, 97, 115, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 31, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 3, 4, 0, 9, 97, 100, 100, 45, 97, 115, 115, 101, 116, 1, 32, 4, 0, 12, 114, 101, 109, 111, 118, 101, 45, 97, 115, 115, 101, 116, 1, 32, 1, 64, 0, 0, 21, 4, 0, 20, 103, 101, 116, 45, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 1, 33, 3, 1, 24, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 97, 99, 99, 111, 117, 110, 116, 64, 49, 46, 48, 46, 48, 5, 12, 2, 3, 0, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 2, 3, 0, 0, 4, 119, 111, 114, 100, 2, 3, 0, 0, 7, 110, 111, 116, 101, 45, 105, 100, 1, 66, 37, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 2, 3, 2, 1, 13, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 22, 2, 3, 2, 1, 14, 4, 0, 4, 119, 111, 114, 100, 3, 0, 24, 2, 3, 2, 1, 15, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 0, 0, 1, 4, 0, 16, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 110, 117, 109, 98, 101, 114, 1, 28, 1, 64, 0, 0, 23, 4, 0, 14, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 1, 29, 1, 64, 0, 0, 25, 4, 0, 20, 103, 101, 116, 45, 105, 110, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 1, 30, 4, 0, 21, 103, 101, 116, 45, 111, 117, 116, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 1, 30, 1, 64, 3, 5, 97, 115, 115, 101, 116, 3, 3, 116, 97, 103, 5, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 7, 0, 27, 4, 0, 11, 99, 114, 101, 97, 116, 101, 45, 110, 111, 116, 101, 1, 31, 3, 1, 19, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 116, 120, 64, 49, 46, 48, 46, 48, 5, 16, 1, 66, 10, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 0, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 2, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 4, 1, 64, 1, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 1, 0, 4, 0, 13, 114, 101, 99, 101, 105, 118, 101, 45, 97, 115, 115, 101, 116, 1, 6, 1, 64, 3, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 3, 116, 97, 103, 3, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 5, 1, 0, 4, 0, 10, 115, 101, 110, 100, 45, 97, 115, 115, 101, 116, 1, 7, 4, 1, 37, 109, 105, 100, 101, 110, 58, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 47, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 64, 49, 46, 48, 46, 48, 5, 17, 4, 1, 43, 109, 105, 100, 101, 110, 58, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 47, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 45, 119, 111, 114, 108, 100, 64, 49, 46, 48, 46, 48, 4, 0, 11, 24, 1, 0, 18, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 45, 119, 111, 114, 108, 100, 3, 2, 0, 0, 16, 12, 112, 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 54, 46, 48]; +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.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] #[cfg(target_arch = "wasm32")] -pub fn __link_section() {} +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 index cf97ce09d..0b83b2c95 100644 --- a/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/lib.rs +++ b/tests/rust-apps-wasm/wit-sdk/basic-wallet/src/lib.rs @@ -8,12 +8,18 @@ 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}; -use bindings::miden::base::account::{add_asset, remove_asset}; -use bindings::miden::base::tx::create_note; +use bindings::{ + exports::miden::basic_wallet::basic_wallet::{CoreAsset, Guest, Recipient, Tag}, + miden::base::{ + account::{add_asset, remove_asset}, + tx::create_note, + }, +}; struct Component; diff --git a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock b/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock index b44ec7e7a..79bc8a1f1 100644 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock +++ b/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.lock @@ -7,15 +7,9 @@ name = "basic-wallet-p2id-note" version = "0.0.0" dependencies = [ "wee_alloc", - "wit-bindgen", + "wit-bindgen-rt", ] -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - [[package]] name = "cfg-if" version = "0.1.10" @@ -69,10 +63,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "wit-bindgen" -version = "0.17.0" +name = "wit-bindgen-rt" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6237168d93497b26dacdab157b08ad2787d74cdce10f89735f791b2a225eba4d" -dependencies = [ - "bitflags", -] +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 index 62adb6955..66420f668 100644 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.toml +++ b/tests/rust-apps-wasm/wit-sdk/p2id-note/Cargo.toml @@ -15,7 +15,7 @@ publish = false crate-type = ["cdylib"] [dependencies] -wit-bindgen = { version = "0.17.0", default-features = false, features = ["realloc"] } +wit-bindgen-rt = "0.28" wee_alloc = { version = "0.4.5", default-features = false} [package.metadata.component] 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 index b175a5d76..1e6fc85c2 100644 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs @@ -1,1154 +1,1370 @@ -// Generated by `wit-bindgen` 0.16.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! +// Options used: +// * additional derives ["PartialEq"] +#[allow(dead_code)] pub mod miden { - pub mod base { - - #[allow(clippy::all)] - pub mod core_types { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - /// 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() + #[allow(dead_code)] + pub mod base { + #[allow(dead_code, clippy::all)] + pub mod core_types { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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 }, + } + } + } } - } - /// 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() + + #[allow(dead_code, clippy::all)] + pub mod tx { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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, + }, + } + } + } } - } - /// 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(dead_code, clippy::all)] + pub mod account { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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(unused_unsafe, clippy::all)] - /// Creates a new account ID from a field element. - pub fn account_id_from_felt(felt: Felt,) -> AccountId{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner0)); - AccountId{ - inner: Felt{ - inner: ret as u64, - }, - } + + #[allow(dead_code, clippy::all)] + pub mod note { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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(clippy::all)] - pub mod tx { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/tx@1.0.0")] - extern "C" { - #[link_name = "get-block-hash"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[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(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - (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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[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(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - (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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), wit_bindgen::rt::as_i64(inner7), wit_bindgen::rt::as_i64(inner10), wit_bindgen::rt::as_i64(inner11), wit_bindgen::rt::as_i64(inner12), wit_bindgen::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 basic_wallet { + #[allow(dead_code, clippy::all)] + pub mod basic_wallet { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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(clippy::all)] - pub mod account { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-initial-hash"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-current-hash"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let super::super::super::miden::base::core_types::Felt{ inner:inner0, } = index; - let ptr1 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-item"] - fn wit_import(_: i64, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner0), ptr1); - let l2 = *((ptr1 + 0) as *const i64); - let l3 = *((ptr1 + 8) as *const i64); - let l4 = *((ptr1 + 16) as *const i64); - let l5 = *((ptr1 + 24) as *const i64); - 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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 64]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - 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.as_mut_ptr() as i32; - #[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, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner0), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), wit_bindgen::rt::as_i64(inner6), ptr7); - let l8 = *((ptr7 + 0) as *const i64); - let l9 = *((ptr7 + 8) as *const i64); - let l10 = *((ptr7 + 16) as *const i64); - let l11 = *((ptr7 + 24) as *const i64); - let l12 = *((ptr7 + 32) as *const i64); - let l13 = *((ptr7 + 40) as *const i64); - let l14 = *((ptr7 + 48) as *const i64); - let l15 = *((ptr7 + 56) as *const i64); - (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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5)); - wit_bindgen::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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - 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.as_mut_ptr() as i32; - #[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, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), ptr6); - let l7 = *((ptr6 + 0) as *const i64); - let l8 = *((ptr6 + 8) as *const i64); - let l9 = *((ptr6 + 16) as *const i64); - let l10 = *((ptr6 + 24) as *const i64); - 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{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - 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.as_mut_ptr() as i32; - #[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, _: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i64, _: i64, _: i64, _: i64, _: i32, ){ unreachable!() } - wit_import(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), ptr6); - let l7 = *((ptr6 + 0) as *const i64); - let l8 = *((ptr6 + 8) as *const i64); - let l9 = *((ptr6 + 16) as *const i64); - let l10 = *((ptr6 + 24) as *const i64); - 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(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)] + #[cfg(target_arch = "wasm32")] + 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>() } - } + };); } - #[allow(unused_unsafe, clippy::all)] - /// Returns the commitment to the account vault. - pub fn get_vault_commitment() -> VaultCommitment{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(8))] - struct RetArea([u8; 32]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/account@1.0.0")] - extern "C" { - #[link_name = "get-vault-commitment"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i64); - let l2 = *((ptr0 + 8) as *const i64); - let l3 = *((ptr0 + 16) as *const i64); - let l4 = *((ptr0 + 24) as *const i64); - 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, - }), - } + #[doc(hidden)] + pub(crate) use __export_miden_base_note_script_1_0_0_cabi; + } } - } - } - - - #[allow(clippy::all)] - pub mod note { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - 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() -> wit_bindgen::rt::vec::Vec::{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/note@1.0.0")] - extern "C" { - #[link_name = "get-inputs"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i32); - let l2 = *((ptr0 + 4) as *const i32); - let len3 = l2 as usize; - Vec::from_raw_parts(l1 as *mut _, len3, len3) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the assets of the currently executing note - pub fn get_assets() -> wit_bindgen::rt::vec::Vec::{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - unsafe { - - #[repr(align(4))] - struct RetArea([u8; 8]); - let mut ret_area = ::core::mem::MaybeUninit::::uninit(); - let ptr0 = ret_area.as_mut_ptr() as i32; - #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "miden:base/note@1.0.0")] - extern "C" { - #[link_name = "get-assets"] - fn wit_import(_: i32, ); - } - - #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, ){ unreachable!() } - wit_import(ptr0); - let l1 = *((ptr0 + 0) as *const i32); - let l2 = *((ptr0 + 4) as *const i32); - let len3 = l2 as usize; - Vec::from_raw_parts(l1 as *mut _, len3, len3) - } - } - #[allow(unused_unsafe, clippy::all)] - /// Get the sender of the currently executing note - pub fn get_sender() -> AccountId{ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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, - }, - } +} +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() } - } - } - - } - pub mod basic_wallet { - - #[allow(clippy::all)] - pub mod basic_wallet { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::__link_section; - 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,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5)); + + impl AsI64 for i64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 } - } - #[allow(unused_unsafe, clippy::all)] - pub fn send_asset(core_asset: CoreAsset,tag: Tag,recipient: Recipient,){ - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - 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(wit_bindgen::rt::as_i64(inner2), wit_bindgen::rt::as_i64(inner3), wit_bindgen::rt::as_i64(inner4), wit_bindgen::rt::as_i64(inner5), wit_bindgen::rt::as_i64(inner7), wit_bindgen::rt::as_i64(inner10), wit_bindgen::rt::as_i64(inner11), wit_bindgen::rt::as_i64(inner12), wit_bindgen::rt::as_i64(inner13)); + } + + impl AsI64 for u64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 } - } - } - - } -} -pub mod exports { - pub mod miden { - pub mod base { - - #[allow(clippy::all)] - pub mod note_script { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_section; - const _: () = { - - #[doc(hidden)] - #[export_name = "miden:base/note-script@1.0.0#note-script"] - #[allow(non_snake_case)] - unsafe extern "C" fn __export_note_script() { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - // Before executing any other code, use this function to run all static - // constructors, if they have not yet been run. This is a hack required - // to work around wasi-libc ctors calling import functions to initialize - // the environment. - // - // This functionality will be removed once rust 1.69.0 is stable, at which - // point wasi-libc will no longer have this behavior. - // - // See - // https://github.com/bytecodealliance/preview2-prototyping/issues/99 - // for more details. - #[cfg(target_arch="wasm32")] - wit_bindgen::rt::run_ctors_once(); - - <_GuestImpl as Guest>::note_script(); - } - }; - use super::super::super::super::super::Component as _GuestImpl; - pub trait Guest { - fn note_script(); + 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:notes-world"] +#[link_section = "component-type:wit-bindgen:0.25.0:notes-world:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2438] = [3, 0, 11, 110, 111, 116, 101, 115, 45, 119, 111, 114, 108, 100, 0, 97, 115, 109, 13, 0, 1, 0, 7, 128, 18, 1, 65, 2, 1, 65, 26, 1, 66, 30, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 1, 4, 102, 101, 108, 116, 1, 0, 5, 4, 0, 20, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 45, 102, 114, 111, 109, 45, 102, 101, 108, 116, 1, 28, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 2, 3, 0, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 2, 3, 0, 0, 4, 119, 111, 114, 100, 2, 3, 0, 0, 7, 110, 111, 116, 101, 45, 105, 100, 1, 66, 37, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 2, 3, 2, 1, 12, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 22, 2, 3, 2, 1, 13, 4, 0, 4, 119, 111, 114, 100, 3, 0, 24, 2, 3, 2, 1, 14, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 0, 0, 1, 4, 0, 16, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 110, 117, 109, 98, 101, 114, 1, 28, 1, 64, 0, 0, 23, 4, 0, 14, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 1, 29, 1, 64, 0, 0, 25, 4, 0, 20, 103, 101, 116, 45, 105, 110, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 1, 30, 4, 0, 21, 103, 101, 116, 45, 111, 117, 116, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 1, 30, 1, 64, 3, 5, 97, 115, 115, 101, 116, 3, 3, 116, 97, 103, 5, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 7, 0, 27, 4, 0, 11, 99, 114, 101, 97, 116, 101, 45, 110, 111, 116, 101, 1, 31, 3, 1, 19, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 116, 120, 64, 49, 46, 48, 46, 48, 5, 15, 1, 66, 47, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 1, 64, 0, 0, 9, 4, 0, 6, 103, 101, 116, 45, 105, 100, 1, 22, 1, 64, 0, 0, 11, 4, 0, 9, 103, 101, 116, 45, 110, 111, 110, 99, 101, 1, 23, 1, 64, 0, 0, 13, 4, 0, 16, 103, 101, 116, 45, 105, 110, 105, 116, 105, 97, 108, 45, 104, 97, 115, 104, 1, 24, 4, 0, 16, 103, 101, 116, 45, 99, 117, 114, 114, 101, 110, 116, 45, 104, 97, 115, 104, 1, 24, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 1, 0, 4, 0, 10, 105, 110, 99, 114, 45, 110, 111, 110, 99, 101, 1, 25, 1, 64, 1, 5, 105, 110, 100, 101, 120, 1, 0, 15, 4, 0, 8, 103, 101, 116, 45, 105, 116, 101, 109, 1, 26, 1, 111, 2, 17, 15, 1, 64, 2, 5, 105, 110, 100, 101, 120, 1, 5, 118, 97, 108, 117, 101, 15, 0, 27, 4, 0, 8, 115, 101, 116, 45, 105, 116, 101, 109, 1, 28, 1, 64, 1, 9, 99, 111, 100, 101, 45, 114, 111, 111, 116, 19, 1, 0, 4, 0, 8, 115, 101, 116, 45, 99, 111, 100, 101, 1, 29, 1, 64, 1, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 9, 0, 1, 4, 0, 11, 103, 101, 116, 45, 98, 97, 108, 97, 110, 99, 101, 1, 30, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 127, 4, 0, 22, 104, 97, 115, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 31, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 3, 4, 0, 9, 97, 100, 100, 45, 97, 115, 115, 101, 116, 1, 32, 4, 0, 12, 114, 101, 109, 111, 118, 101, 45, 97, 115, 115, 101, 116, 1, 32, 1, 64, 0, 0, 21, 4, 0, 20, 103, 101, 116, 45, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 1, 33, 3, 1, 24, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 97, 99, 99, 111, 117, 110, 116, 64, 49, 46, 48, 46, 48, 5, 16, 1, 66, 30, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 1, 112, 1, 1, 64, 0, 0, 22, 4, 0, 10, 103, 101, 116, 45, 105, 110, 112, 117, 116, 115, 1, 23, 1, 112, 3, 1, 64, 0, 0, 24, 4, 0, 10, 103, 101, 116, 45, 97, 115, 115, 101, 116, 115, 1, 25, 1, 64, 0, 0, 9, 4, 0, 10, 103, 101, 116, 45, 115, 101, 110, 100, 101, 114, 1, 26, 3, 1, 21, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 110, 111, 116, 101, 64, 49, 46, 48, 46, 48, 5, 17, 1, 66, 10, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 0, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 2, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 4, 1, 64, 1, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 1, 0, 4, 0, 13, 114, 101, 99, 101, 105, 118, 101, 45, 97, 115, 115, 101, 116, 1, 6, 1, 64, 3, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 3, 116, 97, 103, 3, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 5, 1, 0, 4, 0, 10, 115, 101, 110, 100, 45, 97, 115, 115, 101, 116, 1, 7, 3, 1, 37, 109, 105, 100, 101, 110, 58, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 47, 98, 97, 115, 105, 99, 45, 119, 97, 108, 108, 101, 116, 64, 49, 46, 48, 46, 48, 5, 18, 1, 66, 2, 1, 64, 0, 1, 0, 4, 0, 11, 110, 111, 116, 101, 45, 115, 99, 114, 105, 112, 116, 1, 0, 4, 1, 28, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 110, 111, 116, 101, 45, 115, 99, 114, 105, 112, 116, 64, 49, 46, 48, 46, 48, 5, 19, 4, 1, 28, 109, 105, 100, 101, 110, 58, 112, 50, 105, 100, 47, 110, 111, 116, 101, 115, 45, 119, 111, 114, 108, 100, 64, 49, 46, 48, 46, 48, 4, 0, 11, 17, 1, 0, 11, 110, 111, 116, 101, 115, 45, 119, 111, 114, 108, 100, 3, 0, 0, 0, 16, 12, 112, 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 54, 46, 48]; +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.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] #[cfg(target_arch = "wasm32")] -pub fn __link_section() {} +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 index 328347a7c..702a5e800 100644 --- a/tests/rust-apps-wasm/wit-sdk/p2id-note/src/lib.rs +++ b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/lib.rs @@ -8,15 +8,22 @@ fn my_panic(_info: &core::panic::PanicInfo) -> ! { loop {} } +bindings::export!(Component with_types_in bindings); + #[allow(dead_code)] mod bindings; -use bindings::miden::base::account::get_id; -use bindings::miden::base::core_types::account_id_from_felt; -use bindings::miden::base::note::{get_assets, get_inputs}; -use bindings::miden::basic_wallet::basic_wallet::receive_asset; - -use bindings::exports::miden::base::note_script::Guest; +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; diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock b/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock index d7955e467..02128e975 100644 --- a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock +++ b/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - [[package]] name = "cfg-if" version = "0.1.10" @@ -31,7 +25,7 @@ name = "miden-sdk" version = "0.0.0" dependencies = [ "wee_alloc", - "wit-bindgen", + "wit-bindgen-rt", ] [[package]] @@ -69,10 +63,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "wit-bindgen" -version = "0.17.0" +name = "wit-bindgen-rt" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6237168d93497b26dacdab157b08ad2787d74cdce10f89735f791b2a225eba4d" -dependencies = [ - "bitflags", -] +checksum = "d7a37bd9274cb2d4754b915d624447ec0dce9105d174361841c0826efc79ceb9" diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml b/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml index deb5b17d5..e86575701 100644 --- a/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml +++ b/tests/rust-apps-wasm/wit-sdk/sdk/Cargo.toml @@ -12,7 +12,7 @@ publish = false [workspace] [dependencies] -wit-bindgen = { version = "0.17.0", default-features = false, features = ["realloc"] } +wit-bindgen-rt = "0.28" wee_alloc = { version = "0.4.5", default-features = false} diff --git a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs index 839d96441..e5a194d17 100644 --- a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs @@ -1,358 +1,455 @@ -// Generated by `wit-bindgen` 0.16.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! +// Options used: +#[allow(dead_code)] pub mod exports { - pub mod miden { - pub mod base { - - #[allow(clippy::all)] - pub mod core_types { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_section; - /// 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() - } - } - const _: () = { - - #[doc(hidden)] + #[allow(dead_code)] + pub mod miden { + #[allow(dead_code)] + pub mod base { + #[allow(dead_code, clippy::all)] + pub mod core_types { + #[used] + #[doc(hidden)] + #[cfg(target_arch = "wasm32")] + 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"] - #[allow(non_snake_case)] - unsafe extern "C" fn __export_account_id_from_felt(arg0: i64,) -> i64 { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - // Before executing any other code, use this function to run all static - // constructors, if they have not yet been run. This is a hack required - // to work around wasi-libc ctors calling import functions to initialize - // the environment. - // - // This functionality will be removed once rust 1.69.0 is stable, at which - // point wasi-libc will no longer have this behavior. - // - // See - // https://github.com/bytecodealliance/preview2-prototyping/issues/99 - // for more details. - #[cfg(target_arch="wasm32")] - wit_bindgen::rt::run_ctors_once(); - - let result0 = <_GuestImpl as Guest>::account_id_from_felt(Felt{ - inner: arg0 as u64, - }); - let AccountId{ inner:inner1, } = result0; - let Felt{ inner:inner2, } = inner1; - wit_bindgen::rt::as_i64(inner2) + 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)] + #[cfg(target_arch = "wasm32")] + 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, }; - use super::super::super::super::super::Component as _GuestImpl; - pub trait Guest { - /// Creates a new account ID from a field element. - fn account_id_from_felt(felt: Felt,) -> AccountId; - } - + 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) } - - - #[allow(clippy::all)] - pub mod types { - #[used] - #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = super::super::super::super::__link_section; - 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() - } + #[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]); + } } - /// A fungible or a non-fungible asset. - #[derive(Clone, Copy)] - pub enum Asset{ - Fungible(FungibleAsset), - NonFungible(NonFungibleAsset), + } +} +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 ::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() - } - } - } + } + + impl AsI64 for i64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 } - const _: () = { - - #[doc(hidden)] - #[export_name = "miden:base/types@1.0.0#from-core-asset"] - #[allow(non_snake_case)] - unsafe extern "C" fn __export_from_core_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,) -> i32 { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - // Before executing any other code, use this function to run all static - // constructors, if they have not yet been run. This is a hack required - // to work around wasi-libc ctors calling import functions to initialize - // the environment. - // - // This functionality will be removed once rust 1.69.0 is stable, at which - // point wasi-libc will no longer have this behavior. - // - // See - // https://github.com/bytecodealliance/preview2-prototyping/issues/99 - // for more details. - #[cfg(target_arch="wasm32")] - wit_bindgen::rt::run_ctors_once(); - - let result0 = <_GuestImpl as Guest>::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() as i32; - match result0 { - Asset::Fungible(e) => { - *((ptr1 + 0) as *mut u8) = (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 + 8) as *mut i64) = wit_bindgen::rt::as_i64(inner4); - *((ptr1 + 16) as *mut i64) = wit_bindgen::rt::as_i64(amount2); - }, - Asset::NonFungible(e) => { - *((ptr1 + 0) as *mut u8) = (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 + 8) as *mut i64) = wit_bindgen::rt::as_i64(inner7); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner8, } = t6_1; - *((ptr1 + 16) as *mut i64) = wit_bindgen::rt::as_i64(inner8); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner9, } = t6_2; - *((ptr1 + 24) as *mut i64) = wit_bindgen::rt::as_i64(inner9); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner10, } = t6_3; - *((ptr1 + 32) as *mut i64) = wit_bindgen::rt::as_i64(inner10); - }, - } - ptr1 - } - }; - const _: () = { - - #[doc(hidden)] - #[export_name = "miden:base/types@1.0.0#to-core-asset"] - #[allow(non_snake_case)] - unsafe extern "C" fn __export_to_core_asset(arg0: i32,arg1: i64,arg2: i64,arg3: i64,arg4: i64,) -> i32 { - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - // Before executing any other code, use this function to run all static - // constructors, if they have not yet been run. This is a hack required - // to work around wasi-libc ctors calling import functions to initialize - // the environment. - // - // This functionality will be removed once rust 1.69.0 is stable, at which - // point wasi-libc will no longer have this behavior. - // - // See - // https://github.com/bytecodealliance/preview2-prototyping/issues/99 - // for more details. - #[cfg(target_arch="wasm32")] - wit_bindgen::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 = <_GuestImpl as Guest>::to_core_asset(v0); - let ptr2 = _RET_AREA.0.as_mut_ptr() as i32; - 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 + 0) as *mut i64) = wit_bindgen::rt::as_i64(inner5); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner6, } = t4_1; - *((ptr2 + 8) as *mut i64) = wit_bindgen::rt::as_i64(inner6); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner7, } = t4_2; - *((ptr2 + 16) as *mut i64) = wit_bindgen::rt::as_i64(inner7); - let super::super::super::super::exports::miden::base::core_types::Felt{ inner:inner8, } = t4_3; - *((ptr2 + 24) as *mut i64) = wit_bindgen::rt::as_i64(inner8); - ptr2 - } - }; - use super::super::super::super::super::Component as _GuestImpl; - 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; + } + + impl AsI64 for u64 { + #[inline] + fn as_i64(self) -> i64 { + self as i64 } - - #[allow(unused_imports)] - use wit_bindgen::rt::{alloc, vec::Vec, string::String}; - - #[repr(align(8))] - struct _RetArea([u8; 40]); - static mut _RET_AREA: _RetArea = _RetArea([0; 40]); - - } - } - } } +/// 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:base-world"] +#[link_section = "component-type:wit-bindgen:0.25.0:base-world:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 16742] = [3, 0, 10, 98, 97, 115, 101, 45, 119, 111, 114, 108, 100, 0, 97, 115, 109, 13, 0, 1, 0, 7, 171, 3, 1, 65, 2, 1, 66, 30, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 1, 4, 102, 101, 108, 116, 1, 0, 5, 4, 0, 20, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 45, 102, 114, 111, 109, 45, 102, 101, 108, 116, 1, 28, 4, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 11, 16, 1, 0, 10, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 3, 0, 0, 7, 142, 9, 1, 65, 15, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 1, 66, 47, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 1, 64, 0, 0, 9, 4, 0, 6, 103, 101, 116, 45, 105, 100, 1, 22, 1, 64, 0, 0, 11, 4, 0, 9, 103, 101, 116, 45, 110, 111, 110, 99, 101, 1, 23, 1, 64, 0, 0, 13, 4, 0, 16, 103, 101, 116, 45, 105, 110, 105, 116, 105, 97, 108, 45, 104, 97, 115, 104, 1, 24, 4, 0, 16, 103, 101, 116, 45, 99, 117, 114, 114, 101, 110, 116, 45, 104, 97, 115, 104, 1, 24, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 1, 0, 4, 0, 10, 105, 110, 99, 114, 45, 110, 111, 110, 99, 101, 1, 25, 1, 64, 1, 5, 105, 110, 100, 101, 120, 1, 0, 15, 4, 0, 8, 103, 101, 116, 45, 105, 116, 101, 109, 1, 26, 1, 111, 2, 17, 15, 1, 64, 2, 5, 105, 110, 100, 101, 120, 1, 5, 118, 97, 108, 117, 101, 15, 0, 27, 4, 0, 8, 115, 101, 116, 45, 105, 116, 101, 109, 1, 28, 1, 64, 1, 9, 99, 111, 100, 101, 45, 114, 111, 111, 116, 19, 1, 0, 4, 0, 8, 115, 101, 116, 45, 99, 111, 100, 101, 1, 29, 1, 64, 1, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 9, 0, 1, 4, 0, 11, 103, 101, 116, 45, 98, 97, 108, 97, 110, 99, 101, 1, 30, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 127, 4, 0, 22, 104, 97, 115, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 31, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 3, 4, 0, 9, 97, 100, 100, 45, 97, 115, 115, 101, 116, 1, 32, 4, 0, 12, 114, 101, 109, 111, 118, 101, 45, 97, 115, 115, 101, 116, 1, 32, 1, 64, 0, 0, 21, 4, 0, 20, 103, 101, 116, 45, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 1, 33, 4, 1, 24, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 97, 99, 99, 111, 117, 110, 116, 64, 49, 46, 48, 46, 48, 5, 12, 11, 13, 1, 0, 7, 97, 99, 99, 111, 117, 110, 116, 3, 2, 0, 7, 244, 6, 1, 65, 15, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 1, 66, 30, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 1, 112, 1, 1, 64, 0, 0, 22, 4, 0, 10, 103, 101, 116, 45, 105, 110, 112, 117, 116, 115, 1, 23, 1, 112, 3, 1, 64, 0, 0, 24, 4, 0, 10, 103, 101, 116, 45, 97, 115, 115, 101, 116, 115, 1, 25, 1, 64, 0, 0, 9, 4, 0, 10, 103, 101, 116, 45, 115, 101, 110, 100, 101, 114, 1, 26, 4, 1, 21, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 110, 111, 116, 101, 64, 49, 46, 48, 46, 48, 5, 12, 11, 10, 1, 0, 4, 110, 111, 116, 101, 3, 4, 0, 7, 160, 8, 1, 65, 18, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 2, 3, 0, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 2, 3, 0, 0, 4, 119, 111, 114, 100, 2, 3, 0, 0, 7, 110, 111, 116, 101, 45, 105, 100, 1, 66, 37, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 2, 3, 2, 1, 12, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 22, 2, 3, 2, 1, 13, 4, 0, 4, 119, 111, 114, 100, 3, 0, 24, 2, 3, 2, 1, 14, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 0, 0, 1, 4, 0, 16, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 110, 117, 109, 98, 101, 114, 1, 28, 1, 64, 0, 0, 23, 4, 0, 14, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 1, 29, 1, 64, 0, 0, 25, 4, 0, 20, 103, 101, 116, 45, 105, 110, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 1, 30, 4, 0, 21, 103, 101, 116, 45, 111, 117, 116, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 1, 30, 1, 64, 3, 5, 97, 115, 115, 101, 116, 3, 3, 116, 97, 103, 5, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 7, 0, 27, 4, 0, 11, 99, 114, 101, 97, 116, 101, 45, 110, 111, 116, 101, 1, 31, 4, 1, 19, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 116, 120, 64, 49, 46, 48, 46, 48, 5, 15, 11, 8, 1, 0, 2, 116, 120, 3, 6, 0, 7, 173, 8, 1, 65, 17, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 2, 3, 0, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 2, 3, 0, 0, 4, 119, 111, 114, 100, 1, 66, 34, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 2, 3, 2, 1, 12, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 22, 2, 3, 2, 1, 13, 4, 0, 4, 119, 111, 114, 100, 3, 0, 24, 1, 64, 2, 9, 102, 97, 117, 99, 101, 116, 45, 105, 100, 9, 6, 97, 109, 111, 117, 110, 116, 1, 0, 3, 4, 0, 20, 98, 117, 105, 108, 100, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 26, 1, 64, 1, 6, 97, 109, 111, 117, 110, 116, 1, 0, 3, 4, 0, 21, 99, 114, 101, 97, 116, 101, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 27, 1, 64, 2, 9, 102, 97, 117, 99, 101, 116, 45, 105, 100, 9, 9, 100, 97, 116, 97, 45, 104, 97, 115, 104, 25, 0, 3, 4, 0, 24, 98, 117, 105, 108, 100, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 28, 1, 64, 1, 9, 100, 97, 116, 97, 45, 104, 97, 115, 104, 25, 0, 3, 4, 0, 25, 99, 114, 101, 97, 116, 101, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 1, 29, 4, 1, 22, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 97, 115, 115, 101, 116, 64, 49, 46, 48, 46, 48, 5, 14, 11, 11, 1, 0, 5, 97, 115, 115, 101, 116, 3, 8, 0, 7, 170, 7, 1, 65, 17, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 2, 3, 0, 0, 3, 116, 97, 103, 2, 3, 0, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 5, 110, 111, 110, 99, 101, 2, 3, 0, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 2, 3, 0, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 2, 3, 0, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 2, 3, 0, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 2, 3, 0, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 2, 3, 0, 0, 4, 119, 111, 114, 100, 1, 66, 31, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 3, 116, 97, 103, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 2, 3, 2, 1, 5, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 8, 2, 3, 2, 1, 6, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 10, 2, 3, 2, 1, 7, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 12, 2, 3, 2, 1, 8, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 14, 2, 3, 2, 1, 9, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 16, 2, 3, 2, 1, 10, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 18, 2, 3, 2, 1, 11, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 20, 2, 3, 2, 1, 12, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 22, 2, 3, 2, 1, 13, 4, 0, 4, 119, 111, 114, 100, 3, 0, 24, 1, 64, 1, 5, 97, 115, 115, 101, 116, 3, 0, 3, 4, 0, 4, 109, 105, 110, 116, 1, 26, 4, 0, 4, 98, 117, 114, 110, 1, 26, 1, 64, 0, 0, 1, 4, 0, 18, 103, 101, 116, 45, 116, 111, 116, 97, 108, 45, 105, 115, 115, 117, 97, 110, 99, 101, 1, 27, 4, 1, 23, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 102, 97, 117, 99, 101, 116, 64, 49, 46, 48, 46, 48, 5, 14, 11, 12, 1, 0, 6, 102, 97, 117, 99, 101, 116, 3, 10, 0, 7, 210, 5, 1, 65, 8, 1, 66, 28, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 3, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 4, 119, 111, 114, 100, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 66, 18, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 4, 119, 111, 114, 100, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 6, 1, 114, 2, 5, 97, 115, 115, 101, 116, 3, 6, 97, 109, 111, 117, 110, 116, 119, 4, 0, 14, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 5, 4, 0, 18, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 113, 2, 8, 102, 117, 110, 103, 105, 98, 108, 101, 1, 9, 0, 12, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 1, 11, 0, 4, 0, 5, 97, 115, 115, 101, 116, 3, 0, 12, 1, 64, 1, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 7, 0, 13, 4, 0, 15, 102, 114, 111, 109, 45, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 14, 1, 64, 1, 5, 97, 115, 115, 101, 116, 13, 0, 7, 4, 0, 13, 116, 111, 45, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 15, 4, 1, 22, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 5, 11, 11, 1, 0, 5, 116, 121, 112, 101, 115, 3, 12, 0, 7, 60, 1, 65, 2, 1, 66, 2, 1, 64, 0, 1, 0, 4, 0, 11, 110, 111, 116, 101, 45, 115, 99, 114, 105, 112, 116, 1, 0, 4, 1, 28, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 110, 111, 116, 101, 45, 115, 99, 114, 105, 112, 116, 64, 49, 46, 48, 46, 48, 5, 0, 11, 17, 1, 0, 11, 110, 111, 116, 101, 45, 115, 99, 114, 105, 112, 116, 3, 14, 0, 7, 153, 6, 1, 65, 2, 1, 65, 8, 1, 66, 30, 1, 114, 1, 5, 105, 110, 110, 101, 114, 119, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 1, 111, 4, 1, 1, 1, 1, 4, 0, 4, 119, 111, 114, 100, 3, 0, 2, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 4, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 9, 114, 101, 99, 105, 112, 105, 101, 110, 116, 3, 0, 6, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 3, 116, 97, 103, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 5, 110, 111, 110, 99, 101, 3, 0, 12, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 3, 0, 14, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 10, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 3, 0, 16, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 13, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 3, 0, 18, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 12, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 3, 0, 20, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 17, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 3, 0, 22, 1, 114, 1, 5, 105, 110, 110, 101, 114, 3, 4, 0, 16, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 3, 0, 24, 1, 114, 1, 5, 105, 110, 110, 101, 114, 1, 4, 0, 7, 110, 111, 116, 101, 45, 105, 100, 3, 0, 26, 1, 64, 1, 4, 102, 101, 108, 116, 1, 0, 5, 4, 0, 20, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 45, 102, 114, 111, 109, 45, 102, 101, 108, 116, 1, 28, 4, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 0, 2, 3, 0, 0, 4, 102, 101, 108, 116, 2, 3, 0, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 2, 3, 0, 0, 4, 119, 111, 114, 100, 2, 3, 0, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 66, 18, 2, 3, 2, 1, 1, 4, 0, 4, 102, 101, 108, 116, 3, 0, 0, 2, 3, 2, 1, 2, 4, 0, 10, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 3, 0, 2, 2, 3, 2, 1, 3, 4, 0, 4, 119, 111, 114, 100, 3, 0, 4, 2, 3, 2, 1, 4, 4, 0, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 3, 0, 6, 1, 114, 2, 5, 97, 115, 115, 101, 116, 3, 6, 97, 109, 111, 117, 110, 116, 119, 4, 0, 14, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 3, 0, 8, 1, 114, 1, 5, 105, 110, 110, 101, 114, 5, 4, 0, 18, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 3, 0, 10, 1, 113, 2, 8, 102, 117, 110, 103, 105, 98, 108, 101, 1, 9, 0, 12, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 1, 11, 0, 4, 0, 5, 97, 115, 115, 101, 116, 3, 0, 12, 1, 64, 1, 10, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 7, 0, 13, 4, 0, 15, 102, 114, 111, 109, 45, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 14, 1, 64, 1, 5, 97, 115, 115, 101, 116, 13, 0, 7, 4, 0, 13, 116, 111, 45, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 1, 15, 4, 1, 22, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 116, 121, 112, 101, 115, 64, 49, 46, 48, 46, 48, 5, 5, 4, 1, 27, 109, 105, 100, 101, 110, 58, 98, 97, 115, 101, 47, 98, 97, 115, 101, 45, 119, 111, 114, 108, 100, 64, 49, 46, 48, 46, 48, 4, 0, 11, 16, 1, 0, 10, 98, 97, 115, 101, 45, 119, 111, 114, 108, 100, 3, 16, 0, 0, 157, 73, 12, 112, 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 34, 105, 110, 116, 101, 114, 102, 97, 99, 101, 115, 34, 58, 123, 34, 99, 111, 114, 101, 45, 116, 121, 112, 101, 115, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 84, 121, 112, 101, 115, 32, 116, 111, 32, 98, 101, 32, 117, 115, 101, 100, 32, 105, 110, 32, 116, 120, 45, 107, 101, 114, 110, 101, 108, 32, 105, 110, 116, 101, 114, 102, 97, 99, 101, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 45, 102, 114, 111, 109, 45, 102, 101, 108, 116, 34, 58, 34, 67, 114, 101, 97, 116, 101, 115, 32, 97, 32, 110, 101, 119, 32, 97, 99, 99, 111, 117, 110, 116, 32, 73, 68, 32, 102, 114, 111, 109, 32, 97, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 46, 34, 125, 44, 34, 116, 121, 112, 101, 115, 34, 58, 123, 34, 102, 101, 108, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 82, 101, 112, 114, 101, 115, 101, 110, 116, 115, 32, 98, 97, 115, 101, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 32, 105, 110, 32, 116, 104, 101, 32, 102, 105, 101, 108, 100, 32, 117, 115, 105, 110, 103, 32, 77, 111, 110, 116, 103, 111, 109, 101, 114, 121, 32, 114, 101, 112, 114, 101, 115, 101, 110, 116, 97, 116, 105, 111, 110, 46, 92, 110, 73, 110, 116, 101, 114, 110, 97, 108, 32, 118, 97, 108, 117, 101, 115, 32, 114, 101, 112, 114, 101, 115, 101, 110, 116, 32, 120, 32, 42, 32, 82, 32, 109, 111, 100, 32, 77, 32, 119, 104, 101, 114, 101, 32, 82, 32, 61, 32, 50, 94, 54, 52, 32, 109, 111, 100, 32, 77, 32, 97, 110, 100, 32, 120, 32, 105, 110, 32, 91, 48, 44, 32, 77, 41, 46, 92, 110, 84, 104, 101, 32, 98, 97, 99, 107, 105, 110, 103, 32, 116, 121, 112, 101, 32, 105, 115, 32, 96, 102, 54, 52, 96, 32, 98, 117, 116, 32, 116, 104, 101, 32, 105, 110, 116, 101, 114, 110, 97, 108, 32, 118, 97, 108, 117, 101, 115, 32, 97, 114, 101, 32, 97, 108, 119, 97, 121, 115, 32, 105, 110, 116, 101, 103, 101, 114, 32, 105, 110, 32, 116, 104, 101, 32, 114, 97, 110, 103, 101, 32, 91, 48, 44, 32, 77, 41, 46, 92, 110, 70, 105, 101, 108, 100, 32, 109, 111, 100, 117, 108, 117, 115, 32, 77, 32, 61, 32, 50, 94, 54, 52, 32, 45, 32, 50, 94, 51, 50, 32, 43, 32, 49, 34, 44, 34, 105, 116, 101, 109, 115, 34, 58, 123, 34, 105, 110, 110, 101, 114, 34, 58, 34, 87, 101, 32, 112, 108, 97, 110, 32, 116, 111, 32, 117, 115, 101, 32, 102, 54, 52, 32, 97, 115, 32, 116, 104, 101, 32, 98, 97, 99, 107, 105, 110, 103, 32, 116, 121, 112, 101, 32, 102, 111, 114, 32, 116, 104, 101, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 46, 32, 73, 116, 32, 104, 97, 115, 32, 116, 104, 101, 32, 115, 105, 122, 101, 32, 116, 104, 97, 116, 32, 119, 101, 32, 110, 101, 101, 100, 32, 97, 110, 100, 92, 110, 119, 101, 32, 100, 111, 110, 39, 116, 32, 112, 108, 97, 110, 32, 116, 111, 32, 115, 117, 112, 112, 111, 114, 116, 32, 102, 108, 111, 97, 116, 105, 110, 103, 32, 112, 111, 105, 110, 116, 32, 97, 114, 105, 116, 104, 109, 101, 116, 105, 99, 32, 105, 110, 32, 112, 114, 111, 103, 114, 97, 109, 115, 32, 102, 111, 114, 32, 77, 105, 100, 101, 110, 32, 86, 77, 46, 92, 110, 92, 110, 70, 111, 114, 32, 110, 111, 119, 32, 105, 116, 115, 32, 117, 54, 52, 34, 125, 125, 44, 34, 119, 111, 114, 100, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 32, 103, 114, 111, 117, 112, 32, 111, 102, 32, 102, 111, 117, 114, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 115, 32, 105, 110, 32, 116, 104, 101, 32, 77, 105, 100, 101, 110, 32, 98, 97, 115, 101, 32, 102, 105, 101, 108, 100, 46, 34, 125, 44, 34, 97, 99, 99, 111, 117, 110, 116, 45, 105, 100, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 85, 110, 105, 113, 117, 101, 32, 105, 100, 101, 110, 116, 105, 102, 105, 101, 114, 32, 111, 102, 32, 97, 110, 32, 97, 99, 99, 111, 117, 110, 116, 46, 92, 110, 92, 110, 65, 99, 99, 111, 117, 110, 116, 32, 73, 68, 32, 99, 111, 110, 115, 105, 115, 116, 115, 32, 111, 102, 32, 49, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 32, 40, 126, 54, 52, 32, 98, 105, 116, 115, 41, 46, 32, 84, 104, 105, 115, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 32, 117, 110, 105, 113, 117, 101, 108, 121, 32, 105, 100, 101, 110, 116, 105, 102, 105, 101, 115, 32, 97, 92, 110, 115, 105, 110, 103, 108, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 97, 110, 100, 32, 97, 108, 115, 111, 32, 115, 112, 101, 99, 105, 102, 105, 101, 115, 32, 116, 104, 101, 32, 116, 121, 112, 101, 32, 111, 102, 32, 116, 104, 101, 32, 117, 110, 100, 101, 114, 108, 121, 105, 110, 103, 32, 97, 99, 99, 111, 117, 110, 116, 46, 32, 83, 112, 101, 99, 105, 102, 105, 99, 97, 108, 108, 121, 58, 92, 110, 45, 32, 84, 104, 101, 32, 116, 119, 111, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 98, 105, 116, 115, 32, 111, 102, 32, 116, 104, 101, 32, 73, 68, 32, 115, 112, 101, 99, 105, 102, 121, 32, 116, 104, 101, 32, 116, 121, 112, 101, 32, 111, 102, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 58, 92, 110, 45, 32, 48, 48, 32, 45, 32, 114, 101, 103, 117, 108, 97, 114, 32, 97, 99, 99, 111, 117, 110, 116, 32, 119, 105, 116, 104, 32, 117, 112, 100, 97, 116, 97, 98, 108, 101, 32, 99, 111, 100, 101, 46, 92, 110, 45, 32, 48, 49, 32, 45, 32, 114, 101, 103, 117, 108, 97, 114, 32, 97, 99, 99, 111, 117, 110, 116, 32, 119, 105, 116, 104, 32, 105, 109, 109, 117, 116, 97, 98, 108, 101, 32, 99, 111, 100, 101, 46, 92, 110, 45, 32, 49, 48, 32, 45, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 102, 97, 117, 99, 101, 116, 32, 119, 105, 116, 104, 32, 105, 109, 109, 117, 116, 97, 98, 108, 101, 32, 99, 111, 100, 101, 46, 92, 110, 45, 32, 49, 49, 32, 45, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 102, 97, 117, 99, 101, 116, 32, 119, 105, 116, 104, 32, 105, 109, 109, 117, 116, 97, 98, 108, 101, 32, 99, 111, 100, 101, 46, 92, 110, 45, 32, 84, 104, 101, 32, 116, 104, 105, 114, 100, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 98, 105, 116, 32, 111, 102, 32, 116, 104, 101, 32, 73, 68, 32, 115, 112, 101, 99, 105, 102, 105, 101, 115, 32, 119, 104, 101, 116, 104, 101, 114, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 100, 97, 116, 97, 32, 105, 115, 32, 115, 116, 111, 114, 101, 100, 32, 111, 110, 45, 99, 104, 97, 105, 110, 58, 92, 110, 45, 32, 48, 32, 45, 32, 102, 117, 108, 108, 32, 97, 99, 99, 111, 117, 110, 116, 32, 100, 97, 116, 97, 32, 105, 115, 32, 115, 116, 111, 114, 101, 100, 32, 111, 110, 45, 99, 104, 97, 105, 110, 46, 92, 110, 45, 32, 49, 32, 45, 32, 111, 110, 108, 121, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 104, 97, 115, 104, 32, 105, 115, 32, 115, 116, 111, 114, 101, 100, 32, 111, 110, 45, 99, 104, 97, 105, 110, 32, 119, 104, 105, 99, 104, 32, 115, 101, 114, 118, 101, 115, 32, 97, 115, 32, 97, 32, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 32, 116, 111, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 115, 116, 97, 116, 101, 46, 92, 110, 65, 115, 32, 115, 117, 99, 104, 32, 116, 104, 101, 32, 116, 104, 114, 101, 101, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 98, 105, 116, 115, 32, 102, 117, 108, 108, 121, 32, 100, 101, 115, 99, 114, 105, 98, 101, 115, 32, 116, 104, 101, 32, 116, 121, 112, 101, 32, 111, 102, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 46, 34, 125, 44, 34, 114, 101, 99, 105, 112, 105, 101, 110, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 82, 101, 99, 105, 112, 105, 101, 110, 116, 32, 111, 102, 32, 116, 104, 101, 32, 110, 111, 116, 101, 44, 32, 105, 46, 101, 46, 44, 32, 104, 97, 115, 104, 40, 104, 97, 115, 104, 40, 104, 97, 115, 104, 40, 115, 101, 114, 105, 97, 108, 95, 110, 117, 109, 44, 32, 91, 48, 59, 32, 52, 93, 41, 44, 32, 110, 111, 116, 101, 95, 115, 99, 114, 105, 112, 116, 95, 104, 97, 115, 104, 41, 44, 32, 105, 110, 112, 117, 116, 95, 104, 97, 115, 104, 41, 34, 125, 44, 34, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 111, 114, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 92, 110, 92, 110, 65, 108, 108, 32, 97, 115, 115, 101, 116, 115, 32, 97, 114, 101, 32, 101, 110, 99, 111, 100, 101, 100, 32, 117, 115, 105, 110, 103, 32, 97, 32, 115, 105, 110, 103, 108, 101, 32, 119, 111, 114, 100, 32, 40, 52, 32, 101, 108, 101, 109, 101, 110, 116, 115, 41, 32, 115, 117, 99, 104, 32, 116, 104, 97, 116, 32, 105, 116, 32, 105, 115, 32, 101, 97, 115, 121, 32, 116, 111, 32, 100, 101, 116, 101, 114, 109, 105, 110, 101, 32, 116, 104, 101, 92, 110, 116, 121, 112, 101, 32, 111, 102, 32, 97, 110, 32, 97, 115, 115, 101, 116, 32, 98, 111, 116, 104, 32, 105, 110, 115, 105, 100, 101, 32, 97, 110, 100, 32, 111, 117, 116, 115, 105, 100, 101, 32, 77, 105, 100, 101, 110, 32, 86, 77, 46, 32, 83, 112, 101, 99, 105, 102, 105, 99, 97, 108, 108, 121, 58, 92, 110, 69, 108, 101, 109, 101, 110, 116, 32, 49, 32, 119, 105, 108, 108, 32, 98, 101, 58, 92, 110, 45, 32, 90, 69, 82, 79, 32, 102, 111, 114, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 92, 110, 45, 32, 110, 111, 110, 45, 90, 69, 82, 79, 32, 102, 111, 114, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 92, 110, 84, 104, 101, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 98, 105, 116, 32, 119, 105, 108, 108, 32, 98, 101, 58, 92, 110, 45, 32, 79, 78, 69, 32, 102, 111, 114, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 92, 110, 45, 32, 90, 69, 82, 79, 32, 102, 111, 114, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 92, 110, 92, 110, 84, 104, 101, 32, 97, 98, 111, 118, 101, 32, 112, 114, 111, 112, 101, 114, 116, 105, 101, 115, 32, 103, 117, 97, 114, 97, 110, 116, 101, 101, 32, 116, 104, 97, 116, 32, 116, 104, 101, 114, 101, 32, 99, 97, 110, 32, 110, 101, 118, 101, 114, 32, 98, 101, 32, 97, 32, 99, 111, 108, 108, 105, 115, 105, 111, 110, 32, 98, 101, 116, 119, 101, 101, 110, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 110, 100, 32, 97, 92, 110, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 92, 110, 92, 110, 84, 104, 101, 32, 109, 101, 116, 104, 111, 100, 111, 108, 111, 103, 121, 32, 102, 111, 114, 32, 99, 111, 110, 115, 116, 114, 117, 99, 116, 105, 110, 103, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 110, 100, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 32, 105, 115, 32, 100, 101, 115, 99, 114, 105, 98, 101, 100, 32, 98, 101, 108, 111, 119, 46, 92, 110, 92, 110, 35, 32, 70, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 92, 110, 84, 104, 101, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 101, 108, 101, 109, 101, 110, 116, 32, 111, 102, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 105, 115, 32, 115, 101, 116, 32, 116, 111, 32, 116, 104, 101, 32, 73, 68, 32, 111, 102, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 119, 104, 105, 99, 104, 32, 105, 115, 115, 117, 101, 100, 92, 110, 116, 104, 101, 32, 97, 115, 115, 101, 116, 46, 32, 84, 104, 105, 115, 32, 103, 117, 97, 114, 97, 110, 116, 101, 101, 115, 32, 116, 104, 101, 32, 112, 114, 111, 112, 101, 114, 116, 105, 101, 115, 32, 100, 101, 115, 99, 114, 105, 98, 101, 100, 32, 97, 98, 111, 118, 101, 32, 40, 116, 104, 101, 32, 102, 105, 114, 115, 116, 32, 98, 105, 116, 32, 105, 115, 32, 79, 78, 69, 41, 46, 92, 110, 92, 110, 84, 104, 101, 32, 108, 101, 97, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 101, 108, 101, 109, 101, 110, 116, 32, 105, 115, 32, 115, 101, 116, 32, 116, 111, 32, 116, 104, 101, 32, 97, 109, 111, 117, 110, 116, 32, 111, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 46, 32, 84, 104, 105, 115, 32, 97, 109, 111, 117, 110, 116, 32, 99, 97, 110, 110, 111, 116, 32, 98, 101, 32, 103, 114, 101, 97, 116, 101, 114, 92, 110, 116, 104, 97, 110, 32, 50, 94, 54, 51, 32, 45, 32, 49, 32, 97, 110, 100, 32, 116, 104, 117, 115, 32, 114, 101, 113, 117, 105, 114, 101, 115, 32, 54, 51, 45, 98, 105, 116, 115, 32, 116, 111, 32, 115, 116, 111, 114, 101, 46, 92, 110, 92, 110, 69, 108, 101, 109, 101, 110, 116, 115, 32, 49, 32, 97, 110, 100, 32, 50, 32, 97, 114, 101, 32, 115, 101, 116, 32, 116, 111, 32, 90, 69, 82, 79, 46, 92, 110, 92, 110, 73, 116, 32, 105, 115, 32, 105, 109, 112, 111, 115, 115, 105, 98, 108, 101, 32, 116, 111, 32, 102, 105, 110, 100, 32, 97, 32, 99, 111, 108, 108, 105, 115, 105, 111, 110, 32, 98, 101, 116, 119, 101, 101, 110, 32, 116, 119, 111, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 32, 105, 115, 115, 117, 101, 100, 32, 98, 121, 32, 100, 105, 102, 102, 101, 114, 101, 110, 116, 32, 102, 97, 117, 99, 101, 116, 115, 32, 97, 115, 92, 110, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 95, 105, 100, 32, 105, 115, 32, 105, 110, 99, 108, 117, 100, 101, 100, 32, 105, 110, 32, 116, 104, 101, 32, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 32, 111, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 97, 110, 100, 32, 116, 104, 105, 115, 32, 105, 115, 32, 103, 117, 97, 114, 97, 110, 116, 101, 101, 100, 32, 116, 111, 32, 98, 101, 32, 100, 105, 102, 102, 101, 114, 101, 110, 116, 92, 110, 102, 111, 114, 32, 101, 97, 99, 104, 32, 102, 97, 117, 99, 101, 116, 32, 97, 115, 32, 112, 101, 114, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 99, 114, 101, 97, 116, 105, 111, 110, 32, 108, 111, 103, 105, 99, 46, 92, 110, 92, 110, 35, 32, 78, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 92, 110, 84, 104, 101, 32, 52, 32, 101, 108, 101, 109, 101, 110, 116, 115, 32, 111, 102, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 32, 97, 114, 101, 32, 99, 111, 109, 112, 117, 116, 101, 100, 32, 97, 115, 32, 102, 111, 108, 108, 111, 119, 115, 58, 92, 110, 45, 32, 70, 105, 114, 115, 116, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 100, 97, 116, 97, 32, 105, 115, 32, 104, 97, 115, 104, 101, 100, 46, 32, 84, 104, 105, 115, 32, 99, 111, 109, 112, 114, 101, 115, 115, 101, 115, 32, 97, 110, 32, 97, 115, 115, 101, 116, 32, 111, 102, 32, 97, 110, 32, 97, 114, 98, 105, 116, 114, 97, 114, 121, 32, 108, 101, 110, 103, 116, 104, 32, 116, 111, 32, 52, 32, 102, 105, 101, 108, 100, 92, 110, 101, 108, 101, 109, 101, 110, 116, 115, 58, 32, 91, 100, 48, 44, 32, 100, 49, 44, 32, 100, 50, 44, 32, 100, 51, 93, 46, 92, 110, 45, 32, 100, 49, 32, 105, 115, 32, 116, 104, 101, 110, 32, 114, 101, 112, 108, 97, 99, 101, 100, 32, 119, 105, 116, 104, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 95, 105, 100, 32, 119, 104, 105, 99, 104, 32, 105, 115, 115, 117, 101, 115, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 58, 32, 91, 100, 48, 44, 32, 102, 97, 117, 99, 101, 116, 95, 105, 100, 44, 32, 100, 50, 44, 32, 100, 51, 93, 46, 92, 110, 45, 32, 76, 97, 115, 116, 108, 121, 44, 32, 116, 104, 101, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 98, 105, 116, 32, 111, 102, 32, 100, 51, 32, 105, 115, 32, 115, 101, 116, 32, 116, 111, 32, 90, 69, 82, 79, 46, 92, 110, 92, 110, 73, 116, 32, 105, 115, 32, 105, 109, 112, 111, 115, 115, 105, 98, 108, 101, 32, 116, 111, 32, 102, 105, 110, 100, 32, 97, 32, 99, 111, 108, 108, 105, 115, 105, 111, 110, 32, 98, 101, 116, 119, 101, 101, 110, 32, 116, 119, 111, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 32, 105, 115, 115, 117, 101, 100, 32, 98, 121, 32, 100, 105, 102, 102, 101, 114, 101, 110, 116, 32, 102, 97, 117, 99, 101, 116, 115, 92, 110, 97, 115, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 95, 105, 100, 32, 105, 115, 32, 105, 110, 99, 108, 117, 100, 101, 100, 32, 105, 110, 32, 116, 104, 101, 32, 100, 101, 115, 99, 114, 105, 112, 116, 105, 111, 110, 32, 111, 102, 32, 116, 104, 101, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 97, 110, 100, 32, 116, 104, 105, 115, 32, 105, 115, 32, 103, 117, 97, 114, 97, 110, 116, 101, 101, 100, 92, 110, 116, 111, 32, 98, 101, 32, 100, 105, 102, 102, 101, 114, 101, 110, 116, 32, 97, 115, 32, 112, 101, 114, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 99, 114, 101, 97, 116, 105, 111, 110, 32, 108, 111, 103, 105, 99, 46, 32, 67, 111, 108, 108, 105, 115, 105, 111, 110, 32, 114, 101, 115, 105, 115, 116, 97, 110, 99, 101, 32, 102, 111, 114, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 115, 92, 110, 105, 115, 115, 117, 101, 100, 32, 98, 121, 32, 116, 104, 101, 32, 115, 97, 109, 101, 32, 102, 97, 117, 99, 101, 116, 32, 105, 115, 32, 126, 50, 94, 57, 53, 46, 34, 125, 44, 34, 110, 111, 110, 99, 101, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 99, 99, 111, 117, 110, 116, 32, 110, 111, 110, 99, 101, 34, 125, 44, 34, 97, 99, 99, 111, 117, 110, 116, 45, 104, 97, 115, 104, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 99, 99, 111, 117, 110, 116, 32, 104, 97, 115, 104, 34, 125, 44, 34, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 66, 108, 111, 99, 107, 32, 104, 97, 115, 104, 34, 125, 44, 34, 115, 116, 111, 114, 97, 103, 101, 45, 118, 97, 108, 117, 101, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 83, 116, 111, 114, 97, 103, 101, 32, 118, 97, 108, 117, 101, 34, 125, 44, 34, 115, 116, 111, 114, 97, 103, 101, 45, 114, 111, 111, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 99, 99, 111, 117, 110, 116, 32, 115, 116, 111, 114, 97, 103, 101, 32, 114, 111, 111, 116, 34, 125, 44, 34, 97, 99, 99, 111, 117, 110, 116, 45, 99, 111, 100, 101, 45, 114, 111, 111, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 99, 99, 111, 117, 110, 116, 32, 99, 111, 100, 101, 32, 114, 111, 111, 116, 34, 125, 44, 34, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 67, 111, 109, 109, 105, 116, 109, 101, 110, 116, 32, 116, 111, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 118, 97, 117, 108, 116, 34, 125, 44, 34, 110, 111, 116, 101, 45, 105, 100, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 110, 32, 105, 100, 32, 111, 102, 32, 116, 104, 101, 32, 99, 114, 101, 97, 116, 101, 100, 32, 110, 111, 116, 101, 34, 125, 125, 125, 44, 34, 97, 99, 99, 111, 117, 110, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 99, 99, 111, 117, 110, 116, 45, 114, 101, 108, 97, 116, 101, 100, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 103, 101, 116, 45, 105, 100, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 105, 100, 32, 111, 102, 32, 116, 104, 101, 32, 99, 117, 114, 114, 101, 110, 116, 108, 121, 32, 101, 120, 101, 99, 117, 116, 105, 110, 103, 32, 97, 99, 99, 111, 117, 110, 116, 34, 44, 34, 103, 101, 116, 45, 110, 111, 110, 99, 101, 34, 58, 34, 82, 101, 116, 117, 114, 110, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 110, 111, 110, 99, 101, 34, 44, 34, 103, 101, 116, 45, 105, 110, 105, 116, 105, 97, 108, 45, 104, 97, 115, 104, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 105, 110, 105, 116, 105, 97, 108, 32, 104, 97, 115, 104, 32, 111, 102, 32, 116, 104, 101, 32, 99, 117, 114, 114, 101, 110, 116, 108, 121, 32, 101, 120, 101, 99, 117, 116, 105, 110, 103, 32, 97, 99, 99, 111, 117, 110, 116, 34, 44, 34, 103, 101, 116, 45, 99, 117, 114, 114, 101, 110, 116, 45, 104, 97, 115, 104, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 99, 117, 114, 114, 101, 110, 116, 32, 104, 97, 115, 104, 32, 111, 102, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 100, 97, 116, 97, 32, 115, 116, 111, 114, 101, 100, 32, 105, 110, 32, 109, 101, 109, 111, 114, 121, 34, 44, 34, 105, 110, 99, 114, 45, 110, 111, 110, 99, 101, 34, 58, 34, 73, 110, 99, 114, 101, 109, 101, 110, 116, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 110, 111, 110, 99, 101, 32, 98, 121, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 118, 97, 108, 117, 101, 46, 92, 110, 118, 97, 108, 117, 101, 32, 99, 97, 110, 32, 98, 101, 32, 97, 116, 32, 109, 111, 115, 116, 32, 50, 94, 51, 50, 32, 45, 32, 49, 32, 111, 116, 104, 101, 114, 119, 105, 115, 101, 32, 116, 104, 105, 115, 32, 112, 114, 111, 99, 101, 100, 117, 114, 101, 32, 112, 97, 110, 105, 99, 115, 34, 44, 34, 103, 101, 116, 45, 105, 116, 101, 109, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 118, 97, 108, 117, 101, 32, 111, 102, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 107, 101, 121, 32, 105, 110, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 115, 116, 111, 114, 97, 103, 101, 34, 44, 34, 115, 101, 116, 45, 105, 116, 101, 109, 34, 58, 34, 83, 101, 116, 32, 116, 104, 101, 32, 118, 97, 108, 117, 101, 32, 111, 102, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 107, 101, 121, 32, 105, 110, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 115, 116, 111, 114, 97, 103, 101, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 111, 108, 100, 32, 118, 97, 108, 117, 101, 32, 111, 102, 32, 116, 104, 101, 32, 107, 101, 121, 32, 97, 110, 100, 32, 116, 104, 101, 32, 110, 101, 119, 32, 115, 116, 111, 114, 97, 103, 101, 32, 114, 111, 111, 116, 34, 44, 34, 115, 101, 116, 45, 99, 111, 100, 101, 34, 58, 34, 83, 101, 116, 115, 32, 116, 104, 101, 32, 99, 111, 100, 101, 32, 111, 102, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 116, 104, 101, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 32, 98, 101, 105, 110, 103, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 97, 103, 97, 105, 110, 115, 116, 46, 92, 110, 84, 104, 105, 115, 32, 112, 114, 111, 99, 101, 100, 117, 114, 101, 32, 99, 97, 110, 32, 111, 110, 108, 121, 32, 98, 101, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 111, 110, 32, 114, 101, 103, 117, 108, 97, 114, 32, 97, 99, 99, 111, 117, 110, 116, 115, 32, 119, 105, 116, 104, 32, 117, 112, 100, 97, 116, 97, 98, 108, 101, 92, 110, 99, 111, 100, 101, 46, 32, 79, 116, 104, 101, 114, 119, 105, 115, 101, 44, 32, 116, 104, 105, 115, 32, 112, 114, 111, 99, 101, 100, 117, 114, 101, 32, 102, 97, 105, 108, 115, 46, 32, 99, 111, 100, 101, 32, 105, 115, 32, 116, 104, 101, 32, 104, 97, 115, 104, 32, 111, 102, 32, 116, 104, 101, 32, 99, 111, 100, 101, 92, 110, 116, 111, 32, 115, 101, 116, 46, 34, 44, 34, 103, 101, 116, 45, 98, 97, 108, 97, 110, 99, 101, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 98, 97, 108, 97, 110, 99, 101, 32, 111, 102, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 97, 115, 115, 111, 99, 105, 97, 116, 101, 100, 32, 119, 105, 116, 104, 32, 97, 32, 97, 99, 99, 111, 117, 110, 116, 95, 105, 100, 46, 92, 110, 80, 97, 110, 105, 99, 115, 32, 105, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 105, 115, 32, 110, 111, 116, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 32, 97, 99, 99, 111, 117, 110, 116, 95, 105, 100, 32, 105, 115, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 105, 100, 92, 110, 111, 102, 32, 116, 104, 101, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 111, 102, 32, 105, 110, 116, 101, 114, 101, 115, 116, 46, 32, 98, 97, 108, 97, 110, 99, 101, 32, 105, 115, 32, 116, 104, 101, 32, 118, 97, 117, 108, 116, 32, 98, 97, 108, 97, 110, 99, 101, 32, 111, 102, 32, 116, 104, 101, 92, 110, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 34, 44, 34, 104, 97, 115, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 97, 32, 98, 111, 111, 108, 101, 97, 110, 32, 105, 110, 100, 105, 99, 97, 116, 105, 110, 103, 32, 119, 104, 101, 116, 104, 101, 114, 32, 116, 104, 101, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 105, 115, 32, 112, 114, 101, 115, 101, 110, 116, 92, 110, 105, 110, 32, 116, 104, 101, 32, 118, 97, 117, 108, 116, 46, 32, 80, 97, 110, 105, 99, 115, 32, 105, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 105, 115, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 32, 97, 115, 115, 101, 116, 32, 105, 115, 32, 116, 104, 101, 92, 110, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 111, 102, 32, 105, 110, 116, 101, 114, 101, 115, 116, 46, 32, 104, 97, 115, 95, 97, 115, 115, 101, 116, 32, 105, 115, 32, 97, 32, 98, 111, 111, 108, 101, 97, 110, 32, 105, 110, 100, 105, 99, 97, 116, 105, 110, 103, 92, 110, 119, 104, 101, 116, 104, 101, 114, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 118, 97, 117, 108, 116, 32, 104, 97, 115, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 111, 102, 32, 105, 110, 116, 101, 114, 101, 115, 116, 46, 34, 44, 34, 97, 100, 100, 45, 97, 115, 115, 101, 116, 34, 58, 34, 65, 100, 100, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 116, 104, 101, 32, 118, 97, 117, 108, 116, 46, 32, 80, 97, 110, 105, 99, 115, 32, 117, 110, 100, 101, 114, 32, 118, 97, 114, 105, 111, 117, 115, 32, 99, 111, 110, 100, 105, 116, 105, 111, 110, 115, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 102, 105, 110, 97, 108, 32, 97, 115, 115, 101, 116, 32, 105, 110, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 118, 97, 117, 108, 116, 32, 100, 101, 102, 105, 110, 101, 100, 32, 97, 115, 32, 102, 111, 108, 108, 111, 119, 115, 58, 32, 73, 102, 32, 97, 115, 115, 101, 116, 32, 105, 115, 92, 110, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 44, 32, 116, 104, 101, 110, 32, 114, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 115, 97, 109, 101, 32, 97, 115, 32, 97, 115, 115, 101, 116, 46, 32, 73, 102, 32, 97, 115, 115, 101, 116, 32, 105, 115, 32, 97, 92, 110, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 44, 32, 116, 104, 101, 110, 32, 114, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 116, 111, 116, 97, 108, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 105, 110, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 92, 110, 118, 97, 117, 108, 116, 32, 97, 102, 116, 101, 114, 32, 97, 115, 115, 101, 116, 32, 119, 97, 115, 32, 97, 100, 100, 101, 100, 32, 116, 111, 32, 105, 116, 46, 34, 44, 34, 114, 101, 109, 111, 118, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 82, 101, 109, 111, 118, 101, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 97, 115, 115, 101, 116, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 118, 97, 117, 108, 116, 34, 44, 34, 103, 101, 116, 45, 118, 97, 117, 108, 116, 45, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 32, 116, 111, 32, 116, 104, 101, 32, 97, 99, 99, 111, 117, 110, 116, 32, 118, 97, 117, 108, 116, 46, 34, 125, 125, 44, 34, 110, 111, 116, 101, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 78, 111, 116, 101, 45, 114, 101, 108, 97, 116, 101, 100, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 103, 101, 116, 45, 105, 110, 112, 117, 116, 115, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 105, 110, 112, 117, 116, 115, 32, 111, 102, 32, 116, 104, 101, 32, 99, 117, 114, 114, 101, 110, 116, 108, 121, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 110, 111, 116, 101, 34, 44, 34, 103, 101, 116, 45, 97, 115, 115, 101, 116, 115, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 115, 32, 111, 102, 32, 116, 104, 101, 32, 99, 117, 114, 114, 101, 110, 116, 108, 121, 32, 101, 120, 101, 99, 117, 116, 105, 110, 103, 32, 110, 111, 116, 101, 34, 44, 34, 103, 101, 116, 45, 115, 101, 110, 100, 101, 114, 34, 58, 34, 71, 101, 116, 32, 116, 104, 101, 32, 115, 101, 110, 100, 101, 114, 32, 111, 102, 32, 116, 104, 101, 32, 99, 117, 114, 114, 101, 110, 116, 108, 121, 32, 101, 120, 101, 99, 117, 116, 105, 110, 103, 32, 110, 111, 116, 101, 34, 125, 125, 44, 34, 116, 120, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 84, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 45, 114, 101, 108, 97, 116, 101, 100, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 110, 117, 109, 98, 101, 114, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 98, 108, 111, 99, 107, 32, 110, 117, 109, 98, 101, 114, 32, 111, 102, 32, 116, 104, 101, 32, 108, 97, 115, 116, 32, 107, 110, 111, 119, 110, 32, 98, 108, 111, 99, 107, 32, 97, 116, 32, 116, 104, 101, 32, 116, 105, 109, 101, 32, 111, 102, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 101, 120, 101, 99, 117, 116, 105, 111, 110, 46, 34, 44, 34, 103, 101, 116, 45, 98, 108, 111, 99, 107, 45, 104, 97, 115, 104, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 98, 108, 111, 99, 107, 32, 104, 97, 115, 104, 32, 111, 102, 32, 116, 104, 101, 32, 108, 97, 115, 116, 32, 107, 110, 111, 119, 110, 32, 98, 108, 111, 99, 107, 32, 97, 116, 32, 116, 104, 101, 32, 116, 105, 109, 101, 32, 111, 102, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 101, 120, 101, 99, 117, 116, 105, 111, 110, 46, 34, 44, 34, 103, 101, 116, 45, 105, 110, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 105, 110, 112, 117, 116, 32, 110, 111, 116, 101, 115, 32, 104, 97, 115, 104, 46, 32, 84, 104, 105, 115, 32, 105, 115, 32, 99, 111, 109, 112, 117, 116, 101, 100, 32, 97, 115, 32, 97, 32, 115, 101, 113, 117, 101, 110, 116, 105, 97, 108, 32, 104, 97, 115, 104, 32, 111, 102, 92, 110, 40, 110, 117, 108, 108, 105, 102, 105, 101, 114, 44, 32, 115, 99, 114, 105, 112, 116, 95, 114, 111, 111, 116, 41, 32, 116, 117, 112, 108, 101, 115, 32, 111, 118, 101, 114, 32, 97, 108, 108, 32, 105, 110, 112, 117, 116, 32, 110, 111, 116, 101, 115, 46, 34, 44, 34, 103, 101, 116, 45, 111, 117, 116, 112, 117, 116, 45, 110, 111, 116, 101, 115, 45, 104, 97, 115, 104, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 111, 117, 116, 112, 117, 116, 32, 110, 111, 116, 101, 115, 32, 104, 97, 115, 104, 46, 32, 84, 104, 105, 115, 32, 105, 115, 32, 99, 111, 109, 112, 117, 116, 101, 100, 32, 97, 115, 32, 97, 32, 115, 101, 113, 117, 101, 110, 116, 105, 97, 108, 32, 104, 97, 115, 104, 32, 111, 102, 92, 110, 40, 110, 111, 116, 101, 95, 104, 97, 115, 104, 44, 32, 110, 111, 116, 101, 95, 109, 101, 116, 97, 100, 97, 116, 97, 41, 32, 116, 117, 112, 108, 101, 115, 32, 111, 118, 101, 114, 32, 97, 108, 108, 32, 111, 117, 116, 112, 117, 116, 32, 110, 111, 116, 101, 115, 46, 34, 44, 34, 99, 114, 101, 97, 116, 101, 45, 110, 111, 116, 101, 34, 58, 34, 67, 114, 101, 97, 116, 101, 115, 32, 97, 32, 110, 101, 119, 32, 110, 111, 116, 101, 46, 92, 110, 97, 115, 115, 101, 116, 32, 105, 115, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 98, 101, 32, 105, 110, 99, 108, 117, 100, 101, 100, 32, 105, 110, 32, 116, 104, 101, 32, 110, 111, 116, 101, 46, 92, 110, 116, 97, 103, 32, 105, 115, 32, 116, 104, 101, 32, 116, 97, 103, 32, 116, 111, 32, 98, 101, 32, 105, 110, 99, 108, 117, 100, 101, 100, 32, 105, 110, 32, 116, 104, 101, 32, 110, 111, 116, 101, 46, 92, 110, 114, 101, 99, 105, 112, 105, 101, 110, 116, 32, 105, 115, 32, 116, 104, 101, 32, 114, 101, 99, 105, 112, 105, 101, 110, 116, 32, 111, 102, 32, 116, 104, 101, 32, 110, 111, 116, 101, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 105, 100, 32, 111, 102, 32, 116, 104, 101, 32, 99, 114, 101, 97, 116, 101, 100, 32, 110, 111, 116, 101, 46, 34, 125, 125, 44, 34, 97, 115, 115, 101, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 115, 115, 101, 116, 45, 114, 101, 108, 97, 116, 101, 100, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 46, 32, 84, 104, 101, 115, 101, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 32, 99, 97, 110, 32, 111, 110, 108, 121, 32, 98, 101, 32, 99, 97, 108, 108, 101, 100, 32, 98, 121, 32, 102, 97, 117, 99, 101, 116, 32, 97, 99, 99, 111, 117, 110, 116, 115, 46, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 98, 117, 105, 108, 100, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 66, 117, 105, 108, 100, 115, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 102, 111, 114, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 102, 97, 117, 99, 101, 116, 32, 97, 110, 100, 32, 97, 109, 111, 117, 110, 116, 46, 92, 110, 102, 97, 117, 99, 101, 116, 95, 105, 100, 32, 105, 115, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 111, 32, 99, 114, 101, 97, 116, 101, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 102, 111, 114, 46, 92, 110, 97, 109, 111, 117, 110, 116, 32, 105, 115, 32, 116, 104, 101, 32, 97, 109, 111, 117, 110, 116, 32, 111, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 99, 114, 101, 97, 116, 101, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 99, 114, 101, 97, 116, 101, 100, 32, 97, 115, 115, 101, 116, 46, 34, 44, 34, 99, 114, 101, 97, 116, 101, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 67, 114, 101, 97, 116, 101, 115, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 102, 111, 114, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 104, 101, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 32, 98, 101, 105, 110, 103, 92, 110, 101, 120, 101, 99, 117, 116, 101, 100, 32, 97, 103, 97, 105, 110, 115, 116, 46, 92, 110, 97, 109, 111, 117, 110, 116, 32, 105, 115, 32, 116, 104, 101, 32, 97, 109, 111, 117, 110, 116, 32, 111, 102, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 99, 114, 101, 97, 116, 101, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 99, 114, 101, 97, 116, 101, 100, 32, 97, 115, 115, 101, 116, 46, 34, 44, 34, 98, 117, 105, 108, 100, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 66, 117, 105, 108, 100, 115, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 102, 111, 114, 32, 116, 104, 101, 32, 115, 112, 101, 99, 105, 102, 105, 101, 100, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 102, 97, 117, 99, 101, 116, 32, 97, 110, 100, 92, 110, 100, 97, 116, 97, 45, 104, 97, 115, 104, 46, 92, 110, 102, 97, 117, 99, 101, 116, 95, 105, 100, 32, 105, 115, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 111, 32, 99, 114, 101, 97, 116, 101, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 102, 111, 114, 46, 92, 110, 100, 97, 116, 97, 45, 104, 97, 115, 104, 32, 105, 115, 32, 116, 104, 101, 32, 100, 97, 116, 97, 32, 104, 97, 115, 104, 32, 111, 102, 32, 116, 104, 101, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 98, 117, 105, 108, 100, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 99, 114, 101, 97, 116, 101, 100, 32, 97, 115, 115, 101, 116, 46, 34, 44, 34, 99, 114, 101, 97, 116, 101, 45, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 67, 114, 101, 97, 116, 101, 115, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 102, 111, 114, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 104, 101, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 32, 98, 101, 105, 110, 103, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 97, 103, 97, 105, 110, 115, 116, 46, 92, 110, 100, 97, 116, 97, 45, 104, 97, 115, 104, 32, 105, 115, 32, 116, 104, 101, 32, 100, 97, 116, 97, 32, 104, 97, 115, 104, 32, 111, 102, 32, 116, 104, 101, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 99, 114, 101, 97, 116, 101, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 99, 114, 101, 97, 116, 101, 100, 32, 97, 115, 115, 101, 116, 46, 34, 125, 125, 44, 34, 102, 97, 117, 99, 101, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 70, 97, 117, 99, 101, 116, 45, 114, 101, 108, 97, 116, 101, 100, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 46, 32, 84, 104, 101, 115, 101, 32, 102, 117, 110, 99, 116, 105, 111, 110, 115, 32, 99, 97, 110, 32, 111, 110, 108, 121, 32, 98, 101, 32, 99, 97, 108, 108, 101, 100, 32, 98, 121, 32, 102, 97, 117, 99, 101, 116, 32, 97, 99, 99, 111, 117, 110, 116, 115, 46, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 109, 105, 110, 116, 34, 58, 34, 77, 105, 110, 116, 32, 97, 110, 32, 97, 115, 115, 101, 116, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 32, 98, 101, 105, 110, 103, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 97, 103, 97, 105, 110, 115, 116, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 109, 105, 110, 116, 101, 100, 32, 97, 115, 115, 101, 116, 46, 34, 44, 34, 98, 117, 114, 110, 34, 58, 34, 66, 117, 114, 110, 32, 97, 110, 32, 97, 115, 115, 101, 116, 32, 102, 114, 111, 109, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 32, 98, 101, 105, 110, 103, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 97, 103, 97, 105, 110, 115, 116, 46, 92, 110, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 98, 117, 114, 110, 101, 100, 32, 97, 115, 115, 101, 116, 46, 34, 44, 34, 103, 101, 116, 45, 116, 111, 116, 97, 108, 45, 105, 115, 115, 117, 97, 110, 99, 101, 34, 58, 34, 82, 101, 116, 117, 114, 110, 115, 32, 116, 104, 101, 32, 116, 111, 116, 97, 108, 32, 105, 115, 115, 117, 97, 110, 99, 101, 32, 111, 102, 32, 116, 104, 101, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 102, 97, 117, 99, 101, 116, 32, 116, 104, 101, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 92, 110, 98, 101, 105, 110, 103, 32, 101, 120, 101, 99, 117, 116, 101, 100, 32, 97, 103, 97, 105, 110, 115, 116, 46, 32, 80, 97, 110, 105, 99, 115, 32, 105, 102, 32, 116, 104, 101, 32, 116, 114, 97, 110, 115, 97, 99, 116, 105, 111, 110, 32, 105, 115, 32, 110, 111, 116, 32, 98, 101, 105, 110, 103, 32, 101, 120, 101, 99, 117, 116, 101, 100, 92, 110, 97, 103, 97, 105, 110, 115, 116, 32, 97, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 102, 97, 117, 99, 101, 116, 46, 34, 125, 125, 44, 34, 116, 121, 112, 101, 115, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 72, 105, 103, 104, 45, 108, 101, 118, 101, 108, 32, 114, 101, 112, 114, 101, 115, 101, 110, 116, 97, 116, 105, 111, 110, 32, 111, 102, 32, 99, 111, 114, 101, 32, 116, 121, 112, 101, 115, 34, 44, 34, 102, 117, 110, 99, 115, 34, 58, 123, 34, 102, 114, 111, 109, 45, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 67, 111, 110, 118, 101, 114, 116, 115, 32, 97, 32, 99, 111, 114, 101, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 97, 32, 97, 110, 32, 97, 115, 115, 101, 116, 32, 114, 101, 112, 114, 101, 115, 101, 110, 116, 97, 116, 105, 111, 110, 46, 34, 44, 34, 116, 111, 45, 99, 111, 114, 101, 45, 97, 115, 115, 101, 116, 34, 58, 34, 67, 111, 110, 118, 101, 114, 116, 115, 32, 97, 110, 32, 97, 115, 115, 101, 116, 32, 116, 111, 32, 97, 32, 99, 111, 114, 101, 32, 97, 115, 115, 101, 116, 32, 114, 101, 112, 114, 101, 115, 101, 110, 116, 97, 116, 105, 111, 110, 46, 34, 125, 44, 34, 116, 121, 112, 101, 115, 34, 58, 123, 34, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 34, 44, 34, 105, 116, 101, 109, 115, 34, 58, 123, 34, 97, 115, 115, 101, 116, 34, 58, 34, 70, 97, 117, 99, 101, 116, 32, 73, 68, 32, 111, 102, 32, 116, 104, 101, 32, 102, 97, 117, 99, 101, 116, 32, 119, 104, 105, 99, 104, 32, 105, 115, 115, 117, 101, 100, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 97, 115, 32, 119, 101, 108, 108, 32, 97, 115, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 32, 97, 109, 111, 117, 110, 116, 46, 34, 44, 34, 97, 109, 111, 117, 110, 116, 34, 58, 34, 65, 115, 115, 101, 116, 32, 97, 109, 111, 117, 110, 116, 32, 105, 115, 32, 103, 117, 97, 114, 97, 110, 116, 101, 101, 100, 32, 116, 111, 32, 98, 101, 32, 50, 94, 54, 51, 32, 45, 32, 49, 32, 111, 114, 32, 115, 109, 97, 108, 108, 101, 114, 46, 34, 125, 125, 44, 34, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 45, 97, 115, 115, 101, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 32, 99, 111, 109, 109, 105, 116, 109, 101, 110, 116, 32, 116, 111, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 92, 110, 92, 110, 65, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 32, 99, 111, 110, 115, 105, 115, 116, 115, 32, 111, 102, 32, 52, 32, 102, 105, 101, 108, 100, 32, 101, 108, 101, 109, 101, 110, 116, 115, 32, 119, 104, 105, 99, 104, 32, 97, 114, 101, 32, 99, 111, 109, 112, 117, 116, 101, 100, 32, 98, 121, 32, 104, 97, 115, 104, 105, 110, 103, 32, 97, 115, 115, 101, 116, 32, 100, 97, 116, 97, 92, 110, 40, 119, 104, 105, 99, 104, 32, 99, 97, 110, 32, 98, 101, 32, 111, 102, 32, 97, 114, 98, 105, 116, 114, 97, 114, 121, 32, 108, 101, 110, 103, 116, 104, 41, 32, 116, 111, 32, 112, 114, 111, 100, 117, 99, 101, 58, 32, 91, 100, 48, 44, 32, 100, 49, 44, 32, 100, 50, 44, 32, 100, 51, 93, 46, 32, 32, 87, 101, 32, 116, 104, 101, 110, 32, 114, 101, 112, 108, 97, 99, 101, 32, 100, 49, 32, 119, 105, 116, 104, 32, 116, 104, 101, 92, 110, 102, 97, 117, 99, 101, 116, 95, 105, 100, 32, 116, 104, 97, 116, 32, 105, 115, 115, 117, 101, 100, 32, 116, 104, 101, 32, 97, 115, 115, 101, 116, 58, 32, 91, 100, 48, 44, 32, 102, 97, 117, 99, 101, 116, 95, 105, 100, 44, 32, 100, 50, 44, 32, 100, 51, 93, 46, 32, 87, 101, 32, 116, 104, 101, 110, 32, 115, 101, 116, 32, 116, 104, 101, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 98, 105, 116, 92, 110, 111, 102, 32, 116, 104, 101, 32, 109, 111, 115, 116, 32, 115, 105, 103, 110, 105, 102, 105, 99, 97, 110, 116, 32, 101, 108, 101, 109, 101, 110, 116, 32, 116, 111, 32, 90, 69, 82, 79, 46, 34, 125, 44, 34, 97, 115, 115, 101, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 65, 32, 102, 117, 110, 103, 105, 98, 108, 101, 32, 111, 114, 32, 97, 32, 110, 111, 110, 45, 102, 117, 110, 103, 105, 98, 108, 101, 32, 97, 115, 115, 101, 116, 46, 34, 125, 125, 125, 44, 34, 110, 111, 116, 101, 45, 115, 99, 114, 105, 112, 116, 34, 58, 123, 34, 100, 111, 99, 115, 34, 58, 34, 78, 111, 116, 101, 32, 115, 99, 114, 105, 112, 116, 32, 105, 110, 116, 101, 114, 102, 97, 99, 101, 32, 116, 104, 97, 116, 32, 105, 115, 32, 101, 120, 112, 101, 99, 116, 101, 100, 32, 116, 111, 32, 98, 101, 32, 105, 109, 112, 108, 101, 109, 101, 110, 116, 101, 100, 32, 98, 121, 32, 116, 104, 101, 32, 110, 111, 116, 101, 32, 115, 99, 114, 105, 112, 116, 46, 34, 125, 125, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 54, 46, 48]; +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.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] #[cfg(target_arch = "wasm32")] -pub fn __link_section() {} +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 index cd520ed57..d13032ba0 100644 --- a/tests/rust-apps-wasm/wit-sdk/sdk/src/lib.rs +++ b/tests/rust-apps-wasm/wit-sdk/sdk/src/lib.rs @@ -8,12 +8,16 @@ fn my_panic(_info: &core::panic::PanicInfo) -> ! { loop {} } +bindings::export!(Component with_types_in bindings); + mod bindings; -use bindings::exports::miden::base::core_types; -use bindings::exports::miden::base::core_types::{AccountId, CoreAsset, Felt}; -use bindings::exports::miden::base::types; -use bindings::exports::miden::base::types::Asset; +use bindings::exports::miden::base::{ + core_types, + core_types::{AccountId, CoreAsset, Felt}, + types, + types::Asset, +}; pub struct Component; diff --git a/tools/cargo-miden/Cargo.toml b/tools/cargo-miden/Cargo.toml index 3d27ed490..c4a7410bc 100644 --- a/tools/cargo-miden/Cargo.toml +++ b/tools/cargo-miden/Cargo.toml @@ -32,7 +32,7 @@ anyhow.workspace = true cargo-component = "0.6" cargo-component-core = "0.6" cargo_metadata = "0.18" -cargo-generate = "0.20" +cargo-generate = "0.21" semver = "1.0.20" parse_arg = "0.1.4" path-absolutize = "3.1.1" diff --git a/tools/cargo-miden/README.md b/tools/cargo-miden/README.md index ff37398e2..95729e506 100644 --- a/tools/cargo-miden/README.md +++ b/tools/cargo-miden/README.md @@ -7,13 +7,13 @@ This crate provides a cargo extension that allows you to compile Rust code to Mi In order to install(build) the extension, you need to have the nightly Rust toolchain installed: ```bash -rustup toolchain install nightly-2024-03-10 +rustup toolchain install nightly-2024-05-15 ``` To install the extension, run: ```bash -cargo +nightly-2024-03-10 install cargo-miden +cargo +nightly-2024-05-15 install cargo-miden ``` ## Usage From 6146460c807ad2584252c1fb63a6571fc402bb3a Mon Sep 17 00:00:00 2001 From: Denys Zadorozhnyi Date: Wed, 31 Jul 2024 08:26:06 +0300 Subject: [PATCH 3/3] chore: switch from `wasm32-wasi` to `wasm32-wasip1` target In rust 1.78 `wasm32-wasi` target is renamed to `wasm32-wasip1`. See https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html --- Makefile.toml | 4 +++- sdk/.cargo/config.toml | 2 +- .../miden_sdk_account_test.hir | 16 ++++++++-------- .../miden_sdk_account_test.wat | 10 +++++----- tests/integration/src/compiler_test.rs | 6 ++++-- tools/cargo-miden/src/target.rs | 12 ++++++------ 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index f9a50d37c..ec309b721 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -200,7 +200,9 @@ args = ["target", "add", "wasm32-unknown-unknown"] category = "Test" description = "Install wasm32-wasi target" command = "rustup" -args = ["target", "add", "wasm32-wasi"] +# `wasm32-wasi` target is renamed to `wasm32-wasip1` +# https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html +args = ["target", "add", "wasm32-wasip1"] [tasks.install-rust-src] category = "Test" diff --git a/sdk/.cargo/config.toml b/sdk/.cargo/config.toml index bc255e30b..dc0be7321 100644 --- a/sdk/.cargo/config.toml +++ b/sdk/.cargo/config.toml @@ -1,2 +1,2 @@ [build] -target = "wasm32-wasi" \ No newline at end of file +target = "wasm32-wasip1" \ No newline at end of file diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir index 244044fd4..4501ffce9 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.hir @@ -2908,6 +2908,14 @@ (block 1) ) + (func (export #core::slice::::copy_from_slice::len_mismatch_fail) + (param i32) (param i32) (param i32) + (block 0 (param v0 i32) (param v1 i32) (param v2 i32) + (unreachable)) + + (block 1) + ) + (func (export #core::slice::::copy_from_slice) (param i32) (param i32) (param i32) (param i32) (param i32) (block 0 @@ -2936,14 +2944,6 @@ (ret)) ) - (func (export #core::slice::::copy_from_slice::len_mismatch_fail) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (unreachable)) - - (block 1) - ) - (func (export #get_wallet_magic_number.command_export) (result felt) (block 0 (let (v1 felt) (call #get_wallet_magic_number)) diff --git a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat index ea52b1295..bb8424091 100644 --- a/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat +++ b/tests/integration/expected/rust_sdk_account_test/miden_sdk_account_test.wat @@ -1778,7 +1778,11 @@ unreachable unreachable ) - (func $core::slice::::copy_from_slice (;64;) (type 27) (param i32 i32 i32 i32 i32) + (func $core::slice::::copy_from_slice::len_mismatch_fail (;64;) (type 19) (param i32 i32 i32) + unreachable + unreachable + ) + (func $core::slice::::copy_from_slice (;65;) (type 27) (param i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 local.get 3 @@ -1796,10 +1800,6 @@ call $core::slice::::copy_from_slice::len_mismatch_fail unreachable ) - (func $core::slice::::copy_from_slice::len_mismatch_fail (;65;) (type 19) (param i32 i32 i32) - unreachable - unreachable - ) (func $get_wallet_magic_number.command_export (;66;) (type 11) (result f32) call $get_wallet_magic_number call $__wasm_call_dtors diff --git a/tests/integration/src/compiler_test.rs b/tests/integration/src/compiler_test.rs index 3dec89137..ce9de54d8 100644 --- a/tests/integration/src/compiler_test.rs +++ b/tests/integration/src/compiler_test.rs @@ -23,6 +23,8 @@ use crate::cargo_proj::project; type LinkMasmModules = Vec<(LibraryPath, String)>; +pub const WASM32_WASI_TARGET: &str = "wasm32-wasip1"; + pub enum CompilerTestSource { Rust(String), RustCargo { @@ -213,7 +215,7 @@ impl CompilerTest { .arg("--manifest-path") .arg(manifest_path) .arg("--release") - .arg("--target=wasm32-wasi"); + .arg(format!("--target={}", WASM32_WASI_TARGET)); if is_build_std { // compile std as part of crate graph compilation // https://doc.rust-lang.org/cargo/reference/unstable.html#build-std @@ -630,7 +632,7 @@ fn wasm_artifact_path(cargo_project_folder: &Path, artifact_name: &str) -> PathB cargo_project_folder .to_path_buf() .join("target") - .join("wasm32-wasi") + .join(WASM32_WASI_TARGET) .join("release") .join(artifact_name) .with_extension("wasm") diff --git a/tools/cargo-miden/src/target.rs b/tools/cargo-miden/src/target.rs index 3088396ae..51d257d1f 100644 --- a/tools/cargo-miden/src/target.rs +++ b/tools/cargo-miden/src/target.rs @@ -6,20 +6,20 @@ use std::{ use anyhow::{bail, Result}; -pub const WASM32_WASI_TARGET: &str = "wasm32-wasi"; +pub const WASM32_WASI_TARGET: &str = "wasm32-wasip1"; pub fn install_wasm32_wasi() -> Result<()> { log::info!("Installing {WASM32_WASI_TARGET} target"); let sysroot = get_sysroot()?; - if sysroot.join("lib/rustlib/wasm32-wasi").exists() { + if sysroot.join(format!("lib/rustlib/{}", WASM32_WASI_TARGET)).exists() { return Ok(()); } if env::var_os("RUSTUP_TOOLCHAIN").is_none() { bail!( - "failed to find the `wasm32-wasi` target and `rustup` is not available. If you're \ - using rustup make sure that it's correctly installed; if not, make sure to install \ - the `wasm32-wasi` target before using this command" + "failed to find the `{WASM32_WASI_TARGET}` target and `rustup` is not available. If \ + you're using rustup make sure that it's correctly installed; if not, make sure to \ + install the `{WASM32_WASI_TARGET}` target before using this command", ); } @@ -32,7 +32,7 @@ pub fn install_wasm32_wasi() -> Result<()> { .output()?; if !output.status.success() { - bail!("failed to install the `wasm32-wasi` target"); + bail!("failed to install the `{WASM32_WASI_TARGET}` target"); } Ok(())