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 64e441a26..16cb9a16e 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 @@ -177,58 +177,59 @@ (assertz 250 v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 i1) (eq v19 0)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 2) (block 3))) + (let (v20 i32) (const.i32 1)) + (let (v21 i1) (neq v19 v20)) + (let (v22 i32) (zext v21)) + (let (v23 i1) (neq v22 0)) + (condbr v23 (block 2) (block 3))) (block 1 (ret)) (block 2 - (let (v28 u32) (bitcast v4)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 4)) - (let (v34 u32) (bitcast v32)) + (let (v29 u32) (bitcast v4)) + (let (v30 u32) (add.checked v29 12)) + (let (v31 u32) (mod.unchecked v30 4)) + (assertz 250 v31) + (let (v32 (ptr i32)) (inttoptr v30)) + (let (v33 i32) (load v32)) + (let (v34 i32) (const.i32 4)) (let (v35 u32) (bitcast v33)) - (let (v36 u32) (shr.wrapping v34 v35)) - (let (v37 i32) (bitcast v36)) - (let [(v38 i32) (v39 i32)] (call (#miden::note #get_inputs) v37)) - (let (v40 u32) (bitcast v0)) - (let (v41 u32) (add.checked v40 8)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (store v43 v38) - (let (v44 u32) (bitcast v0)) - (let (v45 u32) (add.checked v44 4)) - (let (v46 u32) (mod.unchecked v45 4)) - (assertz 250 v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (store v47 v32) - (let (v48 u32) (bitcast v0)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (store v50 v14) - (let (v51 i32) (const.i32 16)) - (let (v52 i32) (add.wrapping v4 v51)) - (let (v53 (ptr i32)) (global.symbol #__stack_pointer)) - (store v53 v52) + (let (v36 u32) (bitcast v34)) + (let (v37 u32) (shr.wrapping v35 v36)) + (let (v38 i32) (bitcast v37)) + (let [(v39 i32) (v40 i32)] (call (#miden::note #get_inputs) v38)) + (let (v41 u32) (bitcast v0)) + (let (v42 u32) (add.checked v41 8)) + (let (v43 u32) (mod.unchecked v42 4)) + (assertz 250 v43) + (let (v44 (ptr i32)) (inttoptr v42)) + (store v44 v39) + (let (v45 u32) (bitcast v0)) + (let (v46 u32) (add.checked v45 4)) + (let (v47 u32) (mod.unchecked v46 4)) + (assertz 250 v47) + (let (v48 (ptr i32)) (inttoptr v46)) + (store v48 v33) + (let (v49 u32) (bitcast v0)) + (let (v50 u32) (mod.unchecked v49 4)) + (assertz 250 v50) + (let (v51 (ptr i32)) (inttoptr v49)) + (store v51 v14) + (let (v52 i32) (const.i32 16)) + (let (v53 i32) (add.wrapping v4 v52)) + (let (v54 (ptr i32)) (global.symbol #__stack_pointer)) + (store v54 v53) (br (block 1))) (block 3 - (let (v23 u32) (bitcast v4)) - (let (v24 u32) (add.checked v23 12)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (call #alloc::raw_vec::handle_error v14 v27) + (let (v24 u32) (bitcast v4)) + (let (v25 u32) (add.checked v24 12)) + (let (v26 u32) (mod.unchecked v25 4)) + (assertz 250 v26) + (let (v27 (ptr i32)) (inttoptr v25)) + (let (v28 i32) (load v27)) + (call #alloc::raw_vec::handle_error v14 v28) (unreachable)) ) 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 ed2b96ea5..f96d217e3 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 @@ -63,7 +63,8 @@ export."miden_base_sys::bindings::tx::get_inputs" movup.2 u32div.16 exec.::intrinsics::mem::load_sw - eq.0 + push.1 + neq neq.0 if.true dup.1 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 23e004675..435d4d2c0 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 @@ -101,7 +101,6 @@ return end unreachable - unreachable ) (func $miden_base_sys::bindings::tx::get_inputs (;6;) (type 2) (param i32) (local i32 i32 i32) @@ -122,7 +121,8 @@ block ;; label = @1 local.get 1 i32.load offset=4 - i32.eqz + i32.const 1 + i32.ne br_if 0 (;@1;) local.get 2 local.get 1 @@ -225,7 +225,6 @@ ) (func $alloc::raw_vec::handle_error (;8;) (type 6) (param i32 i32) unreachable - unreachable ) (table (;0;) 1 1 funcref) (memory (;0;) 17) diff --git a/tests/integration/expected/components/add_wasm_component.hir b/tests/integration/expected/components/add_wasm_component.hir index 2f034ae9f..9935425c3 100644 --- a/tests/integration/expected/components/add_wasm_component.hir +++ b/tests/integration/expected/components/add_wasm_component.hir @@ -2,7 +2,7 @@ ;; Modules (module #add_wasm_component ;; Data Segments - (data (mut) (offset 1048576) 0x01000000) + (data (mut) (offset 1048576) 0x0100000002000000) ;; Constants (const (id 0) 0x00100000) @@ -19,9 +19,18 @@ (ret)) ) + (func (export #add_wasm_component::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048580)) + (let (v3 i32) (const.i32 1048584)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -33,7 +42,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 1048580)) + (let (v6 i32) (const.i32 1048584)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -58,7 +67,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048580)) + (let (v21 i32) (const.i32 1048584)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -103,7 +112,7 @@ (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048584)) + (let (v11 u32) (add.checked v10 1048588)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) @@ -118,7 +127,7 @@ (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048585)) + (let (v2 u32) (add.checked v1 1048589)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -138,7 +147,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048585)) + (let (v12 u32) (add.checked v11 1048589)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -835,8 +844,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -847,61 +856,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) - - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) + + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -909,173 +900,181 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) + (let (v79 u32) (bitcast v75)) + (let (v80 u32) (mod.unchecked v79 4)) + (assertz 250 v80) + (let (v81 (ptr i32)) (inttoptr v79)) + (let (v82 i32) (load v81)) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #cabi_realloc) diff --git a/tests/integration/expected/components/add_wasm_component.wat b/tests/integration/expected/components/add_wasm_component.wat index 1034420f1..218186cbd 100644 --- a/tests/integration/expected/components/add_wasm_component.wat +++ b/tests/integration/expected/components/add_wasm_component.wat @@ -6,16 +6,17 @@ (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 $__rust_alloc (;1;) (type 1) (param i32 i32) (result i32) - i32.const 1048580 + (func $add_wasm_component::bindings::__link_custom_section_describing_imports (;1;) (type 0)) + (func $__rust_alloc (;2;) (type 1) (param i32 i32) (result i32) + i32.const 1048584 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;2;) (type 2) (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 1048580 + i32.const 1048584 local.get 2 local.get 3 call $::alloc @@ -31,7 +32,7 @@ i32.lt_u select memory.copy - i32.const 1048580 + i32.const 1048584 local.get 0 local.get 2 local.get 1 @@ -39,13 +40,13 @@ end local.get 4 ) - (func $miden:add-package/add-interface@1.0.0#add (;3;) (type 1) (param i32 i32) (result i32) + (func $miden:add-package/add-interface@1.0.0#add (;4;) (type 1) (param i32 i32) (result i32) call $wit_bindgen_rt::run_ctors_once local.get 1 local.get 0 i32.add ) - (func $wit_bindgen_rt::cabi_realloc (;4;) (type 2) (param i32 i32 i32 i32) (result i32) + (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 @@ -55,7 +56,7 @@ i32.eqz br_if 2 (;@1;) i32.const 0 - i32.load8_u offset=1048584 + i32.load8_u offset=1048588 drop local.get 3 local.get 2 @@ -73,22 +74,21 @@ local.get 2 br_if 0 (;@1;) unreachable - unreachable end local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;5;) (type 0) + (func $wit_bindgen_rt::run_ctors_once (;6;) (type 0) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048585 + i32.load8_u offset=1048589 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048585 + i32.store8 offset=1048589 end ) - (func $wee_alloc::alloc_first_fit (;6;) (type 3) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;7;) (type 3) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -393,7 +393,7 @@ end i32.const 0 ) - (func $::alloc (;7;) (type 3) (param i32 i32 i32) (result i32) + (func $::alloc (;8;) (type 3) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -497,7 +497,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;8;) (type 4) (param i32 i32 i32 i32) + (func $::dealloc (;9;) (type 4) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -527,39 +527,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -640,18 +623,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -670,22 +663,22 @@ i32.store end ) - (func $cabi_realloc (;9;) (type 2) (param i32 i32 i32 i32) (result i32) + (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;) 2 2 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:add-package/add-interface@1.0.0#add" (func $miden:add-package/add-interface@1.0.0#add)) (export "cabi_realloc" (func $cabi_realloc)) (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") + (elem (;0;) (i32.const 1) func $add_wasm_component::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\02\00\00\00") ) (core instance (;0;) (instantiate 0)) (alias core export 0 "memory" (core memory (;0;))) diff --git a/tests/integration/expected/components/inc_wasm_component.hir b/tests/integration/expected/components/inc_wasm_component.hir index a3c5cbb78..fab68e3f4 100644 --- a/tests/integration/expected/components/inc_wasm_component.hir +++ b/tests/integration/expected/components/inc_wasm_component.hir @@ -5,7 +5,7 @@ ;; Modules (module #inc_wasm_component ;; Data Segments - (data (mut) (offset 1048576) 0x01000000) + (data (mut) (offset 1048576) 0x0100000002000000) ;; Constants (const (id 0) 0x00100000) @@ -22,9 +22,18 @@ (ret)) ) + (func (export #inc_wasm_component::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048580)) + (let (v3 i32) (const.i32 1048584)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -36,7 +45,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 1048580)) + (let (v6 i32) (const.i32 1048584)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -61,7 +70,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048580)) + (let (v21 i32) (const.i32 1048584)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -106,7 +115,7 @@ (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048584)) + (let (v11 u32) (add.checked v10 1048588)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) @@ -121,7 +130,7 @@ (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048585)) + (let (v2 u32) (add.checked v1 1048589)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -141,7 +150,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048585)) + (let (v12 u32) (add.checked v11 1048589)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -838,8 +847,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -850,61 +859,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) - - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) + + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -912,173 +903,181 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) + (let (v79 u32) (bitcast v75)) + (let (v80 u32) (mod.unchecked v79 4)) + (assertz 250 v80) + (let (v81 (ptr i32)) (inttoptr v79)) + (let (v82 i32) (load v81)) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #cabi_realloc) diff --git a/tests/integration/expected/components/inc_wasm_component.wat b/tests/integration/expected/components/inc_wasm_component.wat index bd5c00de8..1e52129d8 100644 --- a/tests/integration/expected/components/inc_wasm_component.wat +++ b/tests/integration/expected/components/inc_wasm_component.wat @@ -15,16 +15,17 @@ (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 $__rust_alloc (;2;) (type 0) (param i32 i32) (result i32) - i32.const 1048580 + (func $inc_wasm_component::bindings::__link_custom_section_describing_imports (;2;) (type 1)) + (func $__rust_alloc (;3;) (type 0) (param i32 i32) (result i32) + i32.const 1048584 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;3;) (type 2) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;4;) (type 2) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048580 + i32.const 1048584 local.get 2 local.get 3 call $::alloc @@ -40,7 +41,7 @@ i32.lt_u select memory.copy - i32.const 1048580 + i32.const 1048584 local.get 0 local.get 2 local.get 1 @@ -48,13 +49,13 @@ end local.get 4 ) - (func $inc (;4;) (type 3) (param i32) (result i32) + (func $inc (;5;) (type 3) (param i32) (result i32) call $wit_bindgen_rt::run_ctors_once local.get 0 i32.const 1 call $inc_wasm_component::bindings::miden::add_package::add_interface::add::wit_import ) - (func $wit_bindgen_rt::cabi_realloc (;5;) (type 2) (param i32 i32 i32 i32) (result i32) + (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 @@ -64,7 +65,7 @@ i32.eqz br_if 2 (;@1;) i32.const 0 - i32.load8_u offset=1048584 + i32.load8_u offset=1048588 drop local.get 3 local.get 2 @@ -82,22 +83,21 @@ local.get 2 br_if 0 (;@1;) unreachable - unreachable end local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;6;) (type 1) + (func $wit_bindgen_rt::run_ctors_once (;7;) (type 1) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048585 + i32.load8_u offset=1048589 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048585 + i32.store8 offset=1048589 end ) - (func $wee_alloc::alloc_first_fit (;7;) (type 4) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;8;) (type 4) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -402,7 +402,7 @@ end i32.const 0 ) - (func $::alloc (;8;) (type 4) (param i32 i32 i32) (result i32) + (func $::alloc (;9;) (type 4) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -506,7 +506,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;9;) (type 5) (param i32 i32 i32 i32) + (func $::dealloc (;10;) (type 5) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -536,39 +536,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -649,18 +632,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -679,22 +672,22 @@ i32.store end ) - (func $cabi_realloc (;10;) (type 2) (param i32 i32 i32 i32) (result i32) + (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;) 2 2 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "inc" (func $inc)) (export "cabi_realloc" (func $cabi_realloc)) (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") + (elem (;0;) (i32.const 1) func $inc_wasm_component::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\02\00\00\00") ) (alias export 0 "add" (func (;0;))) (core func (;0;) (canon lower (func 0))) 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 72a2e81c9..e32e397f6 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 @@ -748,58 +748,59 @@ (assertz 250 v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 i1) (eq v19 0)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 2) (block 3))) + (let (v20 i32) (const.i32 1)) + (let (v21 i1) (neq v19 v20)) + (let (v22 i32) (zext v21)) + (let (v23 i1) (neq v22 0)) + (condbr v23 (block 2) (block 3))) (block 1 (ret)) (block 2 - (let (v28 u32) (bitcast v4)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 4)) - (let (v34 u32) (bitcast v32)) + (let (v29 u32) (bitcast v4)) + (let (v30 u32) (add.checked v29 12)) + (let (v31 u32) (mod.unchecked v30 4)) + (assertz 250 v31) + (let (v32 (ptr i32)) (inttoptr v30)) + (let (v33 i32) (load v32)) + (let (v34 i32) (const.i32 4)) (let (v35 u32) (bitcast v33)) - (let (v36 u32) (shr.wrapping v34 v35)) - (let (v37 i32) (bitcast v36)) - (let [(v38 i32) (v39 i32)] (call (#miden::note #get_inputs) v37)) - (let (v40 u32) (bitcast v0)) - (let (v41 u32) (add.checked v40 8)) - (let (v42 u32) (mod.unchecked v41 4)) - (assertz 250 v42) - (let (v43 (ptr i32)) (inttoptr v41)) - (store v43 v38) - (let (v44 u32) (bitcast v0)) - (let (v45 u32) (add.checked v44 4)) - (let (v46 u32) (mod.unchecked v45 4)) - (assertz 250 v46) - (let (v47 (ptr i32)) (inttoptr v45)) - (store v47 v32) - (let (v48 u32) (bitcast v0)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (store v50 v14) - (let (v51 i32) (const.i32 16)) - (let (v52 i32) (add.wrapping v4 v51)) - (let (v53 (ptr i32)) (global.symbol #__stack_pointer)) - (store v53 v52) + (let (v36 u32) (bitcast v34)) + (let (v37 u32) (shr.wrapping v35 v36)) + (let (v38 i32) (bitcast v37)) + (let [(v39 i32) (v40 i32)] (call (#miden::note #get_inputs) v38)) + (let (v41 u32) (bitcast v0)) + (let (v42 u32) (add.checked v41 8)) + (let (v43 u32) (mod.unchecked v42 4)) + (assertz 250 v43) + (let (v44 (ptr i32)) (inttoptr v42)) + (store v44 v39) + (let (v45 u32) (bitcast v0)) + (let (v46 u32) (add.checked v45 4)) + (let (v47 u32) (mod.unchecked v46 4)) + (assertz 250 v47) + (let (v48 (ptr i32)) (inttoptr v46)) + (store v48 v33) + (let (v49 u32) (bitcast v0)) + (let (v50 u32) (mod.unchecked v49 4)) + (assertz 250 v50) + (let (v51 (ptr i32)) (inttoptr v49)) + (store v51 v14) + (let (v52 i32) (const.i32 16)) + (let (v53 i32) (add.wrapping v4 v52)) + (let (v54 (ptr i32)) (global.symbol #__stack_pointer)) + (store v54 v53) (br (block 1))) (block 3 - (let (v23 u32) (bitcast v4)) - (let (v24 u32) (add.checked v23 12)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (call #alloc::raw_vec::handle_error v14 v27) + (let (v24 u32) (bitcast v4)) + (let (v25 u32) (add.checked v24 12)) + (let (v26 u32) (mod.unchecked v25 4)) + (assertz 250 v26) + (let (v27 (ptr i32)) (inttoptr v25)) + (let (v28 i32) (load v27)) + (call #alloc::raw_vec::handle_error v14 v28) (unreachable)) ) @@ -978,53 +979,54 @@ (assertz 250 v17) (let (v18 (ptr i32)) (inttoptr v16)) (let (v19 i32) (load v18)) - (let (v20 i1) (eq v19 0)) - (let (v21 i32) (zext v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 2) (block 3))) + (let (v20 i32) (const.i32 1)) + (let (v21 i1) (neq v19 v20)) + (let (v22 i32) (zext v21)) + (let (v23 i1) (neq v22 0)) + (condbr v23 (block 2) (block 3))) (block 1 (ret)) (block 2 - (let (v28 u32) (bitcast v5)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (let (v32 i32) (load v31)) - (let (v33 i32) (const.i32 0)) - (let (v34 u32) (bitcast v0)) - (let (v35 u32) (add.checked v34 8)) - (let (v36 u32) (mod.unchecked v35 4)) - (assertz 250 v36) - (let (v37 (ptr i32)) (inttoptr v35)) - (store v37 v33) - (let (v38 u32) (bitcast v0)) - (let (v39 u32) (add.checked v38 4)) - (let (v40 u32) (mod.unchecked v39 4)) - (assertz 250 v40) - (let (v41 (ptr i32)) (inttoptr v39)) - (store v41 v32) - (let (v42 u32) (bitcast v0)) - (let (v43 u32) (mod.unchecked v42 4)) - (assertz 250 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) + (let (v29 u32) (bitcast v5)) + (let (v30 u32) (add.checked v29 12)) + (let (v31 u32) (mod.unchecked v30 4)) + (assertz 250 v31) + (let (v32 (ptr i32)) (inttoptr v30)) + (let (v33 i32) (load v32)) + (let (v34 i32) (const.i32 0)) + (let (v35 u32) (bitcast v0)) + (let (v36 u32) (add.checked v35 8)) + (let (v37 u32) (mod.unchecked v36 4)) + (assertz 250 v37) + (let (v38 (ptr i32)) (inttoptr v36)) + (store v38 v34) + (let (v39 u32) (bitcast v0)) + (let (v40 u32) (add.checked v39 4)) + (let (v41 u32) (mod.unchecked v40 4)) + (assertz 250 v41) + (let (v42 (ptr i32)) (inttoptr v40)) + (store v42 v33) + (let (v43 u32) (bitcast v0)) + (let (v44 u32) (mod.unchecked v43 4)) + (assertz 250 v44) + (let (v45 (ptr i32)) (inttoptr v43)) + (store v45 v14) + (let (v46 i32) (const.i32 16)) + (let (v47 i32) (add.wrapping v5 v46)) + (let (v48 (ptr i32)) (global.symbol #__stack_pointer)) + (store v48 v47) (br (block 1))) (block 3 - (let (v23 u32) (bitcast v5)) - (let (v24 u32) (add.checked v23 12)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (let (v27 i32) (load v26)) - (call #alloc::raw_vec::handle_error v14 v27) + (let (v24 u32) (bitcast v5)) + (let (v25 u32) (add.checked v24 12)) + (let (v26 u32) (mod.unchecked v25 4)) + (assertz 250 v26) + (let (v27 (ptr i32)) (inttoptr v25)) + (let (v28 i32) (load v27)) + (call #alloc::raw_vec::handle_error v14 v28) (unreachable)) ) 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 5c4540ee7..35b85aa4d 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 @@ -487,7 +487,6 @@ return end unreachable - unreachable ) (func $miden_base_sys::bindings::tx::get_id (;45;) (type 12) (result f32) call $miden_base_sys::bindings::tx::externs::extern_account_get_id @@ -511,7 +510,8 @@ block ;; label = @1 local.get 1 i32.load offset=4 - i32.eqz + i32.const 1 + i32.ne br_if 0 (;@1;) local.get 2 local.get 1 @@ -602,7 +602,8 @@ block ;; label = @1 local.get 2 i32.load offset=4 - i32.eqz + i32.const 1 + i32.ne br_if 0 (;@1;) local.get 1 local.get 2 @@ -867,7 +868,6 @@ ) (func $alloc::raw_vec::handle_error (;56;) (type 19) (param i32 i32) unreachable - unreachable ) (func $get_wallet_magic_number.command_export (;57;) (type 12) (result f32) call $get_wallet_magic_number 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 31f31e274..b4b9e1f26 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.hir @@ -40,7 +40,7 @@ (module #basic_wallet ;; Data Segments - (data (mut) (offset 1048576) 0x01000000) + (data (mut) (offset 1048576) 0x0100000001000000010000000100000002000000) ;; Constants (const (id 0) 0x00100000) @@ -57,9 +57,18 @@ (ret)) ) + (func (export #basic_wallet::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048580)) + (let (v3 i32) (const.i32 1048596)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -71,7 +80,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 1048580)) + (let (v6 i32) (const.i32 1048596)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -96,7 +105,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1048580)) + (let (v21 i32) (const.i32 1048596)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -176,55 +185,51 @@ (ret)) ) - (func (export #cabi_realloc_wit_bindgen_0_28_0) + (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 5) (block 6))) - - (block 1 (param v4 i32)) + (condbr v5 (block 4) (block 5))) - (block 2 - (unreachable)) + (block 1 (param v4 i32) + (ret v4)) - (block 3 (param v21 i32) - (ret v21)) + (block 2 (param v19 i32) + (br (block 1 v19))) - (block 4 (param v17 i32) - (let (v18 i1) (eq v17 0)) - (let (v19 i32) (zext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 2) (block 8))) + (block 3 (param v17 i32) + (let (v18 i1) (neq v17 0)) + (condbr v18 (block 2 v17) (block 7))) - (block 5 + (block 4 (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 4 v16))) + (br (block 3 v16))) - (block 6 + (block 5 (let (v6 i1) (eq v3 0)) (let (v7 i32) (zext v6)) (let (v8 i1) (neq v7 0)) - (condbr v8 (block 3 v2) (block 7))) + (condbr v8 (block 2 v2) (block 6))) - (block 7 + (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1048584)) + (let (v11 u32) (add.checked v10 1048600)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 4 v15))) + (br (block 3 v15))) - (block 8 - (br (block 3 v17))) + (block 7 + (unreachable)) ) (func (export #wit_bindgen_rt::run_ctors_once) (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1048585)) + (let (v2 u32) (add.checked v1 1048601)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -244,7 +249,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1048585)) + (let (v12 u32) (add.checked v11 1048601)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -941,8 +946,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -953,61 +958,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) - - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) + + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -1015,179 +1002,187 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) + (let (v79 u32) (bitcast v75)) + (let (v80 u32) (mod.unchecked v79 4)) + (assertz 250 v80) + (let (v81 (ptr i32)) (inttoptr v79)) + (let (v82 i32) (load v81)) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) - (let (v80 u32) (mod.unchecked v79 4)) - (assertz 250 v80) - (let (v81 (ptr i32)) (inttoptr v79)) - (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #cabi_realloc) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #cabi_realloc_wit_bindgen_0_28_0 v0 v1 v2 v3)) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) (br (block 1 v5))) (block 1 (param v4 i32) 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 db91242af..b15c11285 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/basic_wallet.wat @@ -60,16 +60,17 @@ (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 $__rust_alloc (;4;) (type 3) (param i32 i32) (result i32) - i32.const 1048580 + (func $basic_wallet::bindings::__link_custom_section_describing_imports (;4;) (type 2)) + (func $__rust_alloc (;5;) (type 3) (param i32 i32) (result i32) + i32.const 1048596 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;5;) (type 4) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;6;) (type 4) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048580 + i32.const 1048596 local.get 2 local.get 3 call $::alloc @@ -85,7 +86,7 @@ i32.lt_u select memory.copy - i32.const 1048580 + i32.const 1048596 local.get 0 local.get 2 local.get 1 @@ -93,7 +94,7 @@ end local.get 4 ) - (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset (;6;) (type 5) (param i64 i64 i64 i64) + (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset (;7;) (type 5) (param i64 i64 i64 i64) (local i32) global.get $__stack_pointer i32.const 32 @@ -112,7 +113,7 @@ i32.add global.set $__stack_pointer ) - (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;7;) (type 6) (param i64 i64 i64 i64 i64 i64 i64 i64 i64) + (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset (;8;) (type 6) (param i64 i64 i64 i64 i64 i64 i64 i64 i64) (local i32) global.get $__stack_pointer i32.const 32 @@ -146,54 +147,49 @@ i32.add global.set $__stack_pointer ) - (func $cabi_realloc_wit_bindgen_0_28_0 (;8;) (type 4) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;9;) (type 4) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 - block ;; label = @4 - local.get 1 - br_if 0 (;@4;) - local.get 3 - i32.eqz - br_if 2 (;@2;) - i32.const 0 - i32.load8_u offset=1048584 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@3;) - end - local.get 0 local.get 1 - local.get 2 + br_if 0 (;@3;) local.get 3 - call $__rust_realloc + i32.eqz + br_if 2 (;@1;) + i32.const 0 + i32.load8_u offset=1048600 + drop + local.get 3 + local.get 2 + call $__rust_alloc local.set 2 + br 1 (;@2;) end + local.get 0 + local.get 1 local.get 2 - i32.eqz - br_if 1 (;@1;) + local.get 3 + call $__rust_realloc + local.set 2 end local.get 2 - return + br_if 0 (;@1;) + unreachable end - unreachable - unreachable + local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;9;) (type 2) + (func $wit_bindgen_rt::run_ctors_once (;10;) (type 2) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048585 + i32.load8_u offset=1048601 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048585 + i32.store8 offset=1048601 end ) - (func $wee_alloc::alloc_first_fit (;10;) (type 7) (param i32 i32 i32) (result 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 @@ -498,7 +494,7 @@ end i32.const 0 ) - (func $::alloc (;11;) (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 @@ -602,7 +598,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;12;) (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 @@ -632,39 +628,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -745,18 +724,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -775,23 +764,23 @@ i32.store end ) - (func $cabi_realloc (;13;) (type 4) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;14;) (type 4) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 - call $cabi_realloc_wit_bindgen_0_28_0 + call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 2 2 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:basic-wallet/basic-wallet@1.0.0#receive-asset" (func $miden:basic-wallet/basic-wallet@1.0.0#receive-asset)) (export "miden:basic-wallet/basic-wallet@1.0.0#send-asset" (func $miden:basic-wallet/basic-wallet@1.0.0#send-asset)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $cabi_realloc_wit_bindgen_0_28_0)) (export "cabi_realloc" (func $cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00") + (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) + (elem (;0;) (i32.const 1) func $basic_wallet::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00\01\00\00\00\01\00\00\00\02\00\00\00") ) (core module (;1;) (type (;0;) (func (param i64 i64 i64 i64 i32))) 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 fbc1fef55..1cab550a3 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 @@ -30,7 +30,7 @@ (module #basic_wallet_p2id_note ;; Data Segments - (data (mut) (offset 1048576) 0x0100000004000000040000000200000046656c74696e6e6572000000030000000800000008000000040000004163636f756e744964000000030000000800000008000000050000007372632f6c69622e72730000480010000a000000210000002c000000480010000a0000002400000009000000060000000b00000000000000010000000c000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000008800100020000000a8001000120000003d3d213d6d617463686573617373657274696f6e20606c6566742020726967687460206661696c65640a20206c6566743a200a2072696768743a2000d700100010000000e700100017000000fe0010000900000020726967687460206661696c65643a200a20206c6566743a20000000d70010001000000020011000100000003001100009000000fe001000090000003a2000000d0000000c000000040000000e0000000f0000001000000020202020207b202c20207b0a2c0a7d207d6c6962726172792f636f72652f7372632f666d742f6e756d2e7273890110001b00000069000000170000003078303030313032303330343035303630373038303931303131313231333134313531363137313831393230323132323233323432353236323732383239333033313332333333343335333633373338333934303431343234333434343534363437343834393530353135323533353435353536353735383539363036313632363336343635363636373638363937303731373237333734373537363737373837393830383138323833383438353836383738383839393039313932393339343935393639373938393972616e676520737461727420696e64657820206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682000007e021000120000009002100022000000) + (data (mut) (offset 1048576) 0x000000000400000004000000010000000200000046656c7400000000080000000800000003000000696e6e65724163636f756e74496400000000000008000000080000000400000002000000020000000200000002000000020000007372632f6c69622e727300005c0010000a000000210000002c0000005c0010000a000000240000000900000005000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000008c00100020000000ac001000120000003d3d213d6d617463686573617373657274696f6e20606c6566742020726967687460206661696c65640a20206c6566743a200a2072696768743a2000db00100010000000eb00100017000000020110000900000020726967687460206661696c65643a200a20206c6566743a20000000db001000100000002401100010000000340110000900000002011000090000003a200000000000000c000000040000000a0000000b0000000c00000020202020207b202c20207b0a2c0a7d207d636f72652f7372632f666d742f6e756d2e72738d0110001300000066000000170000003078303030313032303330343035303630373038303931303131313231333134313531363137313831393230323132323233323432353236323732383239333033313332333333343335333633373338333934303431343234333434343534363437343834393530353135323533353435353536353735383539363036313632363336343635363636373638363937303731373237333734373537363737373837393830383138323833383438353836383738383839393039313932393339343935393639373938393972616e676520737461727420696e64657820206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682000007a021000120000008c02100022000000) ;; Constants (const (id 0) 0x00100000) @@ -63,12 +63,12 @@ (let (v11 i32) (load v10)) (let (v12 i32) (const.i32 8)) (let (v13 i32) (add.wrapping v6 v12)) - (let (v14 i32) (const.i32 1048620)) + (let (v14 i32) (const.i32 1048621)) (let (v15 i32) (const.i32 9)) (call #core::fmt::Formatter::debug_struct v13 v1 v14 v15) (let (v16 i32) (const.i32 8)) (let (v17 i32) (add.wrapping v6 v16)) - (let (v18 i32) (const.i32 1048596)) + (let (v18 i32) (const.i32 1048616)) (let (v19 i32) (const.i32 5)) (let (v20 i32) (const.i32 1048632)) (let (v21 i32) (call #core::fmt::builders::DebugStruct::field v17 v18 v19 v11 v20)) @@ -120,24 +120,6 @@ (ret v15)) ) - (func (export #core::ptr::drop_in_place) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) - - (block 1 - (ret)) - ) - - (func (export #core::ptr::drop_in_place<&basic_wallet_p2id_note::bindings::miden::base::core_types::AccountId>) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) - - (block 1 - (ret)) - ) - (func (export #core::panicking::assert_failed) (param i32) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) @@ -166,7 +148,7 @@ (let (v20 i32) (const.i32 12)) (let (v21 i32) (add.wrapping v6 v20)) (let (v22 i32) (const.i32 1048576)) - (let (v23 i32) (const.i32 1048676)) + (let (v23 i32) (const.i32 1048696)) (call #core::panicking::assert_failed_inner v16 v18 v19 v21 v22 v2 v23) (unreachable)) @@ -196,14 +178,14 @@ (store v7 v6) (let (v8 i32) (const.i32 8)) (let (v9 i32) (add.wrapping v6 v8)) - (let (v10 i32) (const.i32 1048592)) + (let (v10 i32) (const.i32 1048596)) (let (v11 i32) (const.i32 4)) (call #core::fmt::Formatter::debug_struct v9 v1 v10 v11) (let (v12 i32) (const.i32 8)) (let (v13 i32) (add.wrapping v6 v12)) - (let (v14 i32) (const.i32 1048596)) + (let (v14 i32) (const.i32 1048616)) (let (v15 i32) (const.i32 5)) - (let (v16 i32) (const.i32 1048604)) + (let (v16 i32) (const.i32 1048600)) (let (v17 i32) (call #core::fmt::builders::DebugStruct::field v13 v14 v15 v0 v16)) (let (v18 i32) (call #core::fmt::builders::DebugStruct::finish v17)) (let (v19 i32) (const.i32 16)) @@ -216,9 +198,18 @@ (ret v2)) ) + (func (export #basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports) + + (block 0 + (br (block 1))) + + (block 1 + (ret)) + ) + (func (export #__rust_alloc) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1049284)) + (let (v3 i32) (const.i32 1049280)) (let (v4 i32) (call #::alloc v3 v1 v0)) (br (block 1 v4))) @@ -230,7 +221,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 1049284)) + (let (v6 i32) (const.i32 1049280)) (let (v7 i32) (call #::alloc v6 v2 v3)) (let (v8 i1) (eq v7 0)) (let (v9 i32) (zext v8)) @@ -255,7 +246,7 @@ (let (v19 u32) (bitcast v0)) (let (v20 (ptr u8)) (inttoptr v19)) (memcpy v20 v18 v16) - (let (v21 i32) (const.i32 1049284)) + (let (v21 i32) (const.i32 1049280)) (call #::dealloc v21 v0 v2 v1) (br (block 2 v7))) ) @@ -314,7 +305,7 @@ (block 3 (let (v115 i32) (const.i32 0)) (let (v116 i32) (const.i32 0)) - (let (v117 i32) (const.i32 1048660)) + (let (v117 i32) (const.i32 1048680)) (call #core::panicking::panic_bounds_check v115 v116 v117) (unreachable)) @@ -372,7 +363,7 @@ (condbr v58 (block 6 v26 v18 v5) (block 7))) (block 6 (param v102 i32) (param v105 i32) (param v110 i32) - (let (v101 i32) (const.i32 1049284)) + (let (v101 i32) (const.i32 1049280)) (let (v104 i32) (const.i32 8)) (let (v107 i32) (const.i32 3)) (let (v108 u32) (bitcast v107)) @@ -437,7 +428,7 @@ (condbr v93 (block 8 v89 v90 v95 v97 v103 v106 v111) (block 10))) (block 9 - (let (v94 i32) (const.i32 1049284)) + (let (v94 i32) (const.i32 1049280)) (let (v96 i32) (const.i32 8)) (let (v98 i32) (const.i32 5)) (let (v99 u32) (bitcast v98)) @@ -449,55 +440,51 @@ (br (block 9))) ) - (func (export #cabi_realloc_wit_bindgen_0_28_0) + (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 5) (block 6))) + (condbr v5 (block 4) (block 5))) - (block 1 (param v4 i32)) - - (block 2 - (unreachable)) + (block 1 (param v4 i32) + (ret v4)) - (block 3 (param v21 i32) - (ret v21)) + (block 2 (param v19 i32) + (br (block 1 v19))) - (block 4 (param v17 i32) - (let (v18 i1) (eq v17 0)) - (let (v19 i32) (zext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 2) (block 8))) + (block 3 (param v17 i32) + (let (v18 i1) (neq v17 0)) + (condbr v18 (block 2 v17) (block 7))) - (block 5 + (block 4 (let (v16 i32) (call #__rust_realloc v0 v1 v2 v3)) - (br (block 4 v16))) + (br (block 3 v16))) - (block 6 + (block 5 (let (v6 i1) (eq v3 0)) (let (v7 i32) (zext v6)) (let (v8 i1) (neq v7 0)) - (condbr v8 (block 3 v2) (block 7))) + (condbr v8 (block 2 v2) (block 6))) - (block 7 + (block 6 (let (v9 i32) (const.i32 0)) (let (v10 u32) (bitcast v9)) - (let (v11 u32) (add.checked v10 1049288)) + (let (v11 u32) (add.checked v10 1049284)) (let (v12 (ptr u8)) (inttoptr v11)) (let (v13 u8) (load v12)) (let (v14 i32) (zext v13)) (let (v15 i32) (call #__rust_alloc v3 v2)) - (br (block 4 v15))) + (br (block 3 v15))) - (block 8 - (br (block 3 v17))) + (block 7 + (unreachable)) ) (func (export #wit_bindgen_rt::run_ctors_once) (block 0 (let (v0 i32) (const.i32 0)) (let (v1 u32) (bitcast v0)) - (let (v2 u32) (add.checked v1 1049289)) + (let (v2 u32) (add.checked v1 1049285)) (let (v3 (ptr u8)) (inttoptr v2)) (let (v4 u8) (load v3)) (let (v5 i32) (zext v4)) @@ -517,7 +504,7 @@ (let (v9 u32) (bitcast v8)) (let (v10 u8) (trunc v9)) (let (v11 u32) (bitcast v7)) - (let (v12 u32) (add.checked v11 1049289)) + (let (v12 u32) (add.checked v11 1049285)) (let (v13 (ptr u8)) (inttoptr v12)) (store v13 v10) (br (block 2))) @@ -1214,8 +1201,8 @@ (assertz 250 v28) (let (v29 (ptr i32)) (inttoptr v27)) (store v29 v26) - (let (v30 i32) (const.i32 4)) - (let (v31 i32) (add.wrapping v20 v30)) + (let (v30 i32) (const.i32 -4)) + (let (v31 i32) (add.wrapping v1 v30)) (let (v32 u32) (bitcast v31)) (let (v33 u32) (mod.unchecked v32 4)) (assertz 250 v33) @@ -1226,61 +1213,43 @@ (let (v38 i1) (eq v37 0)) (let (v39 i32) (zext v38)) (let (v40 i1) (neq v39 0)) - (condbr v40 (block 10 v24 v1 v20 v14 v0) (block 11))) + (condbr v40 (block 8 v24 v1 v20 v14 v0) (block 9))) - (block 5 (param v181 i32) (param v187 i32) - (let (v189 u32) (bitcast v181)) - (let (v190 u32) (mod.unchecked v189 4)) - (assertz 250 v190) - (let (v191 (ptr i32)) (inttoptr v189)) - (store v191 v187) + (block 5 (param v177 i32) (param v183 i32) + (let (v185 u32) (bitcast v177)) + (let (v186 u32) (mod.unchecked v185 4)) + (assertz 250 v186) + (let (v187 (ptr i32)) (inttoptr v185)) + (store v187 v183) (br (block 2))) (block 6 - (param v176 i32) - (param v177 i32) - (param v186 i32) - (param v188 i32) - (let (v178 u32) (bitcast v176)) - (let (v179 u32) (mod.unchecked v178 4)) - (assertz 250 v179) - (let (v180 (ptr i32)) (inttoptr v178)) - (store v180 v177) - (br (block 5 v186 v188))) + (param v172 i32) + (param v173 i32) + (param v182 i32) + (param v184 i32) + (let (v174 u32) (bitcast v172)) + (let (v175 u32) (mod.unchecked v174 4)) + (assertz 250 v175) + (let (v176 (ptr i32)) (inttoptr v174)) + (store v176 v173) + (br (block 5 v182 v184))) - (block 7 (param v172 i32) (param v182 i32) - (br (block 5 v182 v172))) + (block 7 (param v168 i32) (param v178 i32) + (br (block 5 v178 v168))) (block 8 - (let (v147 u32) (bitcast v52)) - (let (v148 (ptr u8)) (inttoptr v147)) - (let (v149 u8) (load v148)) - (let (v150 i32) (zext v149)) - (let (v151 i32) (const.i32 1)) - (let (v152 i32) (band v150 v151)) - (let (v153 i1) (neq v152 0)) - (condbr v153 (block 6 v154 v175 v185 v165) (block 22))) + (param v134 i32) + (param v150 i32) + (param v161 i32) + (param v171 i32) + (param v181 i32) + (let (v135 i32) (const.i32 2)) + (let (v136 i32) (band v134 v135)) + (let (v137 i1) (neq v136 0)) + (condbr v137 (block 6 v150 v171 v181 v161) (block 18))) (block 9 - (let (v61 i32) (const.i32 -4)) - (let (v62 i32) (band v24 v61)) - (let (v63 i1) (neq v62 0)) - (condbr v63 (block 17) (block 18))) - - (block 10 - (param v50 i32) - (param v154 i32) - (param v165 i32) - (param v175 i32) - (param v185 i32) - (let (v51 i32) (const.i32 -4)) - (let (v52 i32) (band v50 v51)) - (let (v53 i1) (eq v52 0)) - (let (v54 i32) (zext v53)) - (let (v55 i1) (neq v54 0)) - (condbr v55 (block 6 v154 v175 v185 v165) (block 13))) - - (block 11 (let (v41 u32) (bitcast v37)) (let (v42 u32) (mod.unchecked v41 4)) (assertz 250 v42) @@ -1288,191 +1257,181 @@ (let (v44 i32) (load v43)) (let (v45 i32) (const.i32 1)) (let (v46 i32) (band v44 v45)) - (let (v47 i1) (eq v46 0)) - (let (v48 i32) (zext v47)) - (let (v49 i1) (neq v48 0)) - (condbr v49 (block 9) (block 12))) + (let (v47 i1) (neq v46 0)) + (condbr v47 (block 8 v24 v1 v20 v14 v0) (block 10))) + + (block 10 + (let (v48 i32) (const.i32 -4)) + (let (v49 i32) (band v24 v48)) + (let (v50 i1) (neq v49 0)) + (condbr v50 (block 13) (block 14))) + + (block 11 + (param v104 i32) + (param v105 i32) + (param v111 i32) + (param v112 i32) + (param v123 i32) + (param v169 i32) + (param v179 i32) + (let (v106 i32) (const.i32 3)) + (let (v107 i32) (band v105 v106)) + (let (v108 u32) (bitcast v104)) + (let (v109 u32) (mod.unchecked v108 4)) + (assertz 250 v109) + (let (v110 (ptr i32)) (inttoptr v108)) + (store v110 v107) + (let (v113 i32) (const.i32 3)) + (let (v114 i32) (band v112 v113)) + (let (v115 u32) (bitcast v111)) + (let (v116 u32) (mod.unchecked v115 4)) + (assertz 250 v116) + (let (v117 (ptr i32)) (inttoptr v115)) + (store v117 v114) + (let (v118 i32) (const.i32 2)) + (let (v119 i32) (band v112 v118)) + (let (v120 i1) (eq v119 0)) + (let (v121 i32) (zext v120)) + (let (v122 i1) (neq v121 0)) + (condbr v122 (block 7 v169 v179) (block 17))) (block 12 - (br (block 10 v24 v1 v20 v14 v0))) + (param v83 i32) + (param v84 i32) + (param v87 i32) + (param v94 i32) + (param v99 i32) + (param v124 i32) + (param v170 i32) + (param v180 i32) + (let (v85 i32) (const.i32 -4)) + (let (v86 i32) (band v84 v85)) + (let (v88 i32) (const.i32 3)) + (let (v89 i32) (band v87 v88)) + (let (v90 i32) (bor v86 v89)) + (let (v91 u32) (bitcast v83)) + (let (v92 u32) (mod.unchecked v91 4)) + (assertz 250 v92) + (let (v93 (ptr i32)) (inttoptr v91)) + (store v93 v90) + (let (v95 u32) (bitcast v94)) + (let (v96 u32) (mod.unchecked v95 4)) + (assertz 250 v96) + (let (v97 (ptr i32)) (inttoptr v95)) + (let (v98 i32) (load v97)) + (let (v100 u32) (bitcast v99)) + (let (v101 u32) (mod.unchecked v100 4)) + (assertz 250 v101) + (let (v102 (ptr i32)) (inttoptr v100)) + (let (v103 i32) (load v102)) + (br (block 11 v94 v98 v99 v103 v124 v170 v180))) (block 13 - (let (v56 i32) (const.i32 2)) - (let (v57 i32) (band v50 v56)) - (let (v58 i1) (eq v57 0)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 8) (block 14))) + (let (v51 i32) (const.i32 2)) + (let (v52 i32) (band v24 v51)) + (let (v53 i1) (neq v52 0)) + (condbr v53 (block 12 v37 v26 v44 v31 v20 v37 v14 v0) (block 15))) (block 14 - (br (block 6 v154 v175 v185 v165))) + (br (block 12 v37 v26 v44 v31 v20 v37 v14 v0))) (block 15 - (param v117 i32) - (param v118 i32) - (param v124 i32) - (param v125 i32) - (param v136 i32) - (param v173 i32) - (param v183 i32) - (let (v119 i32) (const.i32 3)) - (let (v120 i32) (band v118 v119)) - (let (v121 u32) (bitcast v117)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (store v123 v120) - (let (v126 i32) (const.i32 3)) - (let (v127 i32) (band v125 v126)) - (let (v128 u32) (bitcast v124)) - (let (v129 u32) (mod.unchecked v128 4)) - (assertz 250 v129) - (let (v130 (ptr i32)) (inttoptr v128)) - (store v130 v127) - (let (v131 i32) (const.i32 2)) - (let (v132 i32) (band v125 v131)) - (let (v133 i1) (eq v132 0)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 7 v173 v183) (block 21))) + (let (v54 u32) (bitcast v49)) + (let (v55 u32) (add.checked v54 4)) + (let (v56 u32) (mod.unchecked v55 4)) + (assertz 250 v56) + (let (v57 (ptr i32)) (inttoptr v55)) + (let (v58 i32) (load v57)) + (let (v59 i32) (const.i32 3)) + (let (v60 i32) (band v58 v59)) + (let (v61 i32) (bor v60 v37)) + (let (v62 u32) (bitcast v49)) + (let (v63 u32) (add.checked v62 4)) + (let (v64 u32) (mod.unchecked v63 4)) + (assertz 250 v64) + (let (v65 (ptr i32)) (inttoptr v63)) + (store v65 v61) + (let (v66 u32) (bitcast v20)) + (let (v67 u32) (mod.unchecked v66 4)) + (assertz 250 v67) + (let (v68 (ptr i32)) (inttoptr v66)) + (let (v69 i32) (load v68)) + (let (v70 u32) (bitcast v31)) + (let (v71 u32) (mod.unchecked v70 4)) + (assertz 250 v71) + (let (v72 (ptr i32)) (inttoptr v70)) + (let (v73 i32) (load v72)) + (let (v74 i32) (const.i32 -4)) + (let (v75 i32) (band v73 v74)) + (let (v76 i1) (eq v75 0)) + (let (v77 i32) (zext v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 11 v31 v73 v20 v69 v37 v14 v0) (block 16))) (block 16 - (param v96 i32) - (param v97 i32) - (param v100 i32) - (param v107 i32) - (param v112 i32) - (param v137 i32) - (param v174 i32) - (param v184 i32) - (let (v98 i32) (const.i32 -4)) - (let (v99 i32) (band v97 v98)) - (let (v101 i32) (const.i32 3)) - (let (v102 i32) (band v100 v101)) - (let (v103 i32) (bor v99 v102)) - (let (v104 u32) (bitcast v96)) - (let (v105 u32) (mod.unchecked v104 4)) - (assertz 250 v105) - (let (v106 (ptr i32)) (inttoptr v104)) - (store v106 v103) - (let (v108 u32) (bitcast v107)) - (let (v109 u32) (mod.unchecked v108 4)) - (assertz 250 v109) - (let (v110 (ptr i32)) (inttoptr v108)) - (let (v111 i32) (load v110)) - (let (v113 u32) (bitcast v112)) - (let (v114 u32) (mod.unchecked v113 4)) - (assertz 250 v114) - (let (v115 (ptr i32)) (inttoptr v113)) - (let (v116 i32) (load v115)) - (br (block 15 v107 v111 v112 v116 v137 v174 v184))) - - (block 17 - (let (v64 i32) (const.i32 2)) - (let (v65 i32) (band v24 v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v37 v26 v44 v31 v20 v37 v14 v0) (block 19))) - - (block 18 - (br (block 16 v37 v26 v44 v31 v20 v37 v14 v0))) - - (block 19 - (let (v67 u32) (bitcast v62)) - (let (v68 u32) (add.checked v67 4)) - (let (v69 u32) (mod.unchecked v68 4)) - (assertz 250 v69) - (let (v70 (ptr i32)) (inttoptr v68)) - (let (v71 i32) (load v70)) - (let (v72 i32) (const.i32 3)) - (let (v73 i32) (band v71 v72)) - (let (v74 i32) (bor v73 v37)) - (let (v75 u32) (bitcast v62)) - (let (v76 u32) (add.checked v75 4)) - (let (v77 u32) (mod.unchecked v76 4)) - (assertz 250 v77) - (let (v78 (ptr i32)) (inttoptr v76)) - (store v78 v74) - (let (v79 u32) (bitcast v20)) + (let (v79 u32) (bitcast v75)) (let (v80 u32) (mod.unchecked v79 4)) (assertz 250 v80) (let (v81 (ptr i32)) (inttoptr v79)) (let (v82 i32) (load v81)) - (let (v83 u32) (bitcast v31)) - (let (v84 u32) (mod.unchecked v83 4)) - (assertz 250 v84) - (let (v85 (ptr i32)) (inttoptr v83)) - (let (v86 i32) (load v85)) - (let (v87 i32) (const.i32 -4)) - (let (v88 i32) (band v86 v87)) - (let (v89 i1) (eq v88 0)) - (let (v90 i32) (zext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 15 v31 v86 v20 v82 v37 v14 v0) (block 20))) - - (block 20 - (let (v92 u32) (bitcast v88)) - (let (v93 u32) (mod.unchecked v92 4)) - (assertz 250 v93) - (let (v94 (ptr i32)) (inttoptr v92)) - (let (v95 i32) (load v94)) - (br (block 16 v88 v82 v95 v31 v20 v37 v14 v0))) - - (block 21 - (let (v138 u32) (bitcast v136)) - (let (v139 u32) (mod.unchecked v138 4)) - (assertz 250 v139) - (let (v140 (ptr i32)) (inttoptr v138)) - (let (v141 i32) (load v140)) - (let (v142 i32) (const.i32 2)) - (let (v143 i32) (bor v141 v142)) - (let (v144 u32) (bitcast v136)) - (let (v145 u32) (mod.unchecked v144 4)) - (assertz 250 v145) - (let (v146 (ptr i32)) (inttoptr v144)) - (store v146 v143) - (br (block 7 v173 v183))) - - (block 22 - (let (v155 u32) (bitcast v52)) - (let (v156 u32) (add.checked v155 8)) - (let (v157 u32) (mod.unchecked v156 4)) - (assertz 250 v157) - (let (v158 (ptr i32)) (inttoptr v156)) - (let (v159 i32) (load v158)) - (let (v160 i32) (const.i32 -4)) - (let (v161 i32) (band v159 v160)) - (let (v162 u32) (bitcast v154)) - (let (v163 u32) (mod.unchecked v162 4)) - (assertz 250 v163) - (let (v164 (ptr i32)) (inttoptr v162)) - (store v164 v161) - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (bor v165 v166)) - (let (v168 u32) (bitcast v52)) - (let (v169 u32) (add.checked v168 8)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i32)) (inttoptr v169)) - (store v171 v167) - (br (block 7 v175 v185))) - ) + (br (block 12 v75 v69 v82 v31 v20 v37 v14 v0))) - (func (export #core::ptr::drop_in_place) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) + (block 17 + (let (v125 u32) (bitcast v123)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (let (v129 i32) (const.i32 2)) + (let (v130 i32) (bor v128 v129)) + (let (v131 u32) (bitcast v123)) + (let (v132 u32) (mod.unchecked v131 4)) + (assertz 250 v132) + (let (v133 (ptr i32)) (inttoptr v131)) + (store v133 v130) + (br (block 7 v169 v179))) - (block 1 - (ret)) - ) + (block 18 + (let (v138 i32) (const.i32 -4)) + (let (v139 i32) (band v134 v138)) + (let (v140 i1) (eq v139 0)) + (let (v141 i32) (zext v140)) + (let (v142 i1) (neq v141 0)) + (condbr v142 (block 6 v150 v171 v181 v161) (block 19))) - (func (export #core::ptr::drop_in_place) - (param i32) - (block 0 (param v0 i32) - (br (block 1))) + (block 19 + (let (v143 u32) (bitcast v139)) + (let (v144 (ptr u8)) (inttoptr v143)) + (let (v145 u8) (load v144)) + (let (v146 i32) (zext v145)) + (let (v147 i32) (const.i32 1)) + (let (v148 i32) (band v146 v147)) + (let (v149 i1) (neq v148 0)) + (condbr v149 (block 6 v150 v171 v181 v161) (block 20))) - (block 1 - (ret)) + (block 20 + (let (v151 u32) (bitcast v139)) + (let (v152 u32) (add.checked v151 8)) + (let (v153 u32) (mod.unchecked v152 4)) + (assertz 250 v153) + (let (v154 (ptr i32)) (inttoptr v152)) + (let (v155 i32) (load v154)) + (let (v156 i32) (const.i32 -4)) + (let (v157 i32) (band v155 v156)) + (let (v158 u32) (bitcast v150)) + (let (v159 u32) (mod.unchecked v158 4)) + (assertz 250 v159) + (let (v160 (ptr i32)) (inttoptr v158)) + (store v160 v157) + (let (v162 i32) (const.i32 1)) + (let (v163 i32) (bor v161 v162)) + (let (v164 u32) (bitcast v139)) + (let (v165 u32) (add.checked v164 8)) + (let (v166 u32) (mod.unchecked v165 4)) + (assertz 250 v166) + (let (v167 (ptr i32)) (inttoptr v165)) + (store v167 v163) + (br (block 7 v171 v181))) ) (func (export #core::panicking::panic_fmt) @@ -1484,44 +1443,60 @@ (let (v5 i32) (sub.wrapping v3 v4)) (let (v6 (ptr i32)) (global.symbol #__stack_pointer)) (store v6 v5) - (let (v7 i32) (const.i32 1)) - (let (v8 u32) (bitcast v7)) - (let (v9 u16) (trunc v8)) - (let (v10 u32) (bitcast v5)) - (let (v11 u32) (add.checked v10 28)) - (let (v12 u32) (mod.unchecked v11 2)) + (let (v7 i32) (const.i32 16)) + (let (v8 i32) (add.wrapping v5 v7)) + (let (v9 i32) (const.i32 16)) + (let (v10 i32) (add.wrapping v0 v9)) + (let (v11 u32) (bitcast v10)) + (let (v12 u32) (mod.unchecked v11 4)) (assertz 250 v12) - (let (v13 (ptr u16)) (inttoptr v11)) - (store v13 v9) - (let (v14 u32) (bitcast v5)) - (let (v15 u32) (add.checked v14 24)) - (let (v16 u32) (mod.unchecked v15 4)) + (let (v13 (ptr i64)) (inttoptr v11)) + (let (v14 i64) (load v13)) + (let (v15 u32) (bitcast v8)) + (let (v16 u32) (mod.unchecked v15 8)) (assertz 250 v16) - (let (v17 (ptr i32)) (inttoptr v15)) - (store v17 v1) - (let (v18 u32) (bitcast v5)) - (let (v19 u32) (add.checked v18 20)) - (let (v20 u32) (mod.unchecked v19 4)) - (assertz 250 v20) - (let (v21 (ptr i32)) (inttoptr v19)) - (store v21 v0) - (let (v22 i32) (const.i32 1048696)) - (let (v23 u32) (bitcast v5)) - (let (v24 u32) (add.checked v23 16)) - (let (v25 u32) (mod.unchecked v24 4)) - (assertz 250 v25) - (let (v26 (ptr i32)) (inttoptr v24)) - (store v26 v22) - (let (v27 i32) (const.i32 1)) - (let (v28 u32) (bitcast v5)) - (let (v29 u32) (add.checked v28 12)) - (let (v30 u32) (mod.unchecked v29 4)) - (assertz 250 v30) - (let (v31 (ptr i32)) (inttoptr v29)) - (store v31 v27) - (let (v32 i32) (const.i32 12)) - (let (v33 i32) (add.wrapping v5 v32)) - (call #rust_begin_unwind v33) + (let (v17 (ptr i64)) (inttoptr v15)) + (store v17 v14) + (let (v18 i32) (const.i32 8)) + (let (v19 i32) (add.wrapping v5 v18)) + (let (v20 i32) (const.i32 8)) + (let (v21 i32) (add.wrapping v0 v20)) + (let (v22 u32) (bitcast v21)) + (let (v23 u32) (mod.unchecked v22 4)) + (assertz 250 v23) + (let (v24 (ptr i64)) (inttoptr v22)) + (let (v25 i64) (load v24)) + (let (v26 u32) (bitcast v19)) + (let (v27 u32) (mod.unchecked v26 8)) + (assertz 250 v27) + (let (v28 (ptr i64)) (inttoptr v26)) + (store v28 v25) + (let (v29 i32) (const.i32 1)) + (let (v30 u32) (bitcast v29)) + (let (v31 u16) (trunc v30)) + (let (v32 u32) (bitcast v5)) + (let (v33 u32) (add.checked v32 28)) + (let (v34 u32) (mod.unchecked v33 2)) + (assertz 250 v34) + (let (v35 (ptr u16)) (inttoptr v33)) + (store v35 v31) + (let (v36 u32) (bitcast v5)) + (let (v37 u32) (add.checked v36 24)) + (let (v38 u32) (mod.unchecked v37 4)) + (assertz 250 v38) + (let (v39 (ptr i32)) (inttoptr v37)) + (store v39 v1) + (let (v40 u32) (bitcast v0)) + (let (v41 u32) (mod.unchecked v40 4)) + (assertz 250 v41) + (let (v42 (ptr i64)) (inttoptr v40)) + (let (v43 i64) (load v42)) + (let (v44 u32) (bitcast v5)) + (let (v45 u32) (mod.unchecked v44 8)) + (assertz 250 v45) + (let (v46 (ptr i64)) (inttoptr v44)) + (store v46 v43) + (call #rust_begin_unwind v5) (unreachable)) (block 1) @@ -1529,15 +1504,6 @@ (func (export #core::slice::index::slice_start_index_len_fail) (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (call #core::slice::index::slice_start_index_len_fail_rt v0 v1 v2) - (unreachable)) - - (block 1) - ) - - (func (export #core::panicking::panic_bounds_check) - (param i32) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (let (v3 i32) (const.i32 0)) (let (v4 i64) (const.i64 0)) @@ -1547,16 +1513,16 @@ (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) (store v8 v7) (let (v9 u32) (bitcast v7)) - (let (v10 u32) (add.checked v9 4)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (store v12 v1) - (let (v13 u32) (bitcast v7)) + (let (v10 u32) (mod.unchecked v9 4)) + (assertz 250 v10) + (let (v11 (ptr i32)) (inttoptr v9)) + (store v11 v0) + (let (v12 u32) (bitcast v7)) + (let (v13 u32) (add.checked v12 4)) (let (v14 u32) (mod.unchecked v13 4)) (assertz 250 v14) (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v0) + (store v15 v1) (let (v16 i32) (const.i32 2)) (let (v17 u32) (bitcast v7)) (let (v18 u32) (add.checked v17 12)) @@ -1564,7 +1530,7 @@ (assertz 250 v19) (let (v20 (ptr i32)) (inttoptr v18)) (store v20 v16) - (let (v21 i32) (const.i32 1048764)) + (let (v21 i32) (const.i32 1049264)) (let (v22 u32) (bitcast v7)) (let (v23 u32) (add.checked v22 8)) (let (v24 u32) (mod.unchecked v23 4)) @@ -1578,26 +1544,26 @@ (assertz 250 v29) (let (v30 (ptr i64)) (inttoptr v28)) (store v30 v26) - (let (v31 i32) (const.i32 7)) + (let (v31 i32) (const.i32 6)) (let (v32 u32) (bitcast v31)) (let (v33 u64) (zext v32)) (let (v34 i64) (bitcast v33)) (let (v35 i64) (const.i64 32)) (let (v36 u32) (cast v35)) (let (v37 i64) (shl.wrapping v34 v36)) - (let (v38 u32) (bitcast v7)) - (let (v39 u64) (zext v38)) - (let (v40 i64) (bitcast v39)) - (let (v41 i64) (bor v37 v40)) - (let (v42 u32) (bitcast v7)) - (let (v43 u32) (add.checked v42 40)) - (let (v44 u32) (mod.unchecked v43 8)) - (assertz 250 v44) - (let (v45 (ptr i64)) (inttoptr v43)) - (store v45 v41) - (let (v46 i32) (const.i32 4)) - (let (v47 i32) (add.wrapping v7 v46)) - (let (v48 u32) (bitcast v47)) + (let (v38 i32) (const.i32 4)) + (let (v39 i32) (add.wrapping v7 v38)) + (let (v40 u32) (bitcast v39)) + (let (v41 u64) (zext v40)) + (let (v42 i64) (bitcast v41)) + (let (v43 i64) (bor v37 v42)) + (let (v44 u32) (bitcast v7)) + (let (v45 u32) (add.checked v44 40)) + (let (v46 u32) (mod.unchecked v45 8)) + (assertz 250 v46) + (let (v47 (ptr i64)) (inttoptr v45)) + (store v47 v43) + (let (v48 u32) (bitcast v7)) (let (v49 u64) (zext v48)) (let (v50 i64) (bitcast v49)) (let (v51 i64) (bor v37 v50)) @@ -1623,159 +1589,247 @@ (block 1) ) - (func (export #core::fmt::Formatter::pad) - (param i32) (param i32) (param i32) (result i32) + (func (export #core::panicking::panic_bounds_check) + (param i32) (param i32) (param i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v4 i32) (const.i32 0)) + (let (v3 i32) (const.i32 0)) + (let (v4 i64) (const.i64 0)) + (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) + (let (v6 i32) (const.i32 48)) + (let (v7 i32) (sub.wrapping v5 v6)) + (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) + (store v8 v7) + (let (v9 u32) (bitcast v7)) + (let (v10 u32) (add.checked v9 4)) + (let (v11 u32) (mod.unchecked v10 4)) + (assertz 250 v11) + (let (v12 (ptr i32)) (inttoptr v10)) + (store v12 v1) + (let (v13 u32) (bitcast v7)) + (let (v14 u32) (mod.unchecked v13 4)) + (assertz 250 v14) + (let (v15 (ptr i32)) (inttoptr v13)) + (store v15 v0) + (let (v16 i32) (const.i32 2)) + (let (v17 u32) (bitcast v7)) + (let (v18 u32) (add.checked v17 12)) + (let (v19 u32) (mod.unchecked v18 4)) + (assertz 250 v19) + (let (v20 (ptr i32)) (inttoptr v18)) + (store v20 v16) + (let (v21 i32) (const.i32 1048768)) + (let (v22 u32) (bitcast v7)) + (let (v23 u32) (add.checked v22 8)) + (let (v24 u32) (mod.unchecked v23 4)) + (assertz 250 v24) + (let (v25 (ptr i32)) (inttoptr v23)) + (store v25 v21) + (let (v26 i64) (const.i64 2)) + (let (v27 u32) (bitcast v7)) + (let (v28 u32) (add.checked v27 20)) + (let (v29 u32) (mod.unchecked v28 4)) + (assertz 250 v29) + (let (v30 (ptr i64)) (inttoptr v28)) + (store v30 v26) + (let (v31 i32) (const.i32 6)) + (let (v32 u32) (bitcast v31)) + (let (v33 u64) (zext v32)) + (let (v34 i64) (bitcast v33)) + (let (v35 i64) (const.i64 32)) + (let (v36 u32) (cast v35)) + (let (v37 i64) (shl.wrapping v34 v36)) + (let (v38 u32) (bitcast v7)) + (let (v39 u64) (zext v38)) + (let (v40 i64) (bitcast v39)) + (let (v41 i64) (bor v37 v40)) + (let (v42 u32) (bitcast v7)) + (let (v43 u32) (add.checked v42 40)) + (let (v44 u32) (mod.unchecked v43 8)) + (assertz 250 v44) + (let (v45 (ptr i64)) (inttoptr v43)) + (store v45 v41) + (let (v46 i32) (const.i32 4)) + (let (v47 i32) (add.wrapping v7 v46)) + (let (v48 u32) (bitcast v47)) + (let (v49 u64) (zext v48)) + (let (v50 i64) (bitcast v49)) + (let (v51 i64) (bor v37 v50)) + (let (v52 u32) (bitcast v7)) + (let (v53 u32) (add.checked v52 32)) + (let (v54 u32) (mod.unchecked v53 8)) + (assertz 250 v54) + (let (v55 (ptr i64)) (inttoptr v53)) + (store v55 v51) + (let (v56 i32) (const.i32 32)) + (let (v57 i32) (add.wrapping v7 v56)) + (let (v58 u32) (bitcast v7)) + (let (v59 u32) (add.checked v58 16)) + (let (v60 u32) (mod.unchecked v59 4)) + (assertz 250 v60) + (let (v61 (ptr i32)) (inttoptr v59)) + (store v61 v57) + (let (v62 i32) (const.i32 8)) + (let (v63 i32) (add.wrapping v7 v62)) + (call #core::panicking::panic_fmt v63 v2) + (unreachable)) + + (block 1) + ) + + (func (export #core::fmt::Formatter::pad) + (param i32) (param i32) (param i32) (result i32) + (block 0 (param v0 i32) (param v1 i32) (param v2 i32) + (let (v4 i32) (const.i32 0)) (let (v5 u32) (bitcast v0)) - (let (v6 u32) (mod.unchecked v5 4)) - (assertz 250 v6) - (let (v7 (ptr i32)) (inttoptr v5)) - (let (v8 i32) (load v7)) - (let (v9 u32) (bitcast v0)) - (let (v10 u32) (add.checked v9 8)) + (let (v6 u32) (add.checked v5 8)) + (let (v7 u32) (mod.unchecked v6 4)) + (assertz 250 v7) + (let (v8 (ptr i32)) (inttoptr v6)) + (let (v9 i32) (load v8)) + (let (v10 u32) (bitcast v0)) (let (v11 u32) (mod.unchecked v10 4)) (assertz 250 v11) (let (v12 (ptr i32)) (inttoptr v10)) (let (v13 i32) (load v12)) - (let (v14 i32) (bor v8 v13)) - (let (v15 i1) (eq v14 0)) - (let (v16 i32) (zext v15)) - (let (v17 i1) (neq v16 0)) - (condbr v17 (block 2) (block 3))) + (let (v14 i1) (neq v13 0)) + (condbr v14 (block 3 v9 v1 v2 v0 v13) (block 4))) (block 1 (param v3 i32) (ret v3)) (block 2 - (let (v479 u32) (bitcast v0)) - (let (v480 u32) (add.checked v479 20)) - (let (v481 u32) (mod.unchecked v480 4)) - (assertz 250 v481) - (let (v482 (ptr i32)) (inttoptr v480)) - (let (v483 i32) (load v482)) - (let (v484 u32) (bitcast v0)) - (let (v485 u32) (add.checked v484 24)) - (let (v486 u32) (mod.unchecked v485 4)) - (assertz 250 v486) - (let (v487 (ptr i32)) (inttoptr v485)) - (let (v488 i32) (load v487)) - (let (v489 u32) (bitcast v488)) - (let (v490 u32) (add.checked v489 12)) - (let (v491 u32) (mod.unchecked v490 4)) - (assertz 250 v491) - (let (v492 (ptr i32)) (inttoptr v490)) - (let (v493 i32) (load v492)) - (br (block 1 v493))) + (let (v415 u32) (bitcast v0)) + (let (v416 u32) (add.checked v415 20)) + (let (v417 u32) (mod.unchecked v416 4)) + (assertz 250 v417) + (let (v418 (ptr i32)) (inttoptr v416)) + (let (v419 i32) (load v418)) + (let (v420 u32) (bitcast v0)) + (let (v421 u32) (add.checked v420 24)) + (let (v422 u32) (mod.unchecked v421 4)) + (assertz 250 v422) + (let (v423 (ptr i32)) (inttoptr v421)) + (let (v424 i32) (load v423)) + (let (v425 u32) (bitcast v424)) + (let (v426 u32) (add.checked v425 12)) + (let (v427 u32) (mod.unchecked v426 4)) + (assertz 250 v427) + (let (v428 (ptr i32)) (inttoptr v426)) + (let (v429 i32) (load v428)) + (br (block 1 v429))) (block 3 - (let (v18 i1) (eq v13 0)) - (let (v19 i32) (zext v18)) - (let (v20 i1) (neq v19 0)) - (condbr v20 (block 4 v8 v0 v1 v2) (block 5))) + (param v20 i32) + (param v26 i32) + (param v27 i32) + (param v29 i32) + (param v145 i32) + (let (v21 i32) (const.i32 1)) + (let (v22 i32) (band v20 v21)) + (let (v23 i1) (eq v22 0)) + (let (v24 i32) (zext v23)) + (let (v25 i1) (neq v24 0)) + (condbr v25 (block 6 v145 v29 v26 v27) (block 7))) (block 4 - (param v213 i32) - (param v220 i32) - (param v231 i32) - (param v233 i32) - (let (v219 i1) (neq v213 0)) - (condbr v219 (block 33) (block 34))) + (let (v15 i32) (const.i32 1)) + (let (v16 i32) (band v9 v15)) + (let (v17 i1) (eq v16 0)) + (let (v18 i32) (zext v17)) + (let (v19 i1) (neq v18 0)) + (condbr v19 (block 2) (block 5))) (block 5 - (let (v21 i32) (add.wrapping v1 v2)) - (let (v22 u32) (bitcast v0)) - (let (v23 u32) (add.checked v22 12)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 i1) (neq v26 0)) - (condbr v27 (block 7) (block 8))) + (br (block 3 v9 v1 v2 v0 v13))) (block 6 - (param v116 i32) - (param v117 i32) - (param v183 i32) - (param v188 i32) - (param v200 i32) - (param v216 i32) - (param v223 i32) - (let (v118 i1) (eq v116 v117)) - (let (v119 i32) (zext v118)) - (let (v120 i1) (neq v119 0)) - (condbr v120 (block 4 v216 v223 v200 v188) (block 21))) + (param v144 i32) + (param v153 i32) + (param v165 i32) + (param v166 i32) + (let (v152 i1) (neq v144 0)) + (condbr v152 (block 32) (block 33))) (block 7 - (let (v29 i32) (const.i32 0)) - (br (block 9 v1 v21 v29 v26 v2 v1 v8 v0))) + (let (v28 i32) (add.wrapping v26 v27)) + (let (v30 u32) (bitcast v29)) + (let (v31 u32) (add.checked v30 12)) + (let (v32 u32) (mod.unchecked v31 4)) + (assertz 250 v32) + (let (v33 (ptr i32)) (inttoptr v31)) + (let (v34 i32) (load v33)) + (let (v35 i1) (neq v34 0)) + (condbr v35 (block 9) (block 10))) (block 8 - (let (v28 i32) (const.i32 0)) - (br (block 6 v1 v21 v28 v2 v1 v8 v0))) + (param v83 i32) + (param v84 i32) + (param v102 i32) + (param v107 i32) + (param v116 i32) + (param v148 i32) + (param v156 i32) + (let (v85 i1) (eq v83 v84)) + (let (v86 i32) (zext v85)) + (let (v87 i1) (neq v86 0)) + (condbr v87 (block 6 v148 v156 v116 v107) (block 22))) (block 9 - (param v30 i32) - (param v31 i32) - (param v105 i32) - (param v111 i32) - (param v190 i32) - (param v202 i32) - (param v214 i32) - (param v221 i32) - (let (v32 i1) (eq v30 v31)) - (let (v33 i32) (zext v32)) - (let (v34 i1) (neq v33 0)) - (condbr v34 (block 4 v214 v221 v202 v190) (block 11))) + (let (v37 i32) (const.i32 0)) + (br (block 11 v26 v28 v37 v34 v27 v26 v145 v29))) (block 10 - (br (block 6 v108 v115 v109 v189 v201 v215 v222))) + (let (v36 i32) (const.i32 0)) + (br (block 8 v26 v28 v36 v27 v26 v145 v29))) (block 11 - (let (v35 u32) (bitcast v30)) - (let (v36 (ptr i8)) (inttoptr v35)) - (let (v37 i8) (load v36)) - (let (v38 i32) (sext v37)) - (let (v39 i32) (const.i32 -1)) - (let (v40 i1) (lte v38 v39)) - (let (v41 i32) (sext v40)) + (param v38 i32) + (param v39 i32) + (param v75 i32) + (param v78 i32) + (param v109 i32) + (param v118 i32) + (param v146 i32) + (param v154 i32) + (let (v40 i1) (eq v38 v39)) + (let (v41 i32) (zext v40)) (let (v42 i1) (neq v41 0)) - (condbr v42 (block 13) (block 14))) + (condbr v42 (block 6 v146 v154 v118 v109) (block 13))) (block 12 - (param v104 i32) - (param v106 i32) - (param v108 i32) - (param v110 i32) - (param v115 i32) - (param v189 i32) - (param v201 i32) - (param v215 i32) - (param v222 i32) - (let (v107 i32) (sub.wrapping v104 v106)) - (let (v109 i32) (add.wrapping v107 v108)) - (let (v112 i32) (const.i32 -1)) - (let (v113 i32) (add.wrapping v110 v112)) - (let (v114 i1) (neq v113 0)) - (condbr v114 (block 9 v108 v115 v109 v113 v189 v201 v215 v222) (block 20))) + (br (block 8 v71 v82 v76 v108 v117 v147 v155))) (block 13 - (let (v45 i32) (const.i32 -32)) - (let (v46 u32) (bitcast v38)) - (let (v47 u32) (bitcast v45)) - (let (v48 i1) (gte v46 v47)) - (let (v49 i32) (zext v48)) + (let (v43 u32) (bitcast v38)) + (let (v44 (ptr i8)) (inttoptr v43)) + (let (v45 i8) (load v44)) + (let (v46 i32) (sext v45)) + (let (v47 i32) (const.i32 -1)) + (let (v48 i1) (lte v46 v47)) + (let (v49 i32) (sext v48)) (let (v50 i1) (neq v49 0)) (condbr v50 (block 15) (block 16))) (block 14 - (let (v43 i32) (const.i32 1)) - (let (v44 i32) (add.wrapping v30 v43)) - (br (block 12 v105 v30 v44 v111 v31 v190 v202 v214 v221))) + (param v71 i32) + (param v72 i32) + (param v74 i32) + (param v77 i32) + (param v82 i32) + (param v108 i32) + (param v117 i32) + (param v147 i32) + (param v155 i32) + (let (v73 i32) (sub.wrapping v71 v72)) + (let (v76 i32) (add.wrapping v73 v74)) + (let (v79 i32) (const.i32 -1)) + (let (v80 i32) (add.wrapping v77 v79)) + (let (v81 i1) (neq v80 0)) + (condbr v81 (block 11 v71 v82 v76 v80 v108 v117 v147 v155) (block 21))) (block 15 - (let (v53 i32) (const.i32 -16)) - (let (v54 u32) (bitcast v38)) + (let (v53 i32) (const.i32 -32)) + (let (v54 u32) (bitcast v46)) (let (v55 u32) (bitcast v53)) (let (v56 i1) (gte v54 v55)) (let (v57 i32) (zext v56)) @@ -1783,562 +1837,494 @@ (condbr v58 (block 17) (block 18))) (block 16 - (let (v51 i32) (const.i32 2)) - (let (v52 i32) (add.wrapping v30 v51)) - (br (block 12 v105 v30 v52 v111 v31 v190 v202 v214 v221))) + (let (v51 i32) (const.i32 1)) + (let (v52 i32) (add.wrapping v38 v51)) + (br (block 14 v52 v38 v75 v78 v39 v109 v118 v146 v154))) (block 17 - (let (v61 u32) (bitcast v30)) - (let (v62 u32) (add.checked v61 2)) - (let (v63 (ptr u8)) (inttoptr v62)) - (let (v64 u8) (load v63)) + (let (v61 i32) (const.i32 -16)) + (let (v62 u32) (bitcast v46)) + (let (v63 u32) (bitcast v61)) + (let (v64 i1) (gte v62 v63)) (let (v65 i32) (zext v64)) - (let (v66 i32) (const.i32 63)) - (let (v67 i32) (band v65 v66)) - (let (v68 i32) (const.i32 6)) - (let (v69 u32) (bitcast v68)) - (let (v70 i32) (shl.wrapping v67 v69)) - (let (v71 u32) (bitcast v30)) - (let (v72 u32) (add.checked v71 1)) - (let (v73 (ptr u8)) (inttoptr v72)) - (let (v74 u8) (load v73)) - (let (v75 i32) (zext v74)) - (let (v76 i32) (const.i32 63)) - (let (v77 i32) (band v75 v76)) - (let (v78 i32) (const.i32 12)) - (let (v79 u32) (bitcast v78)) - (let (v80 i32) (shl.wrapping v77 v79)) - (let (v81 i32) (bor v70 v80)) - (let (v82 u32) (bitcast v30)) - (let (v83 u32) (add.checked v82 3)) - (let (v84 (ptr u8)) (inttoptr v83)) - (let (v85 u8) (load v84)) - (let (v86 i32) (zext v85)) - (let (v87 i32) (const.i32 63)) - (let (v88 i32) (band v86 v87)) - (let (v89 i32) (bor v81 v88)) - (let (v90 i32) (const.i32 255)) - (let (v91 i32) (band v38 v90)) - (let (v92 i32) (const.i32 18)) - (let (v93 u32) (bitcast v92)) - (let (v94 i32) (shl.wrapping v91 v93)) - (let (v95 i32) (const.i32 1835008)) - (let (v96 i32) (band v94 v95)) - (let (v97 i32) (bor v89 v96)) - (let (v98 i32) (const.i32 1114112)) - (let (v99 i1) (eq v97 v98)) - (let (v100 i32) (zext v99)) - (let (v101 i1) (neq v100 0)) - (condbr v101 (block 4 v214 v221 v202 v190) (block 19))) + (let (v66 i1) (neq v65 0)) + (condbr v66 (block 19) (block 20))) (block 18 - (let (v59 i32) (const.i32 3)) - (let (v60 i32) (add.wrapping v30 v59)) - (br (block 12 v105 v30 v60 v111 v31 v190 v202 v214 v221))) + (let (v59 i32) (const.i32 2)) + (let (v60 i32) (add.wrapping v38 v59)) + (br (block 14 v60 v38 v75 v78 v39 v109 v118 v146 v154))) (block 19 - (let (v102 i32) (const.i32 4)) - (let (v103 i32) (add.wrapping v30 v102)) - (br (block 12 v105 v30 v103 v111 v31 v190 v202 v214 v221))) + (let (v69 i32) (const.i32 4)) + (let (v70 i32) (add.wrapping v38 v69)) + (br (block 14 v70 v38 v75 v78 v39 v109 v118 v146 v154))) (block 20 - (br (block 10))) + (let (v67 i32) (const.i32 3)) + (let (v68 i32) (add.wrapping v38 v67)) + (br (block 14 v68 v38 v75 v78 v39 v109 v118 v146 v154))) (block 21 - (let (v121 u32) (bitcast v116)) - (let (v122 (ptr i8)) (inttoptr v121)) - (let (v123 i8) (load v122)) - (let (v124 i32) (sext v123)) - (let (v125 i32) (const.i32 -1)) - (let (v126 i1) (gt v124 v125)) - (let (v127 i32) (zext v126)) - (let (v128 i1) (neq v127 0)) - (condbr v128 (block 22 v183 v188 v200 v216 v223) (block 23))) + (br (block 12))) (block 22 - (param v182 i32) - (param v187 i32) - (param v199 i32) - (param v217 i32) - (param v224 i32) - (let (v184 i1) (eq v182 0)) - (let (v185 i32) (zext v184)) - (let (v186 i1) (neq v185 0)) - (condbr v186 (block 27 v182 v217 v224 v199) (block 28))) + (let (v88 u32) (bitcast v83)) + (let (v89 (ptr i8)) (inttoptr v88)) + (let (v90 i8) (load v89)) + (let (v91 i32) (sext v90)) + (let (v92 i32) (const.i32 -1)) + (let (v93 i1) (gt v91 v92)) + (let (v94 i32) (zext v93)) + (let (v95 i1) (neq v94 0)) + (condbr v95 (block 23 v102 v107 v116 v148 v156) (block 24))) (block 23 - (let (v129 i32) (const.i32 -32)) - (let (v130 u32) (bitcast v124)) - (let (v131 u32) (bitcast v129)) - (let (v132 i1) (lt v130 v131)) - (let (v133 i32) (sext v132)) - (let (v134 i1) (neq v133 0)) - (condbr v134 (block 22 v183 v188 v200 v216 v223) (block 24))) + (param v101 i32) + (param v106 i32) + (param v115 i32) + (param v150 i32) + (param v158 i32) + (let (v103 i1) (eq v101 0)) + (let (v104 i32) (zext v103)) + (let (v105 i1) (neq v104 0)) + (condbr v105 (block 26 v115 v101 v106 v150 v158) (block 27))) (block 24 - (let (v135 i32) (const.i32 -16)) - (let (v136 u32) (bitcast v124)) - (let (v137 u32) (bitcast v135)) - (let (v138 i1) (lt v136 v137)) - (let (v139 i32) (sext v138)) - (let (v140 i1) (neq v139 0)) - (condbr v140 (block 22 v183 v188 v200 v216 v223) (block 25))) + (let (v96 i32) (const.i32 -32)) + (let (v97 u32) (bitcast v91)) + (let (v98 u32) (bitcast v96)) + (let (v99 i1) (lt v97 v98)) + (let (v100 i32) (sext v99)) + (br (block 23 v102 v107 v116 v148 v156))) (block 25 - (let (v141 u32) (bitcast v116)) - (let (v142 u32) (add.checked v141 2)) - (let (v143 (ptr u8)) (inttoptr v142)) - (let (v144 u8) (load v143)) - (let (v145 i32) (zext v144)) - (let (v146 i32) (const.i32 63)) - (let (v147 i32) (band v145 v146)) - (let (v148 i32) (const.i32 6)) - (let (v149 u32) (bitcast v148)) - (let (v150 i32) (shl.wrapping v147 v149)) - (let (v151 u32) (bitcast v116)) - (let (v152 u32) (add.checked v151 1)) - (let (v153 (ptr u8)) (inttoptr v152)) - (let (v154 u8) (load v153)) - (let (v155 i32) (zext v154)) - (let (v156 i32) (const.i32 63)) - (let (v157 i32) (band v155 v156)) - (let (v158 i32) (const.i32 12)) - (let (v159 u32) (bitcast v158)) - (let (v160 i32) (shl.wrapping v157 v159)) - (let (v161 i32) (bor v150 v160)) - (let (v162 u32) (bitcast v116)) - (let (v163 u32) (add.checked v162 3)) - (let (v164 (ptr u8)) (inttoptr v163)) - (let (v165 u8) (load v164)) - (let (v166 i32) (zext v165)) - (let (v167 i32) (const.i32 63)) - (let (v168 i32) (band v166 v167)) - (let (v169 i32) (bor v161 v168)) - (let (v170 i32) (const.i32 255)) - (let (v171 i32) (band v124 v170)) - (let (v172 i32) (const.i32 18)) - (let (v173 u32) (bitcast v172)) - (let (v174 i32) (shl.wrapping v171 v173)) - (let (v175 i32) (const.i32 1835008)) - (let (v176 i32) (band v174 v175)) - (let (v177 i32) (bor v169 v176)) - (let (v178 i32) (const.i32 1114112)) - (let (v179 i1) (eq v177 v178)) - (let (v180 i32) (zext v179)) - (let (v181 i1) (neq v180 0)) - (condbr v181 (block 4 v216 v223 v200 v188) (block 26))) + (param v134 i32) + (param v136 i32) + (param v138 i32) + (param v141 i32) + (param v149 i32) + (param v157 i32) + (let (v139 i1) (neq v138 0)) + (let (v140 i32) (select v139 v134 v136)) + (let (v142 i1) (neq v138 0)) + (let (v143 i32) (select v142 v138 v141)) + (br (block 6 v149 v157 v143 v140))) (block 26 - (br (block 22 v183 v188 v200 v216 v223))) + (param v133 i32) + (param v135 i32) + (param v137 i32) + (param v151 i32) + (param v159 i32) + (br (block 25 v135 v137 v133 v133 v151 v159))) (block 27 - (param v212 i32) - (param v218 i32) - (param v225 i32) - (param v232 i32) - (br (block 4 v218 v225 v232 v212))) + (let (v110 u32) (bitcast v101)) + (let (v111 u32) (bitcast v106)) + (let (v112 i1) (gte v110 v111)) + (let (v113 i32) (zext v112)) + (let (v114 i1) (neq v113 0)) + (condbr v114 (block 28) (block 29))) (block 28 - (let (v191 u32) (bitcast v182)) - (let (v192 u32) (bitcast v187)) - (let (v193 i1) (lt v191 v192)) - (let (v194 i32) (sext v193)) - (let (v195 i1) (neq v194 0)) - (condbr v195 (block 29) (block 30))) + (let (v129 i1) (eq v101 v106)) + (let (v130 i32) (zext v129)) + (let (v131 i1) (neq v130 0)) + (condbr v131 (block 26 v115 v101 v106 v150 v158) (block 31))) (block 29 - (let (v203 i32) (add.wrapping v199 v182)) - (let (v204 u32) (bitcast v203)) - (let (v205 (ptr i8)) (inttoptr v204)) - (let (v206 i8) (load v205)) - (let (v207 i32) (sext v206)) - (let (v208 i32) (const.i32 -64)) - (let (v209 i1) (lt v207 v208)) - (let (v210 i32) (sext v209)) - (let (v211 i1) (neq v210 0)) - (condbr v211 (block 4 v217 v224 v199 v187) (block 32))) + (let (v119 i32) (add.wrapping v115 v101)) + (let (v120 u32) (bitcast v119)) + (let (v121 (ptr i8)) (inttoptr v120)) + (let (v122 i8) (load v121)) + (let (v123 i32) (sext v122)) + (let (v124 i32) (const.i32 -65)) + (let (v125 i1) (gt v123 v124)) + (let (v126 i32) (zext v125)) + (let (v127 i1) (neq v126 0)) + (condbr v127 (block 26 v115 v101 v106 v150 v158) (block 30))) (block 30 - (let (v196 i1) (eq v182 v187)) - (let (v197 i32) (zext v196)) - (let (v198 i1) (neq v197 0)) - (condbr v198 (block 27 v182 v217 v224 v199) (block 31))) + (let (v128 i32) (const.i32 0)) + (br (block 25 v101 v106 v128 v115 v150 v158))) (block 31 - (br (block 4 v217 v224 v199 v187))) + (let (v132 i32) (const.i32 0)) + (br (block 25 v101 v106 v132 v115 v150 v158))) (block 32 - (br (block 27 v182 v217 v224 v199))) + (let (v177 u32) (bitcast v153)) + (let (v178 u32) (add.checked v177 4)) + (let (v179 u32) (mod.unchecked v178 4)) + (assertz 250 v179) + (let (v180 (ptr i32)) (inttoptr v178)) + (let (v181 i32) (load v180)) + (let (v182 i32) (const.i32 16)) + (let (v183 u32) (bitcast v166)) + (let (v184 u32) (bitcast v182)) + (let (v185 i1) (lt v183 v184)) + (let (v186 i32) (sext v185)) + (let (v187 i1) (neq v186 0)) + (condbr v187 (block 35) (block 36))) (block 33 - (let (v244 u32) (bitcast v220)) - (let (v245 u32) (add.checked v244 4)) - (let (v246 u32) (mod.unchecked v245 4)) - (assertz 250 v246) - (let (v247 (ptr i32)) (inttoptr v245)) - (let (v248 i32) (load v247)) - (let (v249 i32) (const.i32 16)) - (let (v250 u32) (bitcast v233)) - (let (v251 u32) (bitcast v249)) - (let (v252 i1) (lt v250 v251)) - (let (v253 i32) (sext v252)) - (let (v254 i1) (neq v253 0)) - (condbr v254 (block 36) (block 37))) + (let (v160 u32) (bitcast v153)) + (let (v161 u32) (add.checked v160 20)) + (let (v162 u32) (mod.unchecked v161 4)) + (assertz 250 v162) + (let (v163 (ptr i32)) (inttoptr v161)) + (let (v164 i32) (load v163)) + (let (v167 u32) (bitcast v153)) + (let (v168 u32) (add.checked v167 24)) + (let (v169 u32) (mod.unchecked v168 4)) + (assertz 250 v169) + (let (v170 (ptr i32)) (inttoptr v168)) + (let (v171 i32) (load v170)) + (let (v172 u32) (bitcast v171)) + (let (v173 u32) (add.checked v172 12)) + (let (v174 u32) (mod.unchecked v173 4)) + (assertz 250 v174) + (let (v175 (ptr i32)) (inttoptr v173)) + (let (v176 i32) (load v175)) + (ret v176)) (block 34 - (let (v226 u32) (bitcast v220)) - (let (v227 u32) (add.checked v226 20)) - (let (v228 u32) (mod.unchecked v227 4)) - (assertz 250 v228) - (let (v229 (ptr i32)) (inttoptr v227)) - (let (v230 i32) (load v229)) - (let (v234 u32) (bitcast v220)) - (let (v235 u32) (add.checked v234 24)) - (let (v236 u32) (mod.unchecked v235 4)) - (assertz 250 v236) - (let (v237 (ptr i32)) (inttoptr v235)) - (let (v238 i32) (load v237)) - (let (v239 u32) (bitcast v238)) - (let (v240 u32) (add.checked v239 12)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (let (v243 i32) (load v242)) - (ret v243)) + (param v278 i32) + (param v282 i32) + (param v290 i32) + (param v355 i32) + (param v357 i32) + (let (v283 u32) (bitcast v278)) + (let (v284 u32) (bitcast v282)) + (let (v285 i1) (lte v283 v284)) + (let (v286 i32) (sext v285)) + (let (v287 i1) (neq v286 0)) + (condbr v287 (block 50) (block 51))) (block 35 - (param v345 i32) - (param v349 i32) - (param v357 i32) - (param v422 i32) - (param v424 i32) - (let (v350 u32) (bitcast v345)) - (let (v351 u32) (bitcast v349)) - (let (v352 i1) (lte v350 v351)) - (let (v353 i32) (sext v352)) - (let (v354 i1) (neq v353 0)) - (condbr v354 (block 51) (block 52))) + (let (v189 i1) (neq v166 0)) + (condbr v189 (block 37) (block 38))) (block 36 - (let (v256 i1) (neq v233 0)) - (condbr v256 (block 38) (block 39))) + (let (v188 i32) (call #core::str::count::do_count_chars v165 v166)) + (br (block 34 v181 v188 v153 v165 v166))) (block 37 - (let (v255 i32) (call #core::str::count::do_count_chars v231 v233)) - (br (block 35 v248 v255 v220 v231 v233))) + (let (v191 i32) (const.i32 3)) + (let (v192 i32) (band v166 v191)) + (let (v193 i32) (const.i32 4)) + (let (v194 u32) (bitcast v166)) + (let (v195 u32) (bitcast v193)) + (let (v196 i1) (gte v194 v195)) + (let (v197 i32) (zext v196)) + (let (v198 i1) (neq v197 0)) + (condbr v198 (block 40) (block 41))) (block 38 - (let (v258 i32) (const.i32 3)) - (let (v259 i32) (band v233 v258)) - (let (v260 i32) (const.i32 4)) - (let (v261 u32) (bitcast v233)) - (let (v262 u32) (bitcast v260)) - (let (v263 i1) (gte v261 v262)) - (let (v264 i32) (zext v263)) - (let (v265 i1) (neq v264 0)) - (condbr v265 (block 41) (block 42))) + (let (v190 i32) (const.i32 0)) + (br (block 34 v181 v190 v153 v165 v166))) (block 39 - (let (v257 i32) (const.i32 0)) - (br (block 35 v248 v257 v220 v231 v233))) + (param v253 i32) + (param v258 i32) + (param v259 i32) + (param v277 i32) + (param v279 i32) + (param v291 i32) + (param v358 i32) + (let (v255 i1) (eq v253 0)) + (let (v256 i32) (zext v255)) + (let (v257 i1) (neq v256 0)) + (condbr v257 (block 34 v279 v277 v291 v258 v358) (block 45))) (block 40 - (param v320 i32) - (param v325 i32) - (param v326 i32) - (param v344 i32) - (param v346 i32) - (param v358 i32) - (param v425 i32) - (let (v322 i1) (eq v320 0)) - (let (v323 i32) (zext v322)) - (let (v324 i1) (neq v323 0)) - (condbr v324 (block 35 v346 v344 v358 v325 v425) (block 46))) + (let (v201 i32) (const.i32 12)) + (let (v202 i32) (band v166 v201)) + (let (v203 i32) (const.i32 0)) + (let (v204 i32) (const.i32 0)) + (br (block 42 v203 v165 v204 v202 v192 v181 v153 v166))) (block 41 - (let (v268 i32) (const.i32 12)) - (let (v269 i32) (band v233 v268)) - (let (v270 i32) (const.i32 0)) - (let (v271 i32) (const.i32 0)) - (br (block 43 v270 v231 v271 v269 v259 v248 v220 v233))) + (let (v199 i32) (const.i32 0)) + (let (v200 i32) (const.i32 0)) + (br (block 39 v192 v165 v200 v199 v181 v153 v166))) (block 42 - (let (v266 i32) (const.i32 0)) - (let (v267 i32) (const.i32 0)) - (br (block 40 v259 v231 v267 v266 v248 v220 v233))) + (param v205 i32) + (param v206 i32) + (param v207 i32) + (param v247 i32) + (param v254 i32) + (param v280 i32) + (param v292 i32) + (param v359 i32) + (let (v208 i32) (add.wrapping v206 v207)) + (let (v209 u32) (bitcast v208)) + (let (v210 (ptr i8)) (inttoptr v209)) + (let (v211 i8) (load v210)) + (let (v212 i32) (sext v211)) + (let (v213 i32) (const.i32 -65)) + (let (v214 i1) (gt v212 v213)) + (let (v215 i32) (zext v214)) + (let (v216 i32) (add.wrapping v205 v215)) + (let (v217 i32) (const.i32 1)) + (let (v218 i32) (add.wrapping v208 v217)) + (let (v219 u32) (bitcast v218)) + (let (v220 (ptr i8)) (inttoptr v219)) + (let (v221 i8) (load v220)) + (let (v222 i32) (sext v221)) + (let (v223 i32) (const.i32 -65)) + (let (v224 i1) (gt v222 v223)) + (let (v225 i32) (zext v224)) + (let (v226 i32) (add.wrapping v216 v225)) + (let (v227 i32) (const.i32 2)) + (let (v228 i32) (add.wrapping v208 v227)) + (let (v229 u32) (bitcast v228)) + (let (v230 (ptr i8)) (inttoptr v229)) + (let (v231 i8) (load v230)) + (let (v232 i32) (sext v231)) + (let (v233 i32) (const.i32 -65)) + (let (v234 i1) (gt v232 v233)) + (let (v235 i32) (zext v234)) + (let (v236 i32) (add.wrapping v226 v235)) + (let (v237 i32) (const.i32 3)) + (let (v238 i32) (add.wrapping v208 v237)) + (let (v239 u32) (bitcast v238)) + (let (v240 (ptr i8)) (inttoptr v239)) + (let (v241 i8) (load v240)) + (let (v242 i32) (sext v241)) + (let (v243 i32) (const.i32 -65)) + (let (v244 i1) (gt v242 v243)) + (let (v245 i32) (zext v244)) + (let (v246 i32) (add.wrapping v236 v245)) + (let (v248 i32) (const.i32 4)) + (let (v249 i32) (add.wrapping v207 v248)) + (let (v250 i1) (neq v247 v249)) + (let (v251 i32) (zext v250)) + (let (v252 i1) (neq v251 0)) + (condbr v252 (block 42 v246 v206 v249 v247 v254 v280 v292 v359) (block 44))) (block 43 - (param v272 i32) - (param v273 i32) - (param v274 i32) - (param v314 i32) - (param v321 i32) - (param v347 i32) - (param v359 i32) - (param v426 i32) - (let (v275 i32) (add.wrapping v273 v274)) - (let (v276 u32) (bitcast v275)) - (let (v277 (ptr i8)) (inttoptr v276)) - (let (v278 i8) (load v277)) - (let (v279 i32) (sext v278)) - (let (v280 i32) (const.i32 -65)) - (let (v281 i1) (gt v279 v280)) - (let (v282 i32) (zext v281)) - (let (v283 i32) (add.wrapping v272 v282)) - (let (v284 i32) (const.i32 1)) - (let (v285 i32) (add.wrapping v275 v284)) - (let (v286 u32) (bitcast v285)) - (let (v287 (ptr i8)) (inttoptr v286)) - (let (v288 i8) (load v287)) - (let (v289 i32) (sext v288)) - (let (v290 i32) (const.i32 -65)) - (let (v291 i1) (gt v289 v290)) - (let (v292 i32) (zext v291)) - (let (v293 i32) (add.wrapping v283 v292)) - (let (v294 i32) (const.i32 2)) - (let (v295 i32) (add.wrapping v275 v294)) - (let (v296 u32) (bitcast v295)) - (let (v297 (ptr i8)) (inttoptr v296)) - (let (v298 i8) (load v297)) - (let (v299 i32) (sext v298)) - (let (v300 i32) (const.i32 -65)) - (let (v301 i1) (gt v299 v300)) - (let (v302 i32) (zext v301)) - (let (v303 i32) (add.wrapping v293 v302)) - (let (v304 i32) (const.i32 3)) - (let (v305 i32) (add.wrapping v275 v304)) - (let (v306 u32) (bitcast v305)) - (let (v307 (ptr i8)) (inttoptr v306)) - (let (v308 i8) (load v307)) - (let (v309 i32) (sext v308)) - (let (v310 i32) (const.i32 -65)) - (let (v311 i1) (gt v309 v310)) - (let (v312 i32) (zext v311)) - (let (v313 i32) (add.wrapping v303 v312)) - (let (v315 i32) (const.i32 4)) - (let (v316 i32) (add.wrapping v274 v315)) - (let (v317 i1) (neq v314 v316)) - (let (v318 i32) (zext v317)) - (let (v319 i1) (neq v318 0)) - (condbr v319 (block 43 v313 v273 v316 v314 v321 v347 v359 v426) (block 45))) + (br (block 39 v254 v206 v249 v246 v280 v292 v359))) (block 44 - (br (block 40 v321 v273 v316 v313 v347 v359 v426))) + (br (block 43))) (block 45 - (br (block 44))) + (let (v260 i32) (add.wrapping v258 v259)) + (br (block 46 v277 v260 v253 v279 v291 v258 v358))) (block 46 - (let (v327 i32) (add.wrapping v325 v326)) - (br (block 47 v344 v327 v320 v346 v358 v325 v425))) + (param v261 i32) + (param v262 i32) + (param v273 i32) + (param v281 i32) + (param v293 i32) + (param v356 i32) + (param v360 i32) + (let (v263 u32) (bitcast v262)) + (let (v264 (ptr i8)) (inttoptr v263)) + (let (v265 i8) (load v264)) + (let (v266 i32) (sext v265)) + (let (v267 i32) (const.i32 -65)) + (let (v268 i1) (gt v266 v267)) + (let (v269 i32) (zext v268)) + (let (v270 i32) (add.wrapping v261 v269)) + (let (v271 i32) (const.i32 1)) + (let (v272 i32) (add.wrapping v262 v271)) + (let (v274 i32) (const.i32 -1)) + (let (v275 i32) (add.wrapping v273 v274)) + (let (v276 i1) (neq v275 0)) + (condbr v276 (block 46 v270 v272 v275 v281 v293 v356 v360) (block 48))) (block 47 - (param v328 i32) - (param v329 i32) - (param v340 i32) - (param v348 i32) - (param v360 i32) - (param v423 i32) - (param v427 i32) - (let (v330 u32) (bitcast v329)) - (let (v331 (ptr i8)) (inttoptr v330)) - (let (v332 i8) (load v331)) - (let (v333 i32) (sext v332)) - (let (v334 i32) (const.i32 -65)) - (let (v335 i1) (gt v333 v334)) - (let (v336 i32) (zext v335)) - (let (v337 i32) (add.wrapping v328 v336)) - (let (v338 i32) (const.i32 1)) - (let (v339 i32) (add.wrapping v329 v338)) - (let (v341 i32) (const.i32 -1)) - (let (v342 i32) (add.wrapping v340 v341)) - (let (v343 i1) (neq v342 0)) - (condbr v343 (block 47 v337 v339 v342 v348 v360 v423 v427) (block 49))) + (br (block 34 v281 v270 v293 v356 v360))) (block 48 - (br (block 35 v348 v337 v360 v423 v427))) + (br (block 47))) (block 49 - (br (block 48))) + (let (v375 u32) (bitcast v340)) + (let (v376 u32) (add.checked v375 12)) + (let (v377 u32) (mod.unchecked v376 4)) + (assertz 250 v377) + (let (v378 (ptr i32)) (inttoptr v376)) + (let (v379 i32) (load v378)) + (let (v380 i1) (eq v379 0)) + (let (v381 i32) (zext v380)) + (let (v382 i1) (neq v381 0)) + (condbr v382 (block 59) (block 60))) (block 50 - (let (v438 i32) (const.i32 1)) - (let (v443 u32) (bitcast v407)) - (let (v444 u32) (add.checked v443 12)) - (let (v445 u32) (mod.unchecked v444 4)) - (assertz 250 v445) - (let (v446 (ptr i32)) (inttoptr v444)) - (let (v447 i32) (load v446)) - (let (v448 i1) (neq v447 0)) - (condbr v448 (block 60 v438) (block 61))) + (let (v350 u32) (bitcast v290)) + (let (v351 u32) (add.checked v350 20)) + (let (v352 u32) (mod.unchecked v351 4)) + (assertz 250 v352) + (let (v353 (ptr i32)) (inttoptr v351)) + (let (v354 i32) (load v353)) + (let (v361 u32) (bitcast v290)) + (let (v362 u32) (add.checked v361 24)) + (let (v363 u32) (mod.unchecked v362 4)) + (assertz 250 v363) + (let (v364 (ptr i32)) (inttoptr v362)) + (let (v365 i32) (load v364)) + (let (v366 u32) (bitcast v365)) + (let (v367 u32) (add.checked v366 12)) + (let (v368 u32) (mod.unchecked v367 4)) + (assertz 250 v368) + (let (v369 (ptr i32)) (inttoptr v367)) + (let (v370 i32) (load v369)) + (ret v370)) (block 51 - (let (v417 u32) (bitcast v357)) - (let (v418 u32) (add.checked v417 20)) - (let (v419 u32) (mod.unchecked v418 4)) - (assertz 250 v419) - (let (v420 (ptr i32)) (inttoptr v418)) - (let (v421 i32) (load v420)) - (let (v428 u32) (bitcast v357)) - (let (v429 u32) (add.checked v428 24)) - (let (v430 u32) (mod.unchecked v429 4)) - (assertz 250 v430) - (let (v431 (ptr i32)) (inttoptr v429)) - (let (v432 i32) (load v431)) - (let (v433 u32) (bitcast v432)) - (let (v434 u32) (add.checked v433 12)) - (let (v435 u32) (mod.unchecked v434 4)) - (assertz 250 v435) - (let (v436 (ptr i32)) (inttoptr v434)) - (let (v437 i32) (load v436)) - (ret v437)) + (let (v288 i32) (sub.wrapping v278 v282)) + (let (v289 i32) (const.i32 0)) + (let (v294 u32) (bitcast v290)) + (let (v295 u32) (add.checked v294 32)) + (let (v296 (ptr u8)) (inttoptr v295)) + (let (v297 u8) (load v296)) + (let (v298 i32) (zext v297)) + (let (v299 u32) (cast v298)) + (switchv299 + (0 . (block 54)) + (1 . (block 53)) + (2 . (block 52 v289 v290 v355 v357 v288)) + (3 . (block 52 v289 v290 v355 v357 v288)) + (_ . (block 52 v289 v290 v355 v357 v288)))) (block 52 - (let (v355 i32) (sub.wrapping v345 v349)) - (let (v356 i32) (const.i32 0)) - (let (v361 u32) (bitcast v357)) - (let (v362 u32) (add.checked v361 32)) - (let (v363 (ptr u8)) (inttoptr v362)) - (let (v364 u8) (load v363)) - (let (v365 i32) (zext v364)) - (let (v366 u32) (cast v365)) - (switchv366 - (0 . (block 55)) - (1 . (block 54)) - (2 . (block 53 v356 v357 v422 v424 v355)) - (3 . (block 53 v356 v357 v422 v424 v355)) - (_ . (block 53 v356 v357 v422 v424 v355)))) + (param v313 i32) + (param v316 i32) + (param v372 i32) + (param v374 i32) + (param v408 i32) + (let (v314 i32) (const.i32 1)) + (let (v315 i32) (add.wrapping v313 v314)) + (let (v317 u32) (bitcast v316)) + (let (v318 u32) (add.checked v317 16)) + (let (v319 u32) (mod.unchecked v318 4)) + (assertz 250 v319) + (let (v320 (ptr i32)) (inttoptr v318)) + (let (v321 i32) (load v320)) + (let (v322 u32) (bitcast v316)) + (let (v323 u32) (add.checked v322 24)) + (let (v324 u32) (mod.unchecked v323 4)) + (assertz 250 v324) + (let (v325 (ptr i32)) (inttoptr v323)) + (let (v326 i32) (load v325)) + (let (v327 u32) (bitcast v316)) + (let (v328 u32) (add.checked v327 20)) + (let (v329 u32) (mod.unchecked v328 4)) + (assertz 250 v329) + (let (v330 (ptr i32)) (inttoptr v328)) + (let (v331 i32) (load v330)) + (br (block 55 v315 v331 v321 v326 v372 v374 v408))) (block 53 - (param v380 i32) - (param v383 i32) - (param v440 i32) - (param v442 i32) - (param v469 i32) - (let (v381 i32) (const.i32 1)) - (let (v382 i32) (add.wrapping v380 v381)) - (let (v384 u32) (bitcast v383)) - (let (v385 u32) (add.checked v384 16)) - (let (v386 u32) (mod.unchecked v385 4)) - (assertz 250 v386) - (let (v387 (ptr i32)) (inttoptr v385)) - (let (v388 i32) (load v387)) - (let (v389 u32) (bitcast v383)) - (let (v390 u32) (add.checked v389 24)) - (let (v391 u32) (mod.unchecked v390 4)) - (assertz 250 v391) - (let (v392 (ptr i32)) (inttoptr v390)) - (let (v393 i32) (load v392)) - (let (v394 u32) (bitcast v383)) - (let (v395 u32) (add.checked v394 20)) - (let (v396 u32) (mod.unchecked v395 4)) - (assertz 250 v396) - (let (v397 (ptr i32)) (inttoptr v395)) - (let (v398 i32) (load v397)) - (br (block 56 v382 v398 v388 v393 v440 v442 v469))) + (let (v301 i32) (const.i32 1)) + (let (v302 u32) (bitcast v288)) + (let (v303 u32) (bitcast v301)) + (let (v304 u32) (shr.wrapping v302 v303)) + (let (v305 i32) (bitcast v304)) + (let (v306 i32) (const.i32 1)) + (let (v307 i32) (add.wrapping v288 v306)) + (let (v308 i32) (const.i32 1)) + (let (v309 u32) (bitcast v307)) + (let (v310 u32) (bitcast v308)) + (let (v311 u32) (shr.wrapping v309 v310)) + (let (v312 i32) (bitcast v311)) + (br (block 52 v305 v290 v355 v357 v312))) (block 54 - (let (v368 i32) (const.i32 1)) - (let (v369 u32) (bitcast v355)) - (let (v370 u32) (bitcast v368)) - (let (v371 u32) (shr.wrapping v369 v370)) - (let (v372 i32) (bitcast v371)) - (let (v373 i32) (const.i32 1)) - (let (v374 i32) (add.wrapping v355 v373)) - (let (v375 i32) (const.i32 1)) - (let (v376 u32) (bitcast v374)) - (let (v377 u32) (bitcast v375)) - (let (v378 u32) (shr.wrapping v376 v377)) - (let (v379 i32) (bitcast v378)) - (br (block 53 v372 v357 v422 v424 v379))) + (let (v300 i32) (const.i32 0)) + (br (block 52 v288 v290 v355 v357 v300))) (block 55 - (let (v367 i32) (const.i32 0)) - (br (block 53 v355 v357 v422 v424 v367))) + (param v332 i32) + (param v338 i32) + (param v339 i32) + (param v340 i32) + (param v371 i32) + (param v373 i32) + (param v407 i32) + (let (v333 i32) (const.i32 -1)) + (let (v334 i32) (add.wrapping v332 v333)) + (let (v335 i1) (eq v334 0)) + (let (v336 i32) (zext v335)) + (let (v337 i1) (neq v336 0)) + (condbr v337 (block 49) (block 57))) (block 56 - (param v399 i32) - (param v405 i32) - (param v406 i32) - (param v407 i32) - (param v439 i32) - (param v441 i32) - (param v468 i32) - (let (v400 i32) (const.i32 -1)) - (let (v401 i32) (add.wrapping v399 v400)) - (let (v402 i1) (eq v401 0)) - (let (v403 i32) (zext v402)) - (let (v404 i1) (neq v403 0)) - (condbr v404 (block 50) (block 58))) + (let (v349 i32) (const.i32 1)) + (ret v349)) (block 57 - (let (v416 i32) (const.i32 1)) - (ret v416)) + (let (v341 u32) (bitcast v340)) + (let (v342 u32) (add.checked v341 16)) + (let (v343 u32) (mod.unchecked v342 4)) + (assertz 250 v343) + (let (v344 (ptr i32)) (inttoptr v342)) + (let (v345 i32) (load v344)) + (let (v346 i1) (eq v345 0)) + (let (v347 i32) (zext v346)) + (let (v348 i1) (neq v347 0)) + (condbr v348 (block 55 v334 v338 v339 v340 v371 v373 v407) (block 58))) (block 58 - (let (v408 u32) (bitcast v407)) - (let (v409 u32) (add.checked v408 16)) - (let (v410 u32) (mod.unchecked v409 4)) - (assertz 250 v410) - (let (v411 (ptr i32)) (inttoptr v409)) - (let (v412 i32) (load v411)) - (let (v413 i1) (eq v412 0)) - (let (v414 i32) (zext v413)) - (let (v415 i1) (neq v414 0)) - (condbr v415 (block 56 v401 v405 v406 v407 v439 v441 v468) (block 59))) + (br (block 56))) (block 59 - (br (block 57))) + (let (v384 i32) (const.i32 0)) + (br (block 61 v407 v384 v338 v339 v340))) - (block 60 (param v478 i32) - (ret v478)) + (block 60 + (let (v383 i32) (const.i32 1)) + (ret v383)) (block 61 - (let (v449 i32) (const.i32 0)) - (br (block 63 v468 v449 v405 v406 v407))) - - (block 62 (param v472 i32) (param v473 i32) - (let (v474 u32) (bitcast v472)) - (let (v475 u32) (bitcast v473)) - (let (v476 i1) (lt v474 v475)) - (let (v477 i32) (sext v476)) - (br (block 60 v477))) + (param v385 i32) + (param v386 i32) + (param v396 i32) + (param v397 i32) + (param v398 i32) + (let (v387 i1) (neq v385 v386)) + (let (v388 i32) (zext v387)) + (let (v389 i1) (neq v388 0)) + (condbr v389 (block 63) (block 64))) + + (block 62 + (let (v409 i32) (const.i32 -1)) + (let (v410 i32) (add.wrapping v395 v409)) + (let (v411 u32) (bitcast v410)) + (let (v412 u32) (bitcast v385)) + (let (v413 i1) (lt v411 v412)) + (let (v414 i32) (sext v413)) + (ret v414)) (block 63 - (param v450 i32) - (param v451 i32) - (param v457 i32) - (param v458 i32) - (param v459 i32) - (let (v452 i1) (neq v450 v451)) - (let (v453 i32) (zext v452)) - (let (v454 i1) (neq v453 0)) - (condbr v454 (block 65) (block 66))) + (let (v394 i32) (const.i32 1)) + (let (v395 i32) (add.wrapping v386 v394)) + (let (v399 u32) (bitcast v398)) + (let (v400 u32) (add.checked v399 16)) + (let (v401 u32) (mod.unchecked v400 4)) + (assertz 250 v401) + (let (v402 (ptr i32)) (inttoptr v400)) + (let (v403 i32) (load v402)) + (let (v404 i1) (eq v403 0)) + (let (v405 i32) (zext v404)) + (let (v406 i1) (neq v405 0)) + (condbr v406 (block 61 v385 v395 v396 v397 v398) (block 65))) (block 64 - (let (v470 i32) (const.i32 -1)) - (let (v471 i32) (add.wrapping v456 v470)) - (br (block 62 v471 v450))) + (let (v390 u32) (bitcast v385)) + (let (v391 u32) (bitcast v385)) + (let (v392 i1) (lt v390 v391)) + (let (v393 i32) (sext v392)) + (ret v393)) (block 65 - (let (v455 i32) (const.i32 1)) - (let (v456 i32) (add.wrapping v451 v455)) - (let (v460 u32) (bitcast v459)) - (let (v461 u32) (add.checked v460 16)) - (let (v462 u32) (mod.unchecked v461 4)) - (assertz 250 v462) - (let (v463 (ptr i32)) (inttoptr v461)) - (let (v464 i32) (load v463)) - (let (v465 i1) (eq v464 0)) - (let (v466 i32) (zext v465)) - (let (v467 i1) (neq v466 0)) - (condbr v467 (block 63 v450 v456 v457 v458 v459) (block 67))) - - (block 66 - (br (block 62 v450 v450))) - - (block 67 - (br (block 64))) + (br (block 62))) ) (func (export #core::fmt::num::imp::::fmt) @@ -2969,28 +2955,6 @@ (br (block 4 v398))) ) - (func (export #::type_id) - (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) - (let (v2 i64) (const.i64 5799598635382251841)) - (let (v3 u32) (bitcast v0)) - (let (v4 u32) (add.checked v3 8)) - (let (v5 u32) (mod.unchecked v4 8)) - (assertz 250 v5) - (let (v6 (ptr i64)) (inttoptr v4)) - (store v6 v2) - (let (v7 i64) (const.i64 3885382061309546557)) - (let (v8 u32) (bitcast v0)) - (let (v9 u32) (mod.unchecked v8 8)) - (assertz 250 v9) - (let (v10 (ptr i64)) (inttoptr v8)) - (store v10 v7) - (br (block 1))) - - (block 1 - (ret)) - ) - (func (export #core::fmt::builders::DebugStruct::field) (param i32) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 @@ -3018,25 +2982,25 @@ (block 1 (param v5 i32) (ret v5)) - (block 2 (param v246 i32) (param v254 i32) (param v260 i32) - (let (v248 i32) (const.i32 1)) - (let (v249 u32) (bitcast v248)) - (let (v250 u8) (trunc v249)) - (let (v251 u32) (bitcast v246)) - (let (v252 u32) (add.checked v251 5)) - (let (v253 (ptr u8)) (inttoptr v252)) - (store v253 v250) - (let (v255 u32) (bitcast v254)) - (let (v256 u8) (trunc v255)) - (let (v257 u32) (bitcast v246)) - (let (v258 u32) (add.checked v257 4)) - (let (v259 (ptr u8)) (inttoptr v258)) - (store v259 v256) - (let (v261 i32) (const.i32 64)) - (let (v262 i32) (add.wrapping v260 v261)) - (let (v263 (ptr i32)) (global.symbol #__stack_pointer)) - (store v263 v262) - (br (block 1 v246))) + (block 2 (param v244 i32) (param v252 i32) (param v258 i32) + (let (v246 i32) (const.i32 1)) + (let (v247 u32) (bitcast v246)) + (let (v248 u8) (trunc v247)) + (let (v249 u32) (bitcast v244)) + (let (v250 u32) (add.checked v249 5)) + (let (v251 (ptr u8)) (inttoptr v250)) + (store v251 v248) + (let (v253 u32) (bitcast v252)) + (let (v254 u8) (trunc v253)) + (let (v255 u32) (bitcast v244)) + (let (v256 u32) (add.checked v255 4)) + (let (v257 (ptr u8)) (inttoptr v256)) + (store v257 v254) + (let (v259 i32) (const.i32 64)) + (let (v260 i32) (add.wrapping v258 v259)) + (let (v261 (ptr i32)) (global.symbol #__stack_pointer)) + (store v261 v260) + (br (block 1 v244))) (block 3 (let (v19 u32) (bitcast v0)) @@ -3061,10 +3025,11 @@ (condbr v35 (block 4) (block 5))) (block 4 - (let (v104 i32) (const.i32 255)) - (let (v105 i32) (band v23 v104)) - (let (v106 i1) (neq v105 0)) - (condbr v106 (block 9 v10 v27 v32 v1 v2 v3 v4 v0) (block 10))) + (let (v102 i32) (const.i32 1)) + (let (v103 i32) (const.i32 1)) + (let (v104 i32) (band v23 v103)) + (let (v105 i1) (neq v104 0)) + (condbr v105 (block 9 v10 v27 v32 v1 v2 v3 v4 v0) (block 10))) (block 5 (let (v36 i32) (const.i32 1)) @@ -3074,9 +3039,9 @@ (assertz 250 v39) (let (v40 (ptr i32)) (inttoptr v38)) (let (v41 i32) (load v40)) - (let (v42 i32) (const.i32 1048959)) - (let (v43 i32) (const.i32 1048956)) - (let (v44 i32) (const.i32 255)) + (let (v42 i32) (const.i32 1048963)) + (let (v43 i32) (const.i32 1048960)) + (let (v44 i32) (const.i32 1)) (let (v45 i32) (band v23 v44)) (let (v46 i1) (neq v45 0)) (let (v47 i32) (select v46 v42 v43)) @@ -3100,249 +3065,246 @@ (condbr v62 (block 2 v0 v36 v10) (block 6))) (block 6 - (let (v63 i32) (const.i32 1)) - (let (v64 u32) (bitcast v27)) - (let (v65 u32) (add.checked v64 20)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v27)) - (let (v70 u32) (add.checked v69 24)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (let (v74 u32) (bitcast v73)) - (let (v75 u32) (add.checked v74 12)) - (let (v76 u32) (mod.unchecked v75 4)) - (assertz 250 v76) - (let (v77 (ptr i32)) (inttoptr v75)) - (let (v78 i32) (load v77)) - (let (v79 i1) (neq v78 0)) - (condbr v79 (block 2 v0 v63 v10) (block 7))) + (let (v63 u32) (bitcast v27)) + (let (v64 u32) (add.checked v63 20)) + (let (v65 u32) (mod.unchecked v64 4)) + (assertz 250 v65) + (let (v66 (ptr i32)) (inttoptr v64)) + (let (v67 i32) (load v66)) + (let (v68 u32) (bitcast v27)) + (let (v69 u32) (add.checked v68 24)) + (let (v70 u32) (mod.unchecked v69 4)) + (assertz 250 v70) + (let (v71 (ptr i32)) (inttoptr v69)) + (let (v72 i32) (load v71)) + (let (v73 u32) (bitcast v72)) + (let (v74 u32) (add.checked v73 12)) + (let (v75 u32) (mod.unchecked v74 4)) + (assertz 250 v75) + (let (v76 (ptr i32)) (inttoptr v74)) + (let (v77 i32) (load v76)) + (let (v78 i1) (neq v77 0)) + (condbr v78 (block 2 v0 v36 v10) (block 7))) (block 7 - (let (v80 i32) (const.i32 1)) - (let (v81 u32) (bitcast v27)) - (let (v82 u32) (add.checked v81 20)) - (let (v83 u32) (mod.unchecked v82 4)) - (assertz 250 v83) - (let (v84 (ptr i32)) (inttoptr v82)) - (let (v85 i32) (load v84)) - (let (v86 i32) (const.i32 1048924)) - (let (v87 i32) (const.i32 2)) - (let (v88 u32) (bitcast v27)) - (let (v89 u32) (add.checked v88 24)) - (let (v90 u32) (mod.unchecked v89 4)) - (assertz 250 v90) - (let (v91 (ptr i32)) (inttoptr v89)) - (let (v92 i32) (load v91)) - (let (v93 u32) (bitcast v92)) - (let (v94 u32) (add.checked v93 12)) - (let (v95 u32) (mod.unchecked v94 4)) - (assertz 250 v95) - (let (v96 (ptr i32)) (inttoptr v94)) - (let (v97 i32) (load v96)) - (let (v98 i1) (neq v97 0)) - (condbr v98 (block 2 v0 v80 v10) (block 8))) - - (block 8 - (let (v99 u32) (bitcast v4)) - (let (v100 u32) (add.checked v99 12)) - (let (v101 u32) (mod.unchecked v100 4)) - (assertz 250 v101) - (let (v102 (ptr i32)) (inttoptr v100)) - (let (v103 i32) (load v102)) - (br (block 2 v0 v103 v10))) + (let (v79 u32) (bitcast v27)) + (let (v80 u32) (add.checked v79 20)) + (let (v81 u32) (mod.unchecked v80 4)) + (assertz 250 v81) + (let (v82 (ptr i32)) (inttoptr v80)) + (let (v83 i32) (load v82)) + (let (v84 i32) (const.i32 1048928)) + (let (v85 i32) (const.i32 2)) + (let (v86 u32) (bitcast v27)) + (let (v87 u32) (add.checked v86 24)) + (let (v88 u32) (mod.unchecked v87 4)) + (assertz 250 v88) + (let (v89 (ptr i32)) (inttoptr v87)) + (let (v90 i32) (load v89)) + (let (v91 u32) (bitcast v90)) + (let (v92 u32) (add.checked v91 12)) + (let (v93 u32) (mod.unchecked v92 4)) + (assertz 250 v93) + (let (v94 (ptr i32)) (inttoptr v92)) + (let (v95 i32) (load v94)) + (let (v96 i1) (neq v95 0)) + (condbr v96 (block 2 v0 v36 v10) (block 8))) - (block 9 - (param v132 i32) - (param v139 i32) - (param v173 i32) - (param v209 i32) - (param v210 i32) - (param v219 i32) - (param v222 i32) - (param v247 i32) + (block 8 + (let (v97 u32) (bitcast v4)) + (let (v98 u32) (add.checked v97 12)) + (let (v99 u32) (mod.unchecked v98 4)) + (assertz 250 v99) + (let (v100 (ptr i32)) (inttoptr v98)) + (let (v101 i32) (load v100)) + (br (block 2 v0 v101 v10))) + + (block 9 + (param v130 i32) + (param v137 i32) + (param v171 i32) + (param v207 i32) + (param v208 i32) + (param v217 i32) + (param v220 i32) + (param v245 i32) + (let (v129 i32) (const.i32 1)) (let (v131 i32) (const.i32 1)) - (let (v133 i32) (const.i32 1)) - (let (v134 u32) (bitcast v133)) - (let (v135 u8) (trunc v134)) - (let (v136 u32) (bitcast v132)) - (let (v137 u32) (add.checked v136 27)) - (let (v138 (ptr u8)) (inttoptr v137)) - (store v138 v135) - (let (v140 u32) (bitcast v139)) - (let (v141 u32) (add.checked v140 20)) - (let (v142 u32) (mod.unchecked v141 4)) - (assertz 250 v142) - (let (v143 (ptr i64)) (inttoptr v141)) - (let (v144 i64) (load v143)) - (let (v145 u32) (bitcast v132)) - (let (v146 u32) (add.checked v145 12)) - (let (v147 u32) (mod.unchecked v146 4)) - (assertz 250 v147) - (let (v148 (ptr i64)) (inttoptr v146)) - (store v148 v144) - (let (v149 i32) (const.i32 1048928)) - (let (v150 u32) (bitcast v132)) - (let (v151 u32) (add.checked v150 52)) - (let (v152 u32) (mod.unchecked v151 4)) - (assertz 250 v152) - (let (v153 (ptr i32)) (inttoptr v151)) - (store v153 v149) - (let (v154 i32) (const.i32 27)) - (let (v155 i32) (add.wrapping v132 v154)) - (let (v156 u32) (bitcast v132)) - (let (v157 u32) (add.checked v156 20)) - (let (v158 u32) (mod.unchecked v157 4)) - (assertz 250 v158) - (let (v159 (ptr i32)) (inttoptr v157)) - (store v159 v155) - (let (v160 u32) (bitcast v139)) - (let (v161 u32) (add.checked v160 8)) - (let (v162 u32) (mod.unchecked v161 4)) - (assertz 250 v162) - (let (v163 (ptr i64)) (inttoptr v161)) - (let (v164 i64) (load v163)) - (let (v165 u32) (bitcast v132)) - (let (v166 u32) (add.checked v165 36)) - (let (v167 u32) (mod.unchecked v166 4)) - (assertz 250 v167) - (let (v168 (ptr i64)) (inttoptr v166)) - (store v168 v164) - (let (v169 u32) (bitcast v139)) - (let (v170 u32) (mod.unchecked v169 4)) - (assertz 250 v170) - (let (v171 (ptr i64)) (inttoptr v169)) - (let (v172 i64) (load v171)) - (let (v174 u32) (bitcast v132)) - (let (v175 u32) (add.checked v174 56)) - (let (v176 u32) (mod.unchecked v175 4)) - (assertz 250 v176) - (let (v177 (ptr i32)) (inttoptr v175)) - (store v177 v173) - (let (v178 u32) (bitcast v139)) - (let (v179 u32) (add.checked v178 16)) - (let (v180 u32) (mod.unchecked v179 4)) - (assertz 250 v180) - (let (v181 (ptr i32)) (inttoptr v179)) - (let (v182 i32) (load v181)) - (let (v183 u32) (bitcast v132)) - (let (v184 u32) (add.checked v183 44)) - (let (v185 u32) (mod.unchecked v184 4)) - (assertz 250 v185) - (let (v186 (ptr i32)) (inttoptr v184)) - (store v186 v182) - (let (v187 u32) (bitcast v139)) - (let (v188 u32) (add.checked v187 32)) - (let (v189 (ptr u8)) (inttoptr v188)) - (let (v190 u8) (load v189)) - (let (v191 i32) (zext v190)) - (let (v192 u32) (bitcast v191)) - (let (v193 u8) (trunc v192)) - (let (v194 u32) (bitcast v132)) - (let (v195 u32) (add.checked v194 60)) - (let (v196 (ptr u8)) (inttoptr v195)) - (store v196 v193) - (let (v197 u32) (bitcast v132)) - (let (v198 u32) (add.checked v197 28)) - (let (v199 u32) (mod.unchecked v198 4)) - (assertz 250 v199) - (let (v200 (ptr i64)) (inttoptr v198)) - (store v200 v172) - (let (v201 i32) (const.i32 12)) - (let (v202 i32) (add.wrapping v132 v201)) - (let (v203 u32) (bitcast v132)) - (let (v204 u32) (add.checked v203 48)) - (let (v205 u32) (mod.unchecked v204 4)) - (assertz 250 v205) - (let (v206 (ptr i32)) (inttoptr v204)) - (store v206 v202) - (let (v207 i32) (const.i32 12)) - (let (v208 i32) (add.wrapping v132 v207)) - (let (v211 i32) (call #::write_str v208 v209 v210)) - (let (v212 i1) (neq v211 0)) - (condbr v212 (block 2 v247 v131 v132) (block 12))) + (let (v132 u32) (bitcast v131)) + (let (v133 u8) (trunc v132)) + (let (v134 u32) (bitcast v130)) + (let (v135 u32) (add.checked v134 27)) + (let (v136 (ptr u8)) (inttoptr v135)) + (store v136 v133) + (let (v138 u32) (bitcast v137)) + (let (v139 u32) (add.checked v138 20)) + (let (v140 u32) (mod.unchecked v139 4)) + (assertz 250 v140) + (let (v141 (ptr i64)) (inttoptr v139)) + (let (v142 i64) (load v141)) + (let (v143 u32) (bitcast v130)) + (let (v144 u32) (add.checked v143 12)) + (let (v145 u32) (mod.unchecked v144 4)) + (assertz 250 v145) + (let (v146 (ptr i64)) (inttoptr v144)) + (store v146 v142) + (let (v147 i32) (const.i32 1048932)) + (let (v148 u32) (bitcast v130)) + (let (v149 u32) (add.checked v148 52)) + (let (v150 u32) (mod.unchecked v149 4)) + (assertz 250 v150) + (let (v151 (ptr i32)) (inttoptr v149)) + (store v151 v147) + (let (v152 i32) (const.i32 27)) + (let (v153 i32) (add.wrapping v130 v152)) + (let (v154 u32) (bitcast v130)) + (let (v155 u32) (add.checked v154 20)) + (let (v156 u32) (mod.unchecked v155 4)) + (assertz 250 v156) + (let (v157 (ptr i32)) (inttoptr v155)) + (store v157 v153) + (let (v158 u32) (bitcast v137)) + (let (v159 u32) (add.checked v158 8)) + (let (v160 u32) (mod.unchecked v159 4)) + (assertz 250 v160) + (let (v161 (ptr i64)) (inttoptr v159)) + (let (v162 i64) (load v161)) + (let (v163 u32) (bitcast v130)) + (let (v164 u32) (add.checked v163 36)) + (let (v165 u32) (mod.unchecked v164 4)) + (assertz 250 v165) + (let (v166 (ptr i64)) (inttoptr v164)) + (store v166 v162) + (let (v167 u32) (bitcast v137)) + (let (v168 u32) (mod.unchecked v167 4)) + (assertz 250 v168) + (let (v169 (ptr i64)) (inttoptr v167)) + (let (v170 i64) (load v169)) + (let (v172 u32) (bitcast v130)) + (let (v173 u32) (add.checked v172 56)) + (let (v174 u32) (mod.unchecked v173 4)) + (assertz 250 v174) + (let (v175 (ptr i32)) (inttoptr v173)) + (store v175 v171) + (let (v176 u32) (bitcast v137)) + (let (v177 u32) (add.checked v176 16)) + (let (v178 u32) (mod.unchecked v177 4)) + (assertz 250 v178) + (let (v179 (ptr i32)) (inttoptr v177)) + (let (v180 i32) (load v179)) + (let (v181 u32) (bitcast v130)) + (let (v182 u32) (add.checked v181 44)) + (let (v183 u32) (mod.unchecked v182 4)) + (assertz 250 v183) + (let (v184 (ptr i32)) (inttoptr v182)) + (store v184 v180) + (let (v185 u32) (bitcast v137)) + (let (v186 u32) (add.checked v185 32)) + (let (v187 (ptr u8)) (inttoptr v186)) + (let (v188 u8) (load v187)) + (let (v189 i32) (zext v188)) + (let (v190 u32) (bitcast v189)) + (let (v191 u8) (trunc v190)) + (let (v192 u32) (bitcast v130)) + (let (v193 u32) (add.checked v192 60)) + (let (v194 (ptr u8)) (inttoptr v193)) + (store v194 v191) + (let (v195 u32) (bitcast v130)) + (let (v196 u32) (add.checked v195 28)) + (let (v197 u32) (mod.unchecked v196 4)) + (assertz 250 v197) + (let (v198 (ptr i64)) (inttoptr v196)) + (store v198 v170) + (let (v199 i32) (const.i32 12)) + (let (v200 i32) (add.wrapping v130 v199)) + (let (v201 u32) (bitcast v130)) + (let (v202 u32) (add.checked v201 48)) + (let (v203 u32) (mod.unchecked v202 4)) + (assertz 250 v203) + (let (v204 (ptr i32)) (inttoptr v202)) + (store v204 v200) + (let (v205 i32) (const.i32 12)) + (let (v206 i32) (add.wrapping v130 v205)) + (let (v209 i32) (call #::write_str v206 v207 v208)) + (let (v210 i1) (neq v209 0)) + (condbr v210 (block 2 v245 v129 v130) (block 12))) (block 10 - (let (v107 i32) (const.i32 1)) - (let (v108 u32) (bitcast v27)) - (let (v109 u32) (add.checked v108 20)) - (let (v110 u32) (mod.unchecked v109 4)) - (assertz 250 v110) - (let (v111 (ptr i32)) (inttoptr v109)) - (let (v112 i32) (load v111)) - (let (v113 i32) (const.i32 1048961)) - (let (v114 i32) (const.i32 3)) - (let (v115 u32) (bitcast v27)) - (let (v116 u32) (add.checked v115 24)) - (let (v117 u32) (mod.unchecked v116 4)) - (assertz 250 v117) - (let (v118 (ptr i32)) (inttoptr v116)) - (let (v119 i32) (load v118)) - (let (v120 u32) (bitcast v119)) - (let (v121 u32) (add.checked v120 12)) - (let (v122 u32) (mod.unchecked v121 4)) - (assertz 250 v122) - (let (v123 (ptr i32)) (inttoptr v121)) - (let (v124 i32) (load v123)) - (let (v125 i1) (neq v124 0)) - (condbr v125 (block 2 v0 v107 v10) (block 11))) + (let (v106 u32) (bitcast v27)) + (let (v107 u32) (add.checked v106 20)) + (let (v108 u32) (mod.unchecked v107 4)) + (assertz 250 v108) + (let (v109 (ptr i32)) (inttoptr v107)) + (let (v110 i32) (load v109)) + (let (v111 i32) (const.i32 1048965)) + (let (v112 i32) (const.i32 3)) + (let (v113 u32) (bitcast v27)) + (let (v114 u32) (add.checked v113 24)) + (let (v115 u32) (mod.unchecked v114 4)) + (assertz 250 v115) + (let (v116 (ptr i32)) (inttoptr v114)) + (let (v117 i32) (load v116)) + (let (v118 u32) (bitcast v117)) + (let (v119 u32) (add.checked v118 12)) + (let (v120 u32) (mod.unchecked v119 4)) + (assertz 250 v120) + (let (v121 (ptr i32)) (inttoptr v119)) + (let (v122 i32) (load v121)) + (let (v123 i1) (neq v122 0)) + (condbr v123 (block 2 v0 v102 v10) (block 11))) (block 11 - (let (v126 u32) (bitcast v27)) - (let (v127 u32) (add.checked v126 28)) - (let (v128 u32) (mod.unchecked v127 4)) - (assertz 250 v128) - (let (v129 (ptr i32)) (inttoptr v127)) - (let (v130 i32) (load v129)) - (br (block 9 v10 v27 v130 v1 v2 v3 v4 v0))) + (let (v124 u32) (bitcast v27)) + (let (v125 u32) (add.checked v124 28)) + (let (v126 u32) (mod.unchecked v125 4)) + (assertz 250 v126) + (let (v127 (ptr i32)) (inttoptr v125)) + (let (v128 i32) (load v127)) + (br (block 9 v10 v27 v128 v1 v2 v3 v4 v0))) (block 12 - (let (v213 i32) (const.i32 12)) - (let (v214 i32) (add.wrapping v132 v213)) - (let (v215 i32) (const.i32 1048924)) - (let (v216 i32) (const.i32 2)) - (let (v217 i32) (call #::write_str v214 v215 v216)) - (let (v218 i1) (neq v217 0)) - (condbr v218 (block 2 v247 v131 v132) (block 13))) + (let (v211 i32) (const.i32 12)) + (let (v212 i32) (add.wrapping v130 v211)) + (let (v213 i32) (const.i32 1048928)) + (let (v214 i32) (const.i32 2)) + (let (v215 i32) (call #::write_str v212 v213 v214)) + (let (v216 i1) (neq v215 0)) + (condbr v216 (block 2 v245 v129 v130) (block 13))) (block 13 - (let (v220 i32) (const.i32 28)) - (let (v221 i32) (add.wrapping v132 v220)) - (let (v223 u32) (bitcast v222)) - (let (v224 u32) (add.checked v223 12)) - (let (v225 u32) (mod.unchecked v224 4)) - (assertz 250 v225) - (let (v226 (ptr i32)) (inttoptr v224)) - (let (v227 i32) (load v226)) - (let (v228 i1) (neq v227 0)) - (condbr v228 (block 2 v247 v131 v132) (block 14))) + (let (v218 i32) (const.i32 28)) + (let (v219 i32) (add.wrapping v130 v218)) + (let (v221 u32) (bitcast v220)) + (let (v222 u32) (add.checked v221 12)) + (let (v223 u32) (mod.unchecked v222 4)) + (assertz 250 v223) + (let (v224 (ptr i32)) (inttoptr v222)) + (let (v225 i32) (load v224)) + (let (v226 i1) (neq v225 0)) + (condbr v226 (block 2 v245 v129 v130) (block 14))) (block 14 - (let (v229 u32) (bitcast v132)) - (let (v230 u32) (add.checked v229 48)) - (let (v231 u32) (mod.unchecked v230 4)) - (assertz 250 v231) - (let (v232 (ptr i32)) (inttoptr v230)) - (let (v233 i32) (load v232)) - (let (v234 i32) (const.i32 1048964)) - (let (v235 i32) (const.i32 2)) - (let (v236 u32) (bitcast v132)) - (let (v237 u32) (add.checked v236 52)) - (let (v238 u32) (mod.unchecked v237 4)) - (assertz 250 v238) - (let (v239 (ptr i32)) (inttoptr v237)) - (let (v240 i32) (load v239)) - (let (v241 u32) (bitcast v240)) - (let (v242 u32) (add.checked v241 12)) - (let (v243 u32) (mod.unchecked v242 4)) - (assertz 250 v243) - (let (v244 (ptr i32)) (inttoptr v242)) - (let (v245 i32) (load v244)) - (br (block 2 v247 v245 v132))) + (let (v227 u32) (bitcast v130)) + (let (v228 u32) (add.checked v227 48)) + (let (v229 u32) (mod.unchecked v228 4)) + (assertz 250 v229) + (let (v230 (ptr i32)) (inttoptr v228)) + (let (v231 i32) (load v230)) + (let (v232 i32) (const.i32 1048968)) + (let (v233 i32) (const.i32 2)) + (let (v234 u32) (bitcast v130)) + (let (v235 u32) (add.checked v234 52)) + (let (v236 u32) (mod.unchecked v235 4)) + (assertz 250 v236) + (let (v237 (ptr i32)) (inttoptr v235)) + (let (v238 i32) (load v237)) + (let (v239 u32) (bitcast v238)) + (let (v240 u32) (add.checked v239 12)) + (let (v241 u32) (mod.unchecked v240 4)) + (assertz 250 v241) + (let (v242 (ptr i32)) (inttoptr v240)) + (let (v243 i32) (load v242)) + (br (block 2 v245 v243 v130))) ) (func (export #<&T as core::fmt::Display>::fmt) @@ -3438,7 +3400,7 @@ (condbr v61 (block 6) (block 7))) (block 3 - (let (v44 i32) (const.i32 1048784)) + (let (v44 i32) (const.i32 1048788)) (let (v45 u32) (bitcast v11)) (let (v46 u32) (add.checked v45 24)) (let (v47 u32) (mod.unchecked v46 4)) @@ -3449,7 +3411,7 @@ (br (block 2 v11 v49 v5 v6))) (block 4 - (let (v38 i32) (const.i32 1048782)) + (let (v38 i32) (const.i32 1048786)) (let (v39 u32) (bitcast v11)) (let (v40 u32) (add.checked v39 24)) (let (v41 u32) (mod.unchecked v40 4)) @@ -3460,7 +3422,7 @@ (br (block 2 v11 v43 v5 v6))) (block 5 - (let (v32 i32) (const.i32 1048780)) + (let (v32 i32) (const.i32 1048784)) (let (v33 u32) (bitcast v11)) (let (v34 u32) (add.checked v33 24)) (let (v35 u32) (mod.unchecked v34 4)) @@ -3521,7 +3483,7 @@ (assertz 250 v167) (let (v168 (ptr i32)) (inttoptr v166)) (store v168 v164) - (let (v169 i32) (const.i32 1048892)) + (let (v169 i32) (const.i32 1048896)) (let (v170 u32) (bitcast v50)) (let (v171 u32) (add.checked v170 88)) (let (v172 u32) (mod.unchecked v171 4)) @@ -3535,7 +3497,7 @@ (assertz 250 v177) (let (v178 (ptr i64)) (inttoptr v176)) (store v178 v174) - (let (v179 i32) (const.i32 8)) + (let (v179 i32) (const.i32 7)) (let (v180 u32) (bitcast v179)) (let (v181 u64) (zext v180)) (let (v182 i64) (bitcast v181)) @@ -3566,7 +3528,7 @@ (assertz 250 v204) (let (v205 (ptr i64)) (inttoptr v203)) (store v205 v201) - (let (v206 i32) (const.i32 10)) + (let (v206 i32) (const.i32 9)) (let (v207 u32) (bitcast v206)) (let (v208 u64) (zext v207)) (let (v209 i64) (bitcast v208)) @@ -3585,7 +3547,7 @@ (assertz 250 v221) (let (v222 (ptr i64)) (inttoptr v220)) (store v222 v218) - (let (v223 i32) (const.i32 9)) + (let (v223 i32) (const.i32 8)) (let (v224 u32) (bitcast v223)) (let (v225 u64) (zext v224)) (let (v226 i64) (bitcast v225)) @@ -3625,7 +3587,7 @@ (assertz 250 v65) (let (v66 (ptr i32)) (inttoptr v64)) (store v66 v62) - (let (v67 i32) (const.i32 1048840)) + (let (v67 i32) (const.i32 1048844)) (let (v68 u32) (bitcast v50)) (let (v69 u32) (add.checked v68 88)) (let (v70 u32) (mod.unchecked v69 4)) @@ -3639,7 +3601,7 @@ (assertz 250 v75) (let (v76 (ptr i64)) (inttoptr v74)) (store v76 v72) - (let (v77 i32) (const.i32 8)) + (let (v77 i32) (const.i32 7)) (let (v78 u32) (bitcast v77)) (let (v79 u64) (zext v78)) (let (v80 i64) (bitcast v79)) @@ -3670,7 +3632,7 @@ (assertz 250 v102) (let (v103 (ptr i64)) (inttoptr v101)) (store v103 v99) - (let (v104 i32) (const.i32 9)) + (let (v104 i32) (const.i32 8)) (let (v105 u32) (bitcast v104)) (let (v106 u64) (zext v105)) (let (v107 i64) (bitcast v106)) @@ -3776,413 +3738,447 @@ (let (v20 i32) (load v19)) (let (v21 i32) (const.i32 0)) (let (v22 i32) (const.i32 0)) - (br (block 2 v21 v2 v1 v22 v20 v15 v11 v6))) + (let (v23 i32) (const.i32 0)) + (let (v24 i32) (const.i32 0)) + (br (block 3 v24 v23 v2 v1 v22 v20 v15 v11 v6 v21))) (block 1 (param v3 i32) (ret v3)) - (block 2 - (param v23 i32) - (param v24 i32) - (param v210 i32) - (param v221 i32) - (param v240 i32) - (param v259 i32) - (param v273 i32) - (param v304 i32) - (let (v25 u32) (bitcast v23)) - (let (v26 u32) (bitcast v24)) - (let (v27 i1) (gt v25 v26)) - (let (v28 i32) (sext v27)) - (let (v29 i1) (neq v28 0)) - (condbr v29 (block 5 v221 v24 v240 v259 v273 v304 v210 v23) (block 6))) + (block 2 (param v370 i32) + (br (block 1 v370))) (block 3 - (br (block 1 v345))) + (param v25 i32) + (param v29 i32) + (param v30 i32) + (param v214 i32) + (param v225 i32) + (param v243 i32) + (param v262 i32) + (param v276 i32) + (param v304 i32) + (param v371 i32) + (let (v26 i32) (const.i32 1)) + (let (v27 i32) (band v25 v26)) + (let (v28 i1) (neq v27 0)) + (condbr v28 (block 2 v371) (block 5))) (block 4 - (param v236 i32) - (param v255 i32) - (param v269 i32) + (let (v369 i32) (const.i32 1)) + (br (block 2 v369))) + + (block 5 + (let (v31 u32) (bitcast v29)) + (let (v32 u32) (bitcast v30)) + (let (v33 i1) (gt v31 v32)) + (let (v34 i32) (sext v33)) + (let (v35 i1) (neq v34 0)) + (condbr v35 (block 7 v225 v30 v243 v262 v276 v304 v214 v29 v371) (block 8))) + + (block 6 + (param v239 i32) + (param v258 i32) + (param v272 i32) (param v291 i32) (param v293 i32) (param v300 i32) (param v322 i32) (param v335 i32) - (param v348 i32) - (param v355 i32) - (param v359 i32) - (let (v248 u32) (bitcast v236)) - (let (v249 (ptr u8)) (inttoptr v248)) - (let (v250 u8) (load v249)) - (let (v251 i32) (zext v250)) - (let (v252 i1) (eq v251 0)) - (let (v253 i32) (zext v252)) - (let (v254 i1) (neq v253 0)) - (condbr v254 (block 43 v291 v293 v300 v322 v236 v335 v255 v269 v348 v355 v359) (block 44))) + (param v351 i32) + (param v363 i32) + (param v367 i32) + (param v374 i32) + (let (v251 u32) (bitcast v239)) + (let (v252 (ptr u8)) (inttoptr v251)) + (let (v253 u8) (load v252)) + (let (v254 i32) (zext v253)) + (let (v255 i1) (eq v254 0)) + (let (v256 i32) (zext v255)) + (let (v257 i1) (neq v256 0)) + (condbr v257 (block 46 v291 v293 v300 v322 v239 v335 v258 v272 v351 v363 v367 v374) (block 47))) - (block 5 - (param v220 i32) - (param v231 i32) - (param v247 i32) - (param v266 i32) - (param v280 i32) + (block 7 + (param v224 i32) + (param v235 i32) + (param v250 i32) + (param v269 i32) + (param v283 i32) (param v311 i32) (param v323 i32) - (param v356 i32) - (let (v219 i32) (const.i32 1)) - (let (v232 i1) (neq v220 v231)) - (let (v233 i32) (zext v232)) - (let (v234 i1) (neq v233 0)) - (condbr v234 (block 4 v247 v266 v280 v231 v220 v311 v323 v220 v219 v356 v231) (block 42))) - - (block 6 - (br (block 7 v210 v23 v24 v221 v240 v259 v273 v304))) - - (block 7 - (param v30 i32) - (param v31 i32) - (param v33 i32) - (param v222 i32) - (param v239 i32) - (param v258 i32) - (param v272 i32) - (param v303 i32) - (let (v32 i32) (add.wrapping v30 v31)) - (let (v34 i32) (sub.wrapping v33 v31)) - (let (v35 i32) (const.i32 8)) - (let (v36 u32) (bitcast v34)) - (let (v37 u32) (bitcast v35)) - (let (v38 i1) (lt v36 v37)) - (let (v39 i32) (sext v38)) - (let (v40 i1) (neq v39 0)) - (condbr v40 (block 11) (block 12))) + (param v364 i32) + (param v384 i32) + (let (v223 i32) (const.i32 1)) + (let (v236 i1) (eq v224 v235)) + (let (v237 i32) (zext v236)) + (let (v238 i1) (neq v237 0)) + (condbr v238 (block 2 v384) (block 44))) (block 8 - (br (block 5 v223 v204 v241 v260 v274 v305 v211 v203))) + (br (block 9 v214 v29 v30 v225 v243 v262 v276 v304 v25 v371))) (block 9 - (param v175 i32) - (param v176 i32) - (param v186 i32) - (param v192 i32) - (param v212 i32) - (param v224 i32) - (param v237 i32) - (param v256 i32) - (param v270 i32) - (param v301 i32) - (let (v183 i32) (add.wrapping v175 v176)) - (let (v184 i32) (const.i32 1)) - (let (v185 i32) (add.wrapping v183 v184)) - (let (v187 u32) (bitcast v183)) - (let (v188 u32) (bitcast v186)) - (let (v189 i1) (gte v187 v188)) - (let (v190 i32) (zext v189)) - (let (v191 i1) (neq v190 0)) - (condbr v191 (block 38 v185 v186 v212 v224 v237 v256 v270 v301) (block 39))) + (param v36 i32) + (param v37 i32) + (param v39 i32) + (param v226 i32) + (param v242 i32) + (param v261 i32) + (param v275 i32) + (param v303 i32) + (param v354 i32) + (param v377 i32) + (let (v38 i32) (add.wrapping v36 v37)) + (let (v40 i32) (sub.wrapping v39 v37)) + (let (v41 i32) (const.i32 7)) + (let (v42 u32) (bitcast v40)) + (let (v43 u32) (bitcast v41)) + (let (v44 i1) (gt v42 v43)) + (let (v45 i32) (sext v44)) + (let (v46 i1) (neq v45 0)) + (condbr v46 (block 14) (block 15))) (block 10 - (param v143 i32) - (param v146 i32) - (param v150 i32) - (param v171 i32) + (br (block 7 v227 v208 v244 v263 v277 v305 v215 v207 v378))) + + (block 11 (param v180 i32) + (param v181 i32) + (param v191 i32) + (param v197 i32) (param v216 i32) (param v228 i32) - (param v244 i32) - (param v263 i32) - (param v277 i32) - (param v308 i32) - (let (v147 i1) (neq v143 v146)) - (let (v148 i32) (zext v147)) - (let (v149 i1) (neq v148 0)) - (condbr v149 (block 31) (block 32))) - - (block 11 - (let (v121 i1) (neq v33 v31)) - (let (v122 i32) (zext v121)) - (let (v123 i1) (neq v122 0)) - (condbr v123 (block 25) (block 26))) + (param v240 i32) + (param v259 i32) + (param v273 i32) + (param v301 i32) + (param v352 i32) + (param v375 i32) + (let (v188 i32) (add.wrapping v180 v181)) + (let (v189 i32) (const.i32 1)) + (let (v190 i32) (add.wrapping v188 v189)) + (let (v192 u32) (bitcast v188)) + (let (v193 u32) (bitcast v191)) + (let (v194 i1) (gte v192 v193)) + (let (v195 i32) (zext v194)) + (let (v196 i1) (neq v195 0)) + (condbr v196 (block 40 v190 v191 v216 v228 v240 v259 v273 v301 v352 v375) (block 41))) (block 12 - (let (v41 i32) (const.i32 3)) - (let (v42 i32) (add.wrapping v32 v41)) - (let (v43 i32) (const.i32 -4)) - (let (v44 i32) (band v42 v43)) - (let (v45 i32) (sub.wrapping v44 v32)) - (let (v46 i1) (eq v45 0)) - (let (v47 i32) (zext v46)) - (let (v48 i1) (neq v47 0)) - (condbr v48 (block 14) (block 15))) + (param v148 i32) + (param v149 i32) + (param v155 i32) + (param v176 i32) + (param v185 i32) + (param v220 i32) + (param v232 i32) + (param v247 i32) + (param v266 i32) + (param v280 i32) + (param v308 i32) + (param v358 i32) + (param v381 i32) + (let (v152 i1) (neq v148 v149)) + (let (v153 i32) (zext v152)) + (let (v154 i1) (neq v153 0)) + (condbr v154 (block 33) (block 34))) (block 13 - (param v117 i32) - (param v119 i32) - (param v120 i32) - (param v145 i32) - (param v153 i32) - (param v173 i32) - (param v182 i32) - (param v218 i32) - (param v230 i32) - (param v246 i32) - (param v265 i32) - (param v279 i32) - (param v310 i32) - (br (block 21 v117 v119 v120 v145 v153 v173 v182 v218 v230 v246 v265 v279 v310))) + (let (v129 i32) (const.i32 0)) + (br (block 29 v38 v129 v40 v39 v37 v36 v226 v242 v261 v275 v303 v354 v377))) (block 14 - (let (v75 i32) (const.i32 -8)) - (let (v76 i32) (add.wrapping v34 v75)) - (br (block 13 v44 v45 v76 v34 v33 v32 v31 v30 v222 v239 v258 v272 v303))) + (let (v50 i32) (const.i32 3)) + (let (v51 i32) (add.wrapping v38 v50)) + (let (v52 i32) (const.i32 -4)) + (let (v53 i32) (band v51 v52)) + (let (v54 i32) (sub.wrapping v53 v38)) + (let (v55 i1) (eq v54 0)) + (let (v56 i32) (zext v55)) + (let (v57 i1) (neq v56 0)) + (condbr v57 (block 18) (block 19))) (block 15 - (let (v49 i32) (const.i32 0)) - (br (block 16 v32 v49 v45 v34 v44 v33 v31 v30 v222 v239 v258 v272 v303))) + (let (v47 i1) (neq v39 v37)) + (let (v48 i32) (zext v47)) + (let (v49 i1) (neq v48 0)) + (condbr v49 (block 13) (block 16))) (block 16 - (param v50 i32) - (param v51 i32) - (param v61 i32) - (param v67 i32) - (param v118 i32) - (param v151 i32) - (param v177 i32) - (param v213 i32) - (param v225 i32) - (param v238 i32) - (param v257 i32) - (param v271 i32) - (param v302 i32) - (let (v52 i32) (add.wrapping v50 v51)) - (let (v53 u32) (bitcast v52)) - (let (v54 (ptr u8)) (inttoptr v53)) - (let (v55 u8) (load v54)) - (let (v56 i32) (zext v55)) - (let (v57 i32) (const.i32 10)) - (let (v58 i1) (eq v56 v57)) - (let (v59 i32) (zext v58)) - (let (v60 i1) (neq v59 0)) - (condbr v60 (block 9 v51 v177 v151 v50 v213 v225 v238 v257 v271 v302) (block 18))) + (br (block 7 v226 v39 v242 v261 v275 v303 v36 v39 v377))) (block 17 - (let (v68 i32) (const.i32 -8)) - (let (v69 i32) (add.wrapping v67 v68)) - (let (v70 u32) (bitcast v61)) - (let (v71 u32) (bitcast v69)) - (let (v72 i1) (lte v70 v71)) - (let (v73 i32) (sext v72)) - (let (v74 i1) (neq v73 0)) - (condbr v74 (block 13 v118 v61 v69 v67 v151 v50 v177 v213 v225 v238 v257 v271 v302) (block 20))) + (param v125 i32) + (param v127 i32) + (param v128 i32) + (param v151 i32) + (param v158 i32) + (param v178 i32) + (param v187 i32) + (param v222 i32) + (param v234 i32) + (param v249 i32) + (param v268 i32) + (param v282 i32) + (param v310 i32) + (param v360 i32) + (param v383 i32) + (br (block 25 v125 v127 v128 v151 v158 v178 v187 v222 v234 v249 v268 v282 v310 v360 v383))) (block 18 - (let (v62 i32) (const.i32 1)) - (let (v63 i32) (add.wrapping v51 v62)) - (let (v64 i1) (neq v61 v63)) - (let (v65 i32) (zext v64)) - (let (v66 i1) (neq v65 0)) - (condbr v66 (block 16 v50 v63 v61 v67 v118 v151 v177 v213 v225 v238 v257 v271 v302) (block 19))) + (let (v84 i32) (const.i32 -8)) + (let (v85 i32) (add.wrapping v40 v84)) + (br (block 17 v53 v54 v85 v40 v39 v38 v37 v36 v226 v242 v261 v275 v303 v354 v377))) (block 19 - (br (block 17))) + (let (v58 i32) (const.i32 0)) + (br (block 20 v38 v58 v54 v40 v53 v39 v37 v36 v226 v242 v261 v275 v303 v354 v377))) (block 20 - (br (block 10 v67 v61 v151 v50 v177 v213 v225 v238 v257 v271 v302))) - - (block 21 - (param v77 i32) - (param v108 i32) - (param v111 i32) - (param v144 i32) - (param v152 i32) - (param v172 i32) - (param v181 i32) + (param v59 i32) + (param v60 i32) + (param v70 i32) + (param v76 i32) + (param v126 i32) + (param v156 i32) + (param v182 i32) (param v217 i32) - (param v229 i32) - (param v245 i32) - (param v264 i32) - (param v278 i32) - (param v309 i32) - (let (v78 i32) (const.i32 4)) - (let (v79 i32) (add.wrapping v77 v78)) - (let (v80 u32) (bitcast v79)) - (let (v81 u32) (mod.unchecked v80 4)) - (assertz 250 v81) - (let (v82 (ptr i32)) (inttoptr v80)) - (let (v83 i32) (load v82)) - (let (v84 i32) (const.i32 168430090)) - (let (v85 i32) (bxor v83 v84)) - (let (v86 i32) (const.i32 -16843009)) - (let (v87 i32) (add.wrapping v85 v86)) - (let (v88 i32) (const.i32 -1)) - (let (v89 i32) (bxor v83 v88)) - (let (v90 i32) (band v87 v89)) - (let (v91 u32) (bitcast v77)) - (let (v92 u32) (mod.unchecked v91 4)) - (assertz 250 v92) - (let (v93 (ptr i32)) (inttoptr v91)) - (let (v94 i32) (load v93)) - (let (v95 i32) (const.i32 168430090)) - (let (v96 i32) (bxor v94 v95)) - (let (v97 i32) (const.i32 -16843009)) - (let (v98 i32) (add.wrapping v96 v97)) - (let (v99 i32) (const.i32 -1)) - (let (v100 i32) (bxor v94 v99)) - (let (v101 i32) (band v98 v100)) - (let (v102 i32) (bor v90 v101)) - (let (v103 i32) (const.i32 -2139062144)) - (let (v104 i32) (band v102 v103)) - (let (v105 i1) (neq v104 0)) - (condbr v105 (block 10 v144 v108 v152 v172 v181 v217 v229 v245 v264 v278 v309) (block 23))) + (param v229 i32) + (param v241 i32) + (param v260 i32) + (param v274 i32) + (param v302 i32) + (param v353 i32) + (param v376 i32) + (let (v61 i32) (add.wrapping v59 v60)) + (let (v62 u32) (bitcast v61)) + (let (v63 (ptr u8)) (inttoptr v62)) + (let (v64 u8) (load v63)) + (let (v65 i32) (zext v64)) + (let (v66 i32) (const.i32 10)) + (let (v67 i1) (eq v65 v66)) + (let (v68 i32) (zext v67)) + (let (v69 i1) (neq v68 0)) + (condbr v69 (block 11 v60 v182 v156 v59 v217 v229 v241 v260 v274 v302 v353 v376) (block 22))) + + (block 21 + (let (v77 i32) (const.i32 -8)) + (let (v78 i32) (add.wrapping v76 v77)) + (let (v79 u32) (bitcast v70)) + (let (v80 u32) (bitcast v78)) + (let (v81 i1) (lte v79 v80)) + (let (v82 i32) (sext v81)) + (let (v83 i1) (neq v82 0)) + (condbr v83 (block 17 v126 v70 v78 v76 v156 v59 v182 v217 v229 v241 v260 v274 v302 v353 v376) (block 24))) - (block 22) + (block 22 + (let (v71 i32) (const.i32 1)) + (let (v72 i32) (add.wrapping v60 v71)) + (let (v73 i1) (neq v70 v72)) + (let (v74 i32) (zext v73)) + (let (v75 i1) (neq v74 0)) + (condbr v75 (block 20 v59 v72 v70 v76 v126 v156 v182 v217 v229 v241 v260 v274 v302 v353 v376) (block 23))) (block 23 - (let (v106 i32) (const.i32 8)) - (let (v107 i32) (add.wrapping v77 v106)) - (let (v109 i32) (const.i32 8)) - (let (v110 i32) (add.wrapping v108 v109)) - (let (v112 u32) (bitcast v110)) - (let (v113 u32) (bitcast v111)) - (let (v114 i1) (lte v112 v113)) - (let (v115 i32) (sext v114)) - (let (v116 i1) (neq v115 0)) - (condbr v116 (block 21 v107 v110 v111 v144 v152 v172 v181 v217 v229 v245 v264 v278 v309) (block 24))) + (br (block 21))) (block 24 - (br (block 10 v144 v110 v152 v172 v181 v217 v229 v245 v264 v278 v309))) + (br (block 12 v70 v76 v156 v59 v182 v217 v229 v241 v260 v274 v302 v353 v376))) (block 25 - (let (v124 i32) (const.i32 0)) - (br (block 27 v32 v124 v34 v33 v31 v30 v222 v239 v258 v272 v303))) - - (block 26 - (br (block 5 v222 v33 v239 v258 v272 v303 v30 v33))) + (param v87 i32) + (param v116 i32) + (param v119 i32) + (param v150 i32) + (param v157 i32) + (param v177 i32) + (param v186 i32) + (param v221 i32) + (param v233 i32) + (param v248 i32) + (param v267 i32) + (param v281 i32) + (param v309 i32) + (param v359 i32) + (param v382 i32) + (let (v86 i32) (const.i32 16843008)) + (let (v88 u32) (bitcast v87)) + (let (v89 u32) (mod.unchecked v88 4)) + (assertz 250 v89) + (let (v90 (ptr i32)) (inttoptr v88)) + (let (v91 i32) (load v90)) + (let (v92 i32) (const.i32 168430090)) + (let (v93 i32) (bxor v91 v92)) + (let (v94 i32) (sub.wrapping v86 v93)) + (let (v95 i32) (bor v94 v91)) + (let (v96 i32) (const.i32 16843008)) + (let (v97 i32) (const.i32 4)) + (let (v98 i32) (add.wrapping v87 v97)) + (let (v99 u32) (bitcast v98)) + (let (v100 u32) (mod.unchecked v99 4)) + (assertz 250 v100) + (let (v101 (ptr i32)) (inttoptr v99)) + (let (v102 i32) (load v101)) + (let (v103 i32) (const.i32 168430090)) + (let (v104 i32) (bxor v102 v103)) + (let (v105 i32) (sub.wrapping v96 v104)) + (let (v106 i32) (bor v105 v102)) + (let (v107 i32) (band v95 v106)) + (let (v108 i32) (const.i32 -2139062144)) + (let (v109 i32) (band v107 v108)) + (let (v110 i32) (const.i32 -2139062144)) + (let (v111 i1) (neq v109 v110)) + (let (v112 i32) (zext v111)) + (let (v113 i1) (neq v112 0)) + (condbr v113 (block 12 v116 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382) (block 27))) + + (block 26) (block 27 - (param v125 i32) - (param v126 i32) - (param v136 i32) - (param v142 i32) - (param v178 i32) - (param v214 i32) - (param v226 i32) - (param v242 i32) - (param v261 i32) - (param v275 i32) - (param v306 i32) - (let (v127 i32) (add.wrapping v125 v126)) - (let (v128 u32) (bitcast v127)) - (let (v129 (ptr u8)) (inttoptr v128)) - (let (v130 u8) (load v129)) - (let (v131 i32) (zext v130)) - (let (v132 i32) (const.i32 10)) - (let (v133 i1) (eq v131 v132)) - (let (v134 i32) (zext v133)) - (let (v135 i1) (neq v134 0)) - (condbr v135 (block 9 v126 v178 v142 v125 v214 v226 v242 v261 v275 v306) (block 29))) + (let (v114 i32) (const.i32 8)) + (let (v115 i32) (add.wrapping v87 v114)) + (let (v117 i32) (const.i32 8)) + (let (v118 i32) (add.wrapping v116 v117)) + (let (v120 u32) (bitcast v118)) + (let (v121 u32) (bitcast v119)) + (let (v122 i1) (lte v120 v121)) + (let (v123 i32) (sext v122)) + (let (v124 i1) (neq v123 0)) + (condbr v124 (block 25 v115 v118 v119 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382) (block 28))) (block 28 - (br (block 5 v226 v142 v242 v261 v275 v306 v214 v142))) + (br (block 12 v118 v150 v157 v177 v186 v221 v233 v248 v267 v281 v309 v359 v382))) (block 29 - (let (v137 i32) (const.i32 1)) - (let (v138 i32) (add.wrapping v126 v137)) - (let (v139 i1) (neq v136 v138)) - (let (v140 i32) (zext v139)) - (let (v141 i1) (neq v140 0)) - (condbr v141 (block 27 v125 v138 v136 v142 v178 v214 v226 v242 v261 v275 v306) (block 30))) + (param v130 i32) + (param v131 i32) + (param v141 i32) + (param v147 i32) + (param v183 i32) + (param v218 i32) + (param v230 i32) + (param v245 i32) + (param v264 i32) + (param v278 i32) + (param v306 i32) + (param v356 i32) + (param v379 i32) + (let (v132 i32) (add.wrapping v130 v131)) + (let (v133 u32) (bitcast v132)) + (let (v134 (ptr u8)) (inttoptr v133)) + (let (v135 u8) (load v134)) + (let (v136 i32) (zext v135)) + (let (v137 i32) (const.i32 10)) + (let (v138 i1) (eq v136 v137)) + (let (v139 i32) (zext v138)) + (let (v140 i1) (neq v139 0)) + (condbr v140 (block 11 v131 v183 v147 v130 v218 v230 v245 v264 v278 v306 v356 v379) (block 31))) (block 30 - (br (block 28))) + (br (block 7 v230 v147 v245 v264 v278 v306 v218 v147 v379))) (block 31 - (br (block 33 v171 v146 v143 v150 v180 v216 v228 v244 v263 v277 v308))) + (let (v142 i32) (const.i32 1)) + (let (v143 i32) (add.wrapping v131 v142)) + (let (v144 i1) (neq v141 v143)) + (let (v145 i32) (zext v144)) + (let (v146 i1) (neq v145 0)) + (condbr v146 (block 29 v130 v143 v141 v147 v183 v218 v230 v245 v264 v278 v306 v356 v379) (block 32))) (block 32 - (br (block 5 v228 v150 v244 v263 v277 v308 v216 v150))) + (br (block 30))) (block 33 - (param v154 i32) - (param v155 i32) - (param v165 i32) - (param v174 i32) - (param v179 i32) - (param v215 i32) - (param v227 i32) - (param v243 i32) - (param v262 i32) - (param v276 i32) - (param v307 i32) - (let (v156 i32) (add.wrapping v154 v155)) - (let (v157 u32) (bitcast v156)) - (let (v158 (ptr u8)) (inttoptr v157)) - (let (v159 u8) (load v158)) - (let (v160 i32) (zext v159)) - (let (v161 i32) (const.i32 10)) - (let (v162 i1) (neq v160 v161)) - (let (v163 i32) (zext v162)) - (let (v164 i1) (neq v163 0)) - (condbr v164 (block 35) (block 36))) + (br (block 35 v176 v148 v149 v155 v185 v220 v232 v247 v266 v280 v308 v358 v381))) (block 34 - (br (block 5 v227 v174 v243 v262 v276 v307 v215 v174))) + (br (block 7 v232 v155 v247 v266 v280 v308 v220 v155 v381))) (block 35 - (let (v166 i32) (const.i32 1)) - (let (v167 i32) (add.wrapping v155 v166)) - (let (v168 i1) (neq v165 v167)) - (let (v169 i32) (zext v168)) - (let (v170 i1) (neq v169 0)) - (condbr v170 (block 33 v154 v167 v165 v174 v179 v215 v227 v243 v262 v276 v307) (block 37))) + (param v159 i32) + (param v160 i32) + (param v170 i32) + (param v179 i32) + (param v184 i32) + (param v219 i32) + (param v231 i32) + (param v246 i32) + (param v265 i32) + (param v279 i32) + (param v307 i32) + (param v357 i32) + (param v380 i32) + (let (v161 i32) (add.wrapping v159 v160)) + (let (v162 u32) (bitcast v161)) + (let (v163 (ptr u8)) (inttoptr v162)) + (let (v164 u8) (load v163)) + (let (v165 i32) (zext v164)) + (let (v166 i32) (const.i32 10)) + (let (v167 i1) (neq v165 v166)) + (let (v168 i32) (zext v167)) + (let (v169 i1) (neq v168 0)) + (condbr v169 (block 37) (block 38))) (block 36 - (br (block 9 v155 v179 v174 v154 v215 v227 v243 v262 v276 v307))) + (br (block 7 v231 v179 v246 v265 v279 v307 v219 v179 v380))) (block 37 - (br (block 34))) + (let (v171 i32) (const.i32 1)) + (let (v172 i32) (add.wrapping v160 v171)) + (let (v173 i1) (neq v170 v172)) + (let (v174 i32) (zext v173)) + (let (v175 i1) (neq v174 0)) + (condbr v175 (block 35 v159 v172 v170 v179 v184 v219 v231 v246 v265 v279 v307 v357 v380) (block 39))) (block 38 - (param v203 i32) - (param v204 i32) - (param v211 i32) - (param v223 i32) - (param v241 i32) - (param v260 i32) - (param v274 i32) - (param v305 i32) - (let (v205 u32) (bitcast v203)) - (let (v206 u32) (bitcast v204)) - (let (v207 i1) (lte v205 v206)) - (let (v208 i32) (sext v207)) - (let (v209 i1) (neq v208 0)) - (condbr v209 (block 7 v211 v203 v204 v223 v241 v260 v274 v305) (block 41))) + (br (block 11 v160 v184 v179 v159 v219 v231 v246 v265 v279 v307 v357 v380))) (block 39 - (let (v193 i32) (add.wrapping v192 v175)) - (let (v194 u32) (bitcast v193)) - (let (v195 (ptr u8)) (inttoptr v194)) - (let (v196 u8) (load v195)) - (let (v197 i32) (zext v196)) - (let (v198 i32) (const.i32 10)) - (let (v199 i1) (neq v197 v198)) - (let (v200 i32) (zext v199)) - (let (v201 i1) (neq v200 0)) - (condbr v201 (block 38 v185 v186 v212 v224 v237 v256 v270 v301) (block 40))) + (br (block 36))) (block 40 - (let (v202 i32) (const.i32 0)) - (br (block 4 v237 v256 v270 v185 v224 v301 v212 v185 v202 v185 v186))) + (param v207 i32) + (param v208 i32) + (param v215 i32) + (param v227 i32) + (param v244 i32) + (param v263 i32) + (param v277 i32) + (param v305 i32) + (param v355 i32) + (param v378 i32) + (let (v209 u32) (bitcast v207)) + (let (v210 u32) (bitcast v208)) + (let (v211 i1) (lte v209 v210)) + (let (v212 i32) (sext v211)) + (let (v213 i1) (neq v212 0)) + (condbr v213 (block 9 v215 v207 v208 v227 v244 v263 v277 v305 v355 v378) (block 43))) (block 41 - (br (block 8))) + (let (v198 i32) (add.wrapping v197 v180)) + (let (v199 u32) (bitcast v198)) + (let (v200 (ptr u8)) (inttoptr v199)) + (let (v201 u8) (load v200)) + (let (v202 i32) (zext v201)) + (let (v203 i32) (const.i32 10)) + (let (v204 i1) (neq v202 v203)) + (let (v205 i32) (zext v204)) + (let (v206 i1) (neq v205 0)) + (condbr v206 (block 40 v190 v191 v216 v228 v240 v259 v273 v301 v352 v375) (block 42))) (block 42 - (let (v235 i32) (const.i32 0)) - (ret v235)) + (br (block 6 v240 v259 v273 v190 v228 v301 v216 v190 v352 v190 v191 v375))) (block 43 + (br (block 10))) + + (block 44 + (br (block 6 v250 v269 v283 v235 v224 v311 v323 v224 v223 v364 v235 v384))) + + (block 45 + (br (block 4))) + + (block 46 (param v290 i32) (param v292 i32) (param v299 i32) @@ -4191,35 +4187,33 @@ (param v334 i32) (param v337 i32) (param v340 i32) - (param v347 i32) - (param v354 i32) - (param v358 i32) + (param v350 i32) + (param v362 i32) + (param v366 i32) + (param v373 i32) (let (v294 i32) (sub.wrapping v290 v292)) (let (v295 i32) (const.i32 0)) (let (v296 i1) (eq v290 v292)) (let (v297 i32) (zext v296)) (let (v298 i1) (neq v297 0)) - (condbr v298 (block 46 v321 v292 v327 v295 v334 v337 v294 v340 v347 v354 v358 v299) (block 47))) + (condbr v298 (block 49 v321 v292 v327 v295 v334 v337 v294 v340 v350 v362 v366 v299 v373) (block 50))) - (block 44 - (let (v267 i32) (const.i32 1048952)) - (let (v268 i32) (const.i32 4)) - (let (v281 u32) (bitcast v269)) - (let (v282 u32) (add.checked v281 12)) - (let (v283 u32) (mod.unchecked v282 4)) - (assertz 250 v283) - (let (v284 (ptr i32)) (inttoptr v282)) - (let (v285 i32) (load v284)) - (let (v286 i1) (eq v285 0)) - (let (v287 i32) (zext v286)) - (let (v288 i1) (neq v287 0)) - (condbr v288 (block 43 v291 v293 v300 v322 v236 v335 v255 v269 v348 v355 v359) (block 45))) + (block 47 + (let (v270 i32) (const.i32 1048956)) + (let (v271 i32) (const.i32 4)) + (let (v284 u32) (bitcast v272)) + (let (v285 u32) (add.checked v284 12)) + (let (v286 u32) (mod.unchecked v285 4)) + (assertz 250 v286) + (let (v287 (ptr i32)) (inttoptr v285)) + (let (v288 i32) (load v287)) + (let (v289 i1) (neq v288 0)) + (condbr v289 (block 45) (block 48))) - (block 45 - (let (v289 i32) (const.i32 1)) - (ret v289)) + (block 48 + (br (block 46 v291 v293 v300 v322 v239 v335 v258 v272 v351 v363 v367 v374))) - (block 46 + (block 49 (param v320 i32) (param v324 i32) (param v326 i32) @@ -4228,10 +4222,11 @@ (param v336 i32) (param v338 i32) (param v339 i32) - (param v346 i32) - (param v353 i32) - (param v357 i32) - (param v360 i32) + (param v349 i32) + (param v361 i32) + (param v365 i32) + (param v368 i32) + (param v372 i32) (let (v325 i32) (add.wrapping v320 v324)) (let (v329 u32) (bitcast v328)) (let (v330 u8) (trunc v329)) @@ -4244,13 +4239,12 @@ (assertz 250 v343) (let (v344 (ptr i32)) (inttoptr v342)) (let (v345 i32) (load v344)) - (let (v349 i32) (bor v345 v346)) - (let (v350 i1) (eq v349 0)) - (let (v351 i32) (zext v350)) - (let (v352 i1) (neq v351 0)) - (condbr v352 (block 2 v353 v357 v320 v333 v326 v336 v339 v360) (block 48))) + (let (v346 i1) (eq v345 0)) + (let (v347 i32) (zext v346)) + (let (v348 i1) (neq v347 0)) + (condbr v348 (block 3 v349 v361 v365 v320 v333 v326 v336 v339 v368 v372) (block 51))) - (block 47 + (block 50 (let (v312 i32) (add.wrapping v299 v290)) (let (v313 u32) (bitcast v312)) (let (v314 (ptr u8)) (inttoptr v313)) @@ -4259,10 +4253,10 @@ (let (v317 i32) (const.i32 10)) (let (v318 i1) (eq v316 v317)) (let (v319 i32) (zext v318)) - (br (block 46 v321 v292 v327 v319 v334 v337 v294 v340 v347 v354 v358 v299))) + (br (block 49 v321 v292 v327 v319 v334 v337 v294 v340 v350 v362 v366 v299 v373))) - (block 48 - (br (block 3))) + (block 51 + (br (block 45))) ) (func (export #::write_char) @@ -4320,7 +4314,7 @@ (br (block 1 v51))) (block 3 - (let (v25 i32) (const.i32 1048952)) + (let (v25 i32) (const.i32 1048956)) (let (v26 i32) (const.i32 4)) (let (v27 u32) (bitcast v8)) (let (v28 u32) (add.checked v27 12)) @@ -4352,103 +4346,96 @@ (let (v10 (ptr u8)) (inttoptr v9)) (let (v11 u8) (load v10)) (let (v12 i32) (zext v11)) - (let (v13 i1) (neq v12 0)) - (condbr v13 (block 2) (block 3))) + (let (v13 i1) (eq v12 0)) + (let (v14 i32) (zext v13)) + (let (v15 i1) (neq v14 0)) + (condbr v15 (block 2 v7) (block 3))) (block 1 (param v1 i32) (ret v1)) - (block 2 - (let (v19 i32) (const.i32 1)) - (let (v20 i32) (const.i32 255)) - (let (v21 i32) (band v7 v20)) - (let (v22 i1) (neq v21 0)) - (condbr v22 (block 4 v0 v19) (block 5))) + (block 2 (param v73 i32) + (let (v74 i32) (const.i32 1)) + (let (v75 i32) (band v73 v74)) + (br (block 1 v75))) (block 3 - (let (v14 i32) (const.i32 255)) - (let (v15 i32) (band v7 v14)) - (let (v16 i32) (const.i32 0)) - (let (v17 i1) (neq v15 v16)) - (let (v18 i32) (zext v17)) - (ret v18)) + (let (v16 i32) (const.i32 1)) + (let (v17 i32) (const.i32 1)) + (let (v18 i32) (band v7 v17)) + (let (v19 i1) (neq v18 0)) + (condbr v19 (block 4 v0 v16) (block 5))) - (block 4 (param v74 i32) (param v75 i32) - (let (v76 u32) (bitcast v75)) - (let (v77 u8) (trunc v76)) - (let (v78 u32) (bitcast v74)) - (let (v79 u32) (add.checked v78 4)) - (let (v80 (ptr u8)) (inttoptr v79)) - (store v80 v77) - (br (block 1 v75))) + (block 4 (param v66 i32) (param v67 i32) + (let (v68 u32) (bitcast v67)) + (let (v69 u8) (trunc v68)) + (let (v70 u32) (bitcast v66)) + (let (v71 u32) (add.checked v70 4)) + (let (v72 (ptr u8)) (inttoptr v71)) + (store v72 v69) + (br (block 2 v67))) (block 5 - (let (v23 u32) (bitcast v0)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (let (v26 i32) (load v25)) - (let (v27 u32) (bitcast v26)) - (let (v28 u32) (add.checked v27 28)) - (let (v29 (ptr u8)) (inttoptr v28)) - (let (v30 u8) (load v29)) - (let (v31 i32) (zext v30)) - (let (v32 i32) (const.i32 4)) - (let (v33 i32) (band v31 v32)) - (let (v34 i1) (neq v33 0)) - (condbr v34 (block 6) (block 7))) + (let (v20 u32) (bitcast v0)) + (let (v21 u32) (mod.unchecked v20 4)) + (assertz 250 v21) + (let (v22 (ptr i32)) (inttoptr v20)) + (let (v23 i32) (load v22)) + (let (v24 u32) (bitcast v23)) + (let (v25 u32) (add.checked v24 28)) + (let (v26 (ptr u8)) (inttoptr v25)) + (let (v27 u8) (load v26)) + (let (v28 i32) (zext v27)) + (let (v29 i32) (const.i32 4)) + (let (v30 i32) (band v28 v29)) + (let (v31 i1) (neq v30 0)) + (condbr v31 (block 6) (block 7))) (block 6 - (let (v57 u32) (bitcast v26)) - (let (v58 u32) (add.checked v57 20)) - (let (v59 u32) (mod.unchecked v58 4)) - (assertz 250 v59) - (let (v60 (ptr i32)) (inttoptr v58)) - (let (v61 i32) (load v60)) - (let (v62 i32) (const.i32 1048966)) - (let (v63 i32) (const.i32 1)) - (let (v64 u32) (bitcast v26)) - (let (v65 u32) (add.checked v64 24)) - (let (v66 u32) (mod.unchecked v65 4)) - (assertz 250 v66) - (let (v67 (ptr i32)) (inttoptr v65)) - (let (v68 i32) (load v67)) - (let (v69 u32) (bitcast v68)) - (let (v70 u32) (add.checked v69 12)) - (let (v71 u32) (mod.unchecked v70 4)) - (assertz 250 v71) - (let (v72 (ptr i32)) (inttoptr v70)) - (let (v73 i32) (load v72)) - (br (block 4 v0 v73))) + (let (v49 u32) (bitcast v23)) + (let (v50 u32) (add.checked v49 20)) + (let (v51 u32) (mod.unchecked v50 4)) + (assertz 250 v51) + (let (v52 (ptr i32)) (inttoptr v50)) + (let (v53 i32) (load v52)) + (let (v54 i32) (const.i32 1048970)) + (let (v55 i32) (const.i32 1)) + (let (v56 u32) (bitcast v23)) + (let (v57 u32) (add.checked v56 24)) + (let (v58 u32) (mod.unchecked v57 4)) + (assertz 250 v58) + (let (v59 (ptr i32)) (inttoptr v57)) + (let (v60 i32) (load v59)) + (let (v61 u32) (bitcast v60)) + (let (v62 u32) (add.checked v61 12)) + (let (v63 u32) (mod.unchecked v62 4)) + (assertz 250 v63) + (let (v64 (ptr i32)) (inttoptr v62)) + (let (v65 i32) (load v64)) + (br (block 4 v0 v65))) (block 7 - (let (v35 u32) (bitcast v26)) - (let (v36 u32) (add.checked v35 20)) - (let (v37 u32) (mod.unchecked v36 4)) - (assertz 250 v37) - (let (v38 (ptr i32)) (inttoptr v36)) - (let (v39 i32) (load v38)) - (let (v40 i32) (const.i32 1048967)) - (let (v41 i32) (const.i32 2)) - (let (v42 u32) (bitcast v26)) - (let (v43 u32) (add.checked v42 24)) - (let (v44 u32) (mod.unchecked v43 4)) - (assertz 250 v44) - (let (v45 (ptr i32)) (inttoptr v43)) - (let (v46 i32) (load v45)) - (let (v47 u32) (bitcast v46)) - (let (v48 u32) (add.checked v47 12)) - (let (v49 u32) (mod.unchecked v48 4)) - (assertz 250 v49) - (let (v50 (ptr i32)) (inttoptr v48)) - (let (v51 i32) (load v50)) - (let (v52 u32) (bitcast v51)) - (let (v53 u8) (trunc v52)) - (let (v54 u32) (bitcast v41)) - (let (v55 u32) (add.checked v54 4)) - (let (v56 (ptr u8)) (inttoptr v55)) - (store v56 v53) - (ret v51)) + (let (v32 u32) (bitcast v23)) + (let (v33 u32) (add.checked v32 20)) + (let (v34 u32) (mod.unchecked v33 4)) + (assertz 250 v34) + (let (v35 (ptr i32)) (inttoptr v33)) + (let (v36 i32) (load v35)) + (let (v37 i32) (const.i32 1048971)) + (let (v38 i32) (const.i32 2)) + (let (v39 u32) (bitcast v23)) + (let (v40 u32) (add.checked v39 24)) + (let (v41 u32) (mod.unchecked v40 4)) + (assertz 250 v41) + (let (v42 (ptr i32)) (inttoptr v40)) + (let (v43 i32) (load v42)) + (let (v44 u32) (bitcast v43)) + (let (v45 u32) (add.checked v44 12)) + (let (v46 u32) (mod.unchecked v45 4)) + (assertz 250 v46) + (let (v47 (ptr i32)) (inttoptr v45)) + (let (v48 i32) (load v47)) + (br (block 4 v0 v48))) ) (func (export #core::fmt::Formatter::pad_integral) @@ -4473,9 +4460,9 @@ (param v41 i32) (param v134 i32) (param v140 i32) - (param v162 i32) - (param v178 i32) - (param v184 i32) + (param v161 i32) + (param v180 i32) + (param v186 i32) (let (v30 i32) (const.i32 4)) (let (v31 i32) (band v29 v30)) (let (v32 i1) (neq v31 0)) @@ -4511,20 +4498,20 @@ (block 5 (param v139 i32) - (param v161 i32) - (param v167 i32) - (param v170 i32) - (param v177 i32) - (param v183 i32) - (param v199 i32) - (param v223 i32) + (param v160 i32) + (param v166 i32) + (param v169 i32) + (param v179 i32) + (param v185 i32) + (param v201 i32) + (param v222 i32) (let (v145 u32) (bitcast v139)) (let (v146 u32) (mod.unchecked v145 4)) (assertz 250 v146) (let (v147 (ptr i32)) (inttoptr v145)) (let (v148 i32) (load v147)) (let (v149 i1) (neq v148 0)) - (condbr v149 (block 24) (block 25))) + (condbr v149 (block 23) (block 24))) (block 6 (let (v35 i32) (const.i32 16)) @@ -4537,20 +4524,20 @@ (block 7 (let (v33 i32) (const.i32 0)) - (br (block 5 v140 v162 v33 v34 v178 v184 v134 v29))) + (br (block 5 v140 v161 v33 v34 v180 v186 v134 v29))) (block 8 (param v132 i32) (param v133 i32) (param v141 i32) - (param v163 i32) - (param v168 i32) - (param v171 i32) - (param v179 i32) - (param v185 i32) - (param v224 i32) + (param v162 i32) + (param v167 i32) + (param v170 i32) + (param v181 i32) + (param v187 i32) + (param v223 i32) (let (v138 i32) (add.wrapping v132 v133)) - (br (block 5 v141 v163 v168 v171 v179 v185 v138 v224))) + (br (block 5 v141 v162 v167 v170 v181 v187 v138 v223))) (block 9 (let (v43 i1) (neq v34 0)) @@ -4558,7 +4545,7 @@ (block 10 (let (v42 i32) (call #core::str::count::do_count_chars v41 v34)) - (br (block 8 v42 v134 v140 v162 v41 v34 v178 v184 v29))) + (br (block 8 v42 v134 v140 v161 v41 v34 v180 v186 v29))) (block 11 (let (v45 i32) (const.i32 3)) @@ -4573,7 +4560,7 @@ (block 12 (let (v44 i32) (const.i32 0)) - (br (block 8 v44 v134 v140 v162 v41 v34 v178 v184 v29))) + (br (block 8 v44 v134 v140 v161 v41 v34 v180 v186 v29))) (block 13 (param v107 i32) @@ -4582,27 +4569,27 @@ (param v131 i32) (param v135 i32) (param v142 i32) - (param v164 i32) - (param v172 i32) - (param v180 i32) - (param v186 i32) - (param v225 i32) + (param v163 i32) + (param v171 i32) + (param v182 i32) + (param v188 i32) + (param v224 i32) (let (v109 i1) (eq v107 0)) (let (v110 i32) (zext v109)) (let (v111 i1) (neq v110 0)) - (condbr v111 (block 8 v131 v135 v142 v164 v112 v172 v180 v186 v225) (block 19))) + (condbr v111 (block 8 v131 v135 v142 v163 v112 v171 v182 v188 v224) (block 19))) (block 14 (let (v55 i32) (const.i32 12)) (let (v56 i32) (band v34 v55)) (let (v57 i32) (const.i32 0)) (let (v58 i32) (const.i32 0)) - (br (block 16 v57 v41 v58 v56 v46 v134 v140 v162 v34 v178 v184 v29))) + (br (block 16 v57 v41 v58 v56 v46 v134 v140 v161 v34 v180 v186 v29))) (block 15 (let (v53 i32) (const.i32 0)) (let (v54 i32) (const.i32 0)) - (br (block 13 v46 v41 v54 v53 v134 v140 v162 v34 v178 v184 v29))) + (br (block 13 v46 v41 v54 v53 v134 v140 v161 v34 v180 v186 v29))) (block 16 (param v59 i32) @@ -4612,11 +4599,11 @@ (param v108 i32) (param v136 i32) (param v143 i32) - (param v165 i32) - (param v173 i32) - (param v181 i32) - (param v187 i32) - (param v226 i32) + (param v164 i32) + (param v172 i32) + (param v183 i32) + (param v189 i32) + (param v225 i32) (let (v62 i32) (add.wrapping v60 v61)) (let (v63 u32) (bitcast v62)) (let (v64 (ptr i8)) (inttoptr v63)) @@ -4661,17 +4648,17 @@ (let (v104 i1) (neq v101 v103)) (let (v105 i32) (zext v104)) (let (v106 i1) (neq v105 0)) - (condbr v106 (block 16 v100 v60 v103 v101 v108 v136 v143 v165 v173 v181 v187 v226) (block 18))) + (condbr v106 (block 16 v100 v60 v103 v101 v108 v136 v143 v164 v172 v183 v189 v225) (block 18))) (block 17 - (br (block 13 v108 v60 v103 v100 v136 v143 v165 v173 v181 v187 v226))) + (br (block 13 v108 v60 v103 v100 v136 v143 v164 v172 v183 v189 v225))) (block 18 (br (block 17))) (block 19 (let (v114 i32) (add.wrapping v112 v113)) - (br (block 20 v131 v114 v107 v135 v142 v164 v112 v172 v180 v186 v225))) + (br (block 20 v131 v114 v107 v135 v142 v163 v112 v171 v182 v188 v224))) (block 20 (param v115 i32) @@ -4679,12 +4666,12 @@ (param v127 i32) (param v137 i32) (param v144 i32) - (param v166 i32) - (param v169 i32) - (param v174 i32) - (param v182 i32) - (param v188 i32) - (param v227 i32) + (param v165 i32) + (param v168 i32) + (param v173 i32) + (param v184 i32) + (param v190 i32) + (param v226 i32) (let (v117 u32) (bitcast v116)) (let (v118 (ptr i8)) (inttoptr v117)) (let (v119 i8) (load v118)) @@ -4698,376 +4685,391 @@ (let (v128 i32) (const.i32 -1)) (let (v129 i32) (add.wrapping v127 v128)) (let (v130 i1) (neq v129 0)) - (condbr v130 (block 20 v124 v126 v129 v137 v144 v166 v169 v174 v182 v188 v227) (block 22))) + (condbr v130 (block 20 v124 v126 v129 v137 v144 v165 v168 v173 v184 v190 v226) (block 22))) (block 21 - (br (block 8 v124 v137 v144 v166 v169 v174 v182 v188 v227))) + (br (block 8 v124 v137 v144 v165 v168 v173 v184 v190 v226))) (block 22 (br (block 21))) - (block 23 (param v417 i32) - (br (block 1 v417))) + (block 23 + (let (v196 u32) (bitcast v139)) + (let (v197 u32) (add.checked v196 4)) + (let (v198 u32) (mod.unchecked v197 4)) + (assertz 250 v198) + (let (v199 (ptr i32)) (inttoptr v197)) + (let (v200 i32) (load v199)) + (let (v202 u32) (bitcast v200)) + (let (v203 u32) (bitcast v201)) + (let (v204 i1) (gt v202 v203)) + (let (v205 i32) (sext v204)) + (let (v206 i1) (neq v205 0)) + (condbr v206 (block 30) (block 31))) (block 24 - (let (v194 u32) (bitcast v139)) - (let (v195 u32) (add.checked v194 4)) - (let (v196 u32) (mod.unchecked v195 4)) - (assertz 250 v196) - (let (v197 (ptr i32)) (inttoptr v195)) - (let (v198 i32) (load v197)) - (let (v200 u32) (bitcast v198)) - (let (v201 u32) (bitcast v199)) - (let (v202 i1) (gt v200 v201)) - (let (v203 i32) (sext v202)) - (let (v204 i1) (neq v203 0)) - (condbr v204 (block 27) (block 28))) + (let (v150 u32) (bitcast v139)) + (let (v151 u32) (add.checked v150 20)) + (let (v152 u32) (mod.unchecked v151 4)) + (assertz 250 v152) + (let (v153 (ptr i32)) (inttoptr v151)) + (let (v154 i32) (load v153)) + (let (v155 u32) (bitcast v139)) + (let (v156 u32) (add.checked v155 24)) + (let (v157 u32) (mod.unchecked v156 4)) + (assertz 250 v157) + (let (v158 (ptr i32)) (inttoptr v156)) + (let (v159 i32) (load v158)) + (let (v174 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v154 v159 v160 v166 v169)) + (let (v175 i1) (eq v174 0)) + (let (v176 i32) (zext v175)) + (let (v177 i1) (neq v176 0)) + (condbr v177 (block 25) (block 26))) (block 25 - (let (v150 i32) (const.i32 1)) - (let (v151 u32) (bitcast v139)) - (let (v152 u32) (add.checked v151 20)) - (let (v153 u32) (mod.unchecked v152 4)) - (assertz 250 v153) - (let (v154 (ptr i32)) (inttoptr v152)) - (let (v155 i32) (load v154)) - (let (v156 u32) (bitcast v139)) - (let (v157 u32) (add.checked v156 24)) - (let (v158 u32) (mod.unchecked v157 4)) - (assertz 250 v158) - (let (v159 (ptr i32)) (inttoptr v157)) - (let (v160 i32) (load v159)) - (let (v175 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v155 v160 v161 v167 v170)) - (let (v176 i1) (neq v175 0)) - (condbr v176 (block 23 v150) (block 26))) + (let (v191 u32) (bitcast v159)) + (let (v192 u32) (add.checked v191 12)) + (let (v193 u32) (mod.unchecked v192 4)) + (assertz 250 v193) + (let (v194 (ptr i32)) (inttoptr v192)) + (let (v195 i32) (load v194)) + (ret v195)) (block 26 - (let (v189 u32) (bitcast v160)) - (let (v190 u32) (add.checked v189 12)) - (let (v191 u32) (mod.unchecked v190 4)) - (assertz 250 v191) - (let (v192 (ptr i32)) (inttoptr v190)) - (let (v193 i32) (load v192)) - (ret v193)) + (let (v178 i32) (const.i32 1)) + (ret v178)) - (block 27 - (let (v228 i32) (const.i32 8)) - (let (v229 i32) (band v223 v228)) - (let (v230 i1) (eq v229 0)) - (let (v231 i32) (zext v230)) - (let (v232 i1) (neq v231 0)) - (condbr v232 (block 30) (block 31))) + (block 27 (param v423 i32) + (br (block 1 v423))) (block 28 - (let (v205 i32) (const.i32 1)) - (let (v206 u32) (bitcast v139)) - (let (v207 u32) (add.checked v206 20)) - (let (v208 u32) (mod.unchecked v207 4)) - (assertz 250 v208) - (let (v209 (ptr i32)) (inttoptr v207)) - (let (v210 i32) (load v209)) - (let (v211 u32) (bitcast v139)) - (let (v212 u32) (add.checked v211 24)) - (let (v213 u32) (mod.unchecked v212 4)) - (assertz 250 v213) - (let (v214 (ptr i32)) (inttoptr v212)) - (let (v215 i32) (load v214)) - (let (v216 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v210 v215 v161 v167 v170)) - (let (v217 i1) (neq v216 0)) - (condbr v217 (block 23 v205) (block 29))) + (let (v316 i32) (sub.wrapping v200 v201)) + (let (v317 u32) (bitcast v139)) + (let (v318 u32) (add.checked v317 32)) + (let (v319 (ptr u8)) (inttoptr v318)) + (let (v320 u8) (load v319)) + (let (v321 i32) (zext v320)) + (let (v322 u32) (cast v321)) + (switchv322 + (0 . (block 44)) + (1 . (block 44)) + (2 . (block 43)) + (3 . (block 42 v321 v139 v160 v166 v169 v179 v185 v316)) + (_ . (block 42 v321 v139 v160 v166 v169 v179 v185 v316)))) (block 29 - (let (v218 u32) (bitcast v215)) - (let (v219 u32) (add.checked v218 12)) - (let (v220 u32) (mod.unchecked v219 4)) - (assertz 250 v220) - (let (v221 (ptr i32)) (inttoptr v219)) - (let (v222 i32) (load v221)) - (ret v222)) + (let (v311 u32) (bitcast v216)) + (let (v312 u32) (add.checked v311 12)) + (let (v313 u32) (mod.unchecked v312 4)) + (assertz 250 v313) + (let (v314 (ptr i32)) (inttoptr v312)) + (let (v315 i32) (load v314)) + (br (block 27 v315))) (block 30 - (let (v310 i32) (sub.wrapping v198 v199)) - (let (v311 u32) (bitcast v139)) - (let (v312 u32) (add.checked v311 32)) - (let (v313 (ptr u8)) (inttoptr v312)) - (let (v314 u8) (load v313)) - (let (v315 i32) (zext v314)) - (let (v316 u32) (cast v315)) - (switchv316 - (0 . (block 41)) - (1 . (block 41)) - (2 . (block 40)) - (3 . (block 39 v315 v139 v161 v167 v170 v177 v183 v310)) - (_ . (block 39 v315 v139 v161 v167 v170 v177 v183 v310)))) + (let (v227 i32) (const.i32 8)) + (let (v228 i32) (band v222 v227)) + (let (v229 i1) (eq v228 0)) + (let (v230 i32) (zext v229)) + (let (v231 i1) (neq v230 0)) + (condbr v231 (block 28) (block 33))) (block 31 - (let (v233 u32) (bitcast v139)) - (let (v234 u32) (add.checked v233 16)) - (let (v235 u32) (mod.unchecked v234 4)) - (assertz 250 v235) - (let (v236 (ptr i32)) (inttoptr v234)) - (let (v237 i32) (load v236)) - (let (v238 i32) (const.i32 48)) - (let (v239 u32) (bitcast v139)) - (let (v240 u32) (add.checked v239 16)) - (let (v241 u32) (mod.unchecked v240 4)) - (assertz 250 v241) - (let (v242 (ptr i32)) (inttoptr v240)) - (store v242 v238) - (let (v243 u32) (bitcast v139)) - (let (v244 u32) (add.checked v243 32)) - (let (v245 (ptr u8)) (inttoptr v244)) - (let (v246 u8) (load v245)) - (let (v247 i32) (zext v246)) - (let (v248 i32) (const.i32 1)) - (let (v249 i32) (const.i32 1)) - (let (v250 u32) (bitcast v249)) - (let (v251 u8) (trunc v250)) - (let (v252 u32) (bitcast v139)) - (let (v253 u32) (add.checked v252 32)) - (let (v254 (ptr u8)) (inttoptr v253)) - (store v254 v251) - (let (v255 u32) (bitcast v139)) - (let (v256 u32) (add.checked v255 20)) - (let (v257 u32) (mod.unchecked v256 4)) - (assertz 250 v257) - (let (v258 (ptr i32)) (inttoptr v256)) - (let (v259 i32) (load v258)) - (let (v260 u32) (bitcast v139)) - (let (v261 u32) (add.checked v260 24)) - (let (v262 u32) (mod.unchecked v261 4)) - (assertz 250 v262) - (let (v263 (ptr i32)) (inttoptr v261)) - (let (v264 i32) (load v263)) - (let (v265 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v259 v264 v161 v167 v170)) - (let (v266 i1) (neq v265 0)) - (condbr v266 (block 23 v248) (block 32))) + (let (v207 u32) (bitcast v139)) + (let (v208 u32) (add.checked v207 20)) + (let (v209 u32) (mod.unchecked v208 4)) + (assertz 250 v209) + (let (v210 (ptr i32)) (inttoptr v208)) + (let (v211 i32) (load v210)) + (let (v212 u32) (bitcast v139)) + (let (v213 u32) (add.checked v212 24)) + (let (v214 u32) (mod.unchecked v213 4)) + (assertz 250 v214) + (let (v215 (ptr i32)) (inttoptr v213)) + (let (v216 i32) (load v215)) + (let (v217 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v211 v216 v160 v166 v169)) + (let (v218 i1) (eq v217 0)) + (let (v219 i32) (zext v218)) + (let (v220 i1) (neq v219 0)) + (condbr v220 (block 29) (block 32))) (block 32 - (let (v267 i32) (sub.wrapping v198 v199)) - (let (v268 i32) (const.i32 1)) - (let (v269 i32) (add.wrapping v267 v268)) - (br (block 34 v269 v259 v264 v177 v183 v139 v247 v237))) + (let (v221 i32) (const.i32 1)) + (ret v221)) (block 33 - (let (v288 i32) (const.i32 1)) - (let (v291 u32) (bitcast v278)) - (let (v292 u32) (add.checked v291 12)) - (let (v293 u32) (mod.unchecked v292 4)) - (assertz 250 v293) - (let (v294 (ptr i32)) (inttoptr v292)) - (let (v295 i32) (load v294)) - (let (v296 i1) (neq v295 0)) - (condbr v296 (block 23 v288) (block 38))) + (let (v232 u32) (bitcast v139)) + (let (v233 u32) (add.checked v232 16)) + (let (v234 u32) (mod.unchecked v233 4)) + (assertz 250 v234) + (let (v235 (ptr i32)) (inttoptr v233)) + (let (v236 i32) (load v235)) + (let (v237 i32) (const.i32 48)) + (let (v238 u32) (bitcast v139)) + (let (v239 u32) (add.checked v238 16)) + (let (v240 u32) (mod.unchecked v239 4)) + (assertz 250 v240) + (let (v241 (ptr i32)) (inttoptr v239)) + (store v241 v237) + (let (v242 u32) (bitcast v139)) + (let (v243 u32) (add.checked v242 32)) + (let (v244 (ptr u8)) (inttoptr v243)) + (let (v245 u8) (load v244)) + (let (v246 i32) (zext v245)) + (let (v247 i32) (const.i32 1)) + (let (v248 i32) (const.i32 1)) + (let (v249 u32) (bitcast v248)) + (let (v250 u8) (trunc v249)) + (let (v251 u32) (bitcast v139)) + (let (v252 u32) (add.checked v251 32)) + (let (v253 (ptr u8)) (inttoptr v252)) + (store v253 v250) + (let (v254 u32) (bitcast v139)) + (let (v255 u32) (add.checked v254 20)) + (let (v256 u32) (mod.unchecked v255 4)) + (assertz 250 v256) + (let (v257 (ptr i32)) (inttoptr v255)) + (let (v258 i32) (load v257)) + (let (v259 u32) (bitcast v139)) + (let (v260 u32) (add.checked v259 24)) + (let (v261 u32) (mod.unchecked v260 4)) + (assertz 250 v261) + (let (v262 (ptr i32)) (inttoptr v260)) + (let (v263 i32) (load v262)) + (let (v264 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v258 v263 v160 v166 v169)) + (let (v265 i1) (neq v264 0)) + (condbr v265 (block 27 v247) (block 34))) (block 34 - (param v270 i32) - (param v276 i32) - (param v278 i32) - (param v289 i32) - (param v290 i32) - (param v297 i32) - (param v298 i32) - (param v304 i32) - (let (v271 i32) (const.i32 -1)) - (let (v272 i32) (add.wrapping v270 v271)) - (let (v273 i1) (eq v272 0)) - (let (v274 i32) (zext v273)) - (let (v275 i1) (neq v274 0)) - (condbr v275 (block 33) (block 36))) + (let (v266 i32) (sub.wrapping v200 v201)) + (let (v267 i32) (const.i32 1)) + (let (v268 i32) (add.wrapping v266 v267)) + (br (block 36 v268 v258 v263 v179 v185 v139 v246 v236))) (block 35 - (let (v287 i32) (const.i32 1)) - (ret v287)) + (let (v289 u32) (bitcast v277)) + (let (v290 u32) (add.checked v289 12)) + (let (v291 u32) (mod.unchecked v290 4)) + (assertz 250 v291) + (let (v292 (ptr i32)) (inttoptr v290)) + (let (v293 i32) (load v292)) + (let (v294 i1) (eq v293 0)) + (let (v295 i32) (zext v294)) + (let (v296 i1) (neq v295 0)) + (condbr v296 (block 40) (block 41))) (block 36 - (let (v277 i32) (const.i32 48)) - (let (v279 u32) (bitcast v278)) - (let (v280 u32) (add.checked v279 16)) - (let (v281 u32) (mod.unchecked v280 4)) - (assertz 250 v281) - (let (v282 (ptr i32)) (inttoptr v280)) - (let (v283 i32) (load v282)) - (let (v284 i1) (eq v283 0)) - (let (v285 i32) (zext v284)) - (let (v286 i1) (neq v285 0)) - (condbr v286 (block 34 v272 v276 v278 v289 v290 v297 v298 v304) (block 37))) + (param v269 i32) + (param v275 i32) + (param v277 i32) + (param v287 i32) + (param v288 i32) + (param v298 i32) + (param v299 i32) + (param v305 i32) + (let (v270 i32) (const.i32 -1)) + (let (v271 i32) (add.wrapping v269 v270)) + (let (v272 i1) (eq v271 0)) + (let (v273 i32) (zext v272)) + (let (v274 i1) (neq v273 0)) + (condbr v274 (block 35) (block 38))) (block 37 - (br (block 35))) + (let (v286 i32) (const.i32 1)) + (ret v286)) (block 38 - (let (v299 u32) (bitcast v298)) - (let (v300 u8) (trunc v299)) - (let (v301 u32) (bitcast v297)) - (let (v302 u32) (add.checked v301 32)) - (let (v303 (ptr u8)) (inttoptr v302)) - (store v303 v300) - (let (v305 u32) (bitcast v297)) - (let (v306 u32) (add.checked v305 16)) - (let (v307 u32) (mod.unchecked v306 4)) - (assertz 250 v307) - (let (v308 (ptr i32)) (inttoptr v306)) - (store v308 v304) - (let (v309 i32) (const.i32 0)) - (br (block 23 v309))) + (let (v276 i32) (const.i32 48)) + (let (v278 u32) (bitcast v277)) + (let (v279 u32) (add.checked v278 16)) + (let (v280 u32) (mod.unchecked v279 4)) + (assertz 250 v280) + (let (v281 (ptr i32)) (inttoptr v279)) + (let (v282 i32) (load v281)) + (let (v283 i1) (eq v282 0)) + (let (v284 i32) (zext v283)) + (let (v285 i1) (neq v284 0)) + (condbr v285 (block 36 v271 v275 v277 v287 v288 v298 v299 v305) (block 39))) (block 39 - (param v330 i32) - (param v333 i32) - (param v369 i32) - (param v371 i32) - (param v373 i32) - (param v377 i32) - (param v379 i32) - (param v410 i32) - (let (v331 i32) (const.i32 1)) - (let (v332 i32) (add.wrapping v330 v331)) - (let (v334 u32) (bitcast v333)) - (let (v335 u32) (add.checked v334 16)) - (let (v336 u32) (mod.unchecked v335 4)) - (assertz 250 v336) - (let (v337 (ptr i32)) (inttoptr v335)) - (let (v338 i32) (load v337)) - (let (v339 u32) (bitcast v333)) - (let (v340 u32) (add.checked v339 24)) - (let (v341 u32) (mod.unchecked v340 4)) - (assertz 250 v341) - (let (v342 (ptr i32)) (inttoptr v340)) - (let (v343 i32) (load v342)) - (let (v344 u32) (bitcast v333)) - (let (v345 u32) (add.checked v344 20)) - (let (v346 u32) (mod.unchecked v345 4)) - (assertz 250 v346) - (let (v347 (ptr i32)) (inttoptr v345)) - (let (v348 i32) (load v347)) - (br (block 43 v332 v348 v338 v343 v369 v371 v373 v377 v379 v410))) + (br (block 37))) (block 40 - (let (v318 i32) (const.i32 1)) - (let (v319 u32) (bitcast v310)) - (let (v320 u32) (bitcast v318)) - (let (v321 u32) (shr.wrapping v319 v320)) - (let (v322 i32) (bitcast v321)) - (let (v323 i32) (const.i32 1)) - (let (v324 i32) (add.wrapping v310 v323)) - (let (v325 i32) (const.i32 1)) - (let (v326 u32) (bitcast v324)) - (let (v327 u32) (bitcast v325)) - (let (v328 u32) (shr.wrapping v326 v327)) - (let (v329 i32) (bitcast v328)) - (br (block 39 v322 v139 v161 v167 v170 v177 v183 v329))) + (let (v300 u32) (bitcast v299)) + (let (v301 u8) (trunc v300)) + (let (v302 u32) (bitcast v298)) + (let (v303 u32) (add.checked v302 32)) + (let (v304 (ptr u8)) (inttoptr v303)) + (store v304 v301) + (let (v306 u32) (bitcast v298)) + (let (v307 u32) (add.checked v306 16)) + (let (v308 u32) (mod.unchecked v307 4)) + (assertz 250 v308) + (let (v309 (ptr i32)) (inttoptr v307)) + (store v309 v305) + (let (v310 i32) (const.i32 0)) + (ret v310)) (block 41 - (let (v317 i32) (const.i32 0)) - (br (block 39 v310 v139 v161 v167 v170 v177 v183 v317))) + (let (v297 i32) (const.i32 1)) + (ret v297)) (block 42 - (let (v367 i32) (const.i32 1)) - (let (v374 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v355 v357 v368 v370 v372)) - (let (v375 i1) (neq v374 0)) - (condbr v375 (block 23 v367) (block 47))) + (param v336 i32) + (param v339 i32) + (param v375 i32) + (param v377 i32) + (param v379 i32) + (param v383 i32) + (param v385 i32) + (param v416 i32) + (let (v337 i32) (const.i32 1)) + (let (v338 i32) (add.wrapping v336 v337)) + (let (v340 u32) (bitcast v339)) + (let (v341 u32) (add.checked v340 16)) + (let (v342 u32) (mod.unchecked v341 4)) + (assertz 250 v342) + (let (v343 (ptr i32)) (inttoptr v341)) + (let (v344 i32) (load v343)) + (let (v345 u32) (bitcast v339)) + (let (v346 u32) (add.checked v345 24)) + (let (v347 u32) (mod.unchecked v346 4)) + (assertz 250 v347) + (let (v348 (ptr i32)) (inttoptr v346)) + (let (v349 i32) (load v348)) + (let (v350 u32) (bitcast v339)) + (let (v351 u32) (add.checked v350 20)) + (let (v352 u32) (mod.unchecked v351 4)) + (assertz 250 v352) + (let (v353 (ptr i32)) (inttoptr v351)) + (let (v354 i32) (load v353)) + (br (block 46 v338 v354 v344 v349 v375 v377 v379 v383 v385 v416))) (block 43 - (param v349 i32) - (param v355 i32) - (param v356 i32) - (param v357 i32) - (param v368 i32) - (param v370 i32) - (param v372 i32) - (param v376 i32) - (param v378 i32) - (param v409 i32) - (let (v350 i32) (const.i32 -1)) - (let (v351 i32) (add.wrapping v349 v350)) - (let (v352 i1) (eq v351 0)) - (let (v353 i32) (zext v352)) - (let (v354 i1) (neq v353 0)) - (condbr v354 (block 42) (block 45))) + (let (v324 i32) (const.i32 1)) + (let (v325 u32) (bitcast v316)) + (let (v326 u32) (bitcast v324)) + (let (v327 u32) (shr.wrapping v325 v326)) + (let (v328 i32) (bitcast v327)) + (let (v329 i32) (const.i32 1)) + (let (v330 i32) (add.wrapping v316 v329)) + (let (v331 i32) (const.i32 1)) + (let (v332 u32) (bitcast v330)) + (let (v333 u32) (bitcast v331)) + (let (v334 u32) (shr.wrapping v332 v333)) + (let (v335 i32) (bitcast v334)) + (br (block 42 v328 v139 v160 v166 v169 v179 v185 v335))) (block 44 - (let (v366 i32) (const.i32 1)) - (ret v366)) + (let (v323 i32) (const.i32 0)) + (br (block 42 v316 v139 v160 v166 v169 v179 v185 v323))) (block 45 - (let (v358 u32) (bitcast v357)) - (let (v359 u32) (add.checked v358 16)) - (let (v360 u32) (mod.unchecked v359 4)) - (assertz 250 v360) - (let (v361 (ptr i32)) (inttoptr v359)) - (let (v362 i32) (load v361)) - (let (v363 i1) (eq v362 0)) - (let (v364 i32) (zext v363)) - (let (v365 i1) (neq v364 0)) - (condbr v365 (block 43 v351 v355 v356 v357 v368 v370 v372 v376 v378 v409) (block 46))) + (let (v373 i32) (const.i32 1)) + (let (v380 i32) (call #core::fmt::Formatter::pad_integral::write_prefix v361 v363 v374 v376 v378)) + (let (v381 i1) (neq v380 0)) + (condbr v381 (block 27 v373) (block 50))) (block 46 - (br (block 44))) + (param v355 i32) + (param v361 i32) + (param v362 i32) + (param v363 i32) + (param v374 i32) + (param v376 i32) + (param v378 i32) + (param v382 i32) + (param v384 i32) + (param v415 i32) + (let (v356 i32) (const.i32 -1)) + (let (v357 i32) (add.wrapping v355 v356)) + (let (v358 i1) (eq v357 0)) + (let (v359 i32) (zext v358)) + (let (v360 i1) (neq v359 0)) + (condbr v360 (block 45) (block 48))) (block 47 - (let (v380 u32) (bitcast v357)) - (let (v381 u32) (add.checked v380 12)) - (let (v382 u32) (mod.unchecked v381 4)) - (assertz 250 v382) - (let (v383 (ptr i32)) (inttoptr v381)) - (let (v384 i32) (load v383)) - (let (v385 i1) (neq v384 0)) - (condbr v385 (block 23 v367) (block 48))) + (let (v372 i32) (const.i32 1)) + (ret v372)) (block 48 - (let (v386 i32) (const.i32 0)) - (br (block 49 v409 v386 v355 v356 v357))) + (let (v364 u32) (bitcast v363)) + (let (v365 u32) (add.checked v364 16)) + (let (v366 u32) (mod.unchecked v365 4)) + (assertz 250 v366) + (let (v367 (ptr i32)) (inttoptr v365)) + (let (v368 i32) (load v367)) + (let (v369 i1) (eq v368 0)) + (let (v370 i32) (zext v369)) + (let (v371 i1) (neq v370 0)) + (condbr v371 (block 46 v357 v361 v362 v363 v374 v376 v378 v382 v384 v415) (block 49))) (block 49 - (param v387 i32) - (param v388 i32) - (param v398 i32) - (param v399 i32) - (param v400 i32) - (let (v389 i1) (neq v387 v388)) - (let (v390 i32) (zext v389)) - (let (v391 i1) (neq v390 0)) - (condbr v391 (block 51) (block 52))) + (br (block 47))) (block 50 - (let (v411 i32) (const.i32 -1)) - (let (v412 i32) (add.wrapping v397 v411)) - (let (v413 u32) (bitcast v412)) - (let (v414 u32) (bitcast v387)) - (let (v415 i1) (lt v413 v414)) - (let (v416 i32) (sext v415)) - (ret v416)) + (let (v386 u32) (bitcast v363)) + (let (v387 u32) (add.checked v386 12)) + (let (v388 u32) (mod.unchecked v387 4)) + (assertz 250 v388) + (let (v389 (ptr i32)) (inttoptr v387)) + (let (v390 i32) (load v389)) + (let (v391 i1) (neq v390 0)) + (condbr v391 (block 27 v373) (block 51))) (block 51 - (let (v396 i32) (const.i32 1)) - (let (v397 i32) (add.wrapping v388 v396)) - (let (v401 u32) (bitcast v400)) - (let (v402 u32) (add.checked v401 16)) - (let (v403 u32) (mod.unchecked v402 4)) - (assertz 250 v403) - (let (v404 (ptr i32)) (inttoptr v402)) - (let (v405 i32) (load v404)) - (let (v406 i1) (eq v405 0)) - (let (v407 i32) (zext v406)) - (let (v408 i1) (neq v407 0)) - (condbr v408 (block 49 v387 v397 v398 v399 v400) (block 53))) + (let (v392 i32) (const.i32 0)) + (br (block 52 v415 v392 v361 v362 v363))) (block 52 - (let (v392 u32) (bitcast v387)) - (let (v393 u32) (bitcast v387)) - (let (v394 i1) (lt v392 v393)) - (let (v395 i32) (sext v394)) - (ret v395)) + (param v393 i32) + (param v394 i32) + (param v404 i32) + (param v405 i32) + (param v406 i32) + (let (v395 i1) (neq v393 v394)) + (let (v396 i32) (zext v395)) + (let (v397 i1) (neq v396 0)) + (condbr v397 (block 54) (block 55))) (block 53 - (br (block 50))) + (let (v417 i32) (const.i32 -1)) + (let (v418 i32) (add.wrapping v403 v417)) + (let (v419 u32) (bitcast v418)) + (let (v420 u32) (bitcast v393)) + (let (v421 i1) (lt v419 v420)) + (let (v422 i32) (sext v421)) + (ret v422)) + + (block 54 + (let (v402 i32) (const.i32 1)) + (let (v403 i32) (add.wrapping v394 v402)) + (let (v407 u32) (bitcast v406)) + (let (v408 u32) (add.checked v407 16)) + (let (v409 u32) (mod.unchecked v408 4)) + (assertz 250 v409) + (let (v410 (ptr i32)) (inttoptr v408)) + (let (v411 i32) (load v410)) + (let (v412 i1) (eq v411 0)) + (let (v413 i32) (zext v412)) + (let (v414 i1) (neq v413 0)) + (condbr v414 (block 52 v393 v403 v404 v405 v406) (block 56))) + + (block 55 + (let (v398 u32) (bitcast v393)) + (let (v399 u32) (bitcast v393)) + (let (v400 i1) (lt v398 v399)) + (let (v401 i32) (sext v400)) + (ret v401)) + + (block 56 + (br (block 53))) ) (func (export #core::fmt::Write::write_fmt) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) - (let (v3 i32) (const.i32 1048928)) + (let (v3 i32) (const.i32 1048932)) (let (v4 i32) (call #core::fmt::write v0 v3 v1)) (br (block 1 v4))) @@ -5738,17 +5740,40 @@ (param v2 i32) (param v3 i32) (param v4 i32) - (let (v6 i32) (const.i32 0)) - (let (v7 i32) (const.i32 1114112)) - (let (v8 i1) (eq v2 v7)) - (let (v9 i32) (zext v8)) - (let (v10 i1) (neq v9 0)) - (condbr v10 (block 4 v3 v0 v4 v1) (block 5))) + (let (v6 i32) (const.i32 1114112)) + (let (v7 i1) (eq v2 v6)) + (let (v8 i32) (zext v7)) + (let (v9 i1) (neq v8 0)) + (condbr v9 (block 2 v3 v0 v4 v1) (block 3))) (block 1 (param v5 i32) (ret v5)) (block 2 + (param v19 i32) + (param v22 i32) + (param v23 i32) + (param v24 i32) + (let (v20 i1) (neq v19 0)) + (condbr v20 (block 5) (block 6))) + + (block 3 + (let (v10 u32) (bitcast v1)) + (let (v11 u32) (add.checked v10 16)) + (let (v12 u32) (mod.unchecked v11 4)) + (assertz 250 v12) + (let (v13 (ptr i32)) (inttoptr v11)) + (let (v14 i32) (load v13)) + (let (v15 i1) (eq v14 0)) + (let (v16 i32) (zext v15)) + (let (v17 i1) (neq v16 0)) + (condbr v17 (block 2 v3 v0 v4 v1) (block 4))) + + (block 4 + (let (v18 i32) (const.i32 1)) + (ret v18)) + + (block 5 (let (v25 u32) (bitcast v24)) (let (v26 u32) (add.checked v25 12)) (let (v27 u32) (mod.unchecked v26 4)) @@ -5757,34 +5782,9 @@ (let (v29 i32) (load v28)) (br (block 1 v29))) - (block 3 (param v21 i32) - (ret v21)) - - (block 4 - (param v18 i32) - (param v22 i32) - (param v23 i32) - (param v24 i32) - (let (v19 i1) (neq v18 0)) - (condbr v19 (block 2) (block 7))) - - (block 5 - (let (v11 i32) (const.i32 1)) - (let (v12 u32) (bitcast v1)) - (let (v13 u32) (add.checked v12 16)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (let (v16 i32) (load v15)) - (let (v17 i1) (neq v16 0)) - (condbr v17 (block 3 v11) (block 6))) - (block 6 - (br (block 4 v3 v0 v4 v1))) - - (block 7 - (let (v20 i32) (const.i32 0)) - (br (block 3 v20))) + (let (v21 i32) (const.i32 0)) + (ret v21)) ) (func (export #core::fmt::Formatter::debug_struct) @@ -5832,93 +5832,6 @@ (ret)) ) - (func (export #core::slice::index::slice_start_index_len_fail_rt) - (param i32) (param i32) (param i32) - (block 0 (param v0 i32) (param v1 i32) (param v2 i32) - (let (v3 i32) (const.i32 0)) - (let (v4 i64) (const.i64 0)) - (let (v5 i32) (global.load i32 (global.symbol #__stack_pointer))) - (let (v6 i32) (const.i32 48)) - (let (v7 i32) (sub.wrapping v5 v6)) - (let (v8 (ptr i32)) (global.symbol #__stack_pointer)) - (store v8 v7) - (let (v9 u32) (bitcast v7)) - (let (v10 u32) (add.checked v9 4)) - (let (v11 u32) (mod.unchecked v10 4)) - (assertz 250 v11) - (let (v12 (ptr i32)) (inttoptr v10)) - (store v12 v1) - (let (v13 u32) (bitcast v7)) - (let (v14 u32) (mod.unchecked v13 4)) - (assertz 250 v14) - (let (v15 (ptr i32)) (inttoptr v13)) - (store v15 v0) - (let (v16 i32) (const.i32 2)) - (let (v17 u32) (bitcast v7)) - (let (v18 u32) (add.checked v17 12)) - (let (v19 u32) (mod.unchecked v18 4)) - (assertz 250 v19) - (let (v20 (ptr i32)) (inttoptr v18)) - (store v20 v16) - (let (v21 i32) (const.i32 1049268)) - (let (v22 u32) (bitcast v7)) - (let (v23 u32) (add.checked v22 8)) - (let (v24 u32) (mod.unchecked v23 4)) - (assertz 250 v24) - (let (v25 (ptr i32)) (inttoptr v23)) - (store v25 v21) - (let (v26 i64) (const.i64 2)) - (let (v27 u32) (bitcast v7)) - (let (v28 u32) (add.checked v27 20)) - (let (v29 u32) (mod.unchecked v28 4)) - (assertz 250 v29) - (let (v30 (ptr i64)) (inttoptr v28)) - (store v30 v26) - (let (v31 i32) (const.i32 7)) - (let (v32 u32) (bitcast v31)) - (let (v33 u64) (zext v32)) - (let (v34 i64) (bitcast v33)) - (let (v35 i64) (const.i64 32)) - (let (v36 u32) (cast v35)) - (let (v37 i64) (shl.wrapping v34 v36)) - (let (v38 i32) (const.i32 4)) - (let (v39 i32) (add.wrapping v7 v38)) - (let (v40 u32) (bitcast v39)) - (let (v41 u64) (zext v40)) - (let (v42 i64) (bitcast v41)) - (let (v43 i64) (bor v37 v42)) - (let (v44 u32) (bitcast v7)) - (let (v45 u32) (add.checked v44 40)) - (let (v46 u32) (mod.unchecked v45 8)) - (assertz 250 v46) - (let (v47 (ptr i64)) (inttoptr v45)) - (store v47 v43) - (let (v48 u32) (bitcast v7)) - (let (v49 u64) (zext v48)) - (let (v50 i64) (bitcast v49)) - (let (v51 i64) (bor v37 v50)) - (let (v52 u32) (bitcast v7)) - (let (v53 u32) (add.checked v52 32)) - (let (v54 u32) (mod.unchecked v53 8)) - (assertz 250 v54) - (let (v55 (ptr i64)) (inttoptr v53)) - (store v55 v51) - (let (v56 i32) (const.i32 32)) - (let (v57 i32) (add.wrapping v7 v56)) - (let (v58 u32) (bitcast v7)) - (let (v59 u32) (add.checked v58 16)) - (let (v60 u32) (mod.unchecked v59 4)) - (assertz 250 v60) - (let (v61 (ptr i32)) (inttoptr v59)) - (store v61 v57) - (let (v62 i32) (const.i32 8)) - (let (v63 i32) (add.wrapping v7 v62)) - (call #core::panicking::panic_fmt v63 v2) - (unreachable)) - - (block 1) - ) - (func (export #core::fmt::num::imp::::fmt) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) @@ -5964,14 +5877,13 @@ (param v95 i32) (param v165 i32) (param v169 i32) - (let (v85 i32) (trunc v84)) - (let (v86 i32) (const.i32 99)) - (let (v87 u32) (bitcast v85)) - (let (v88 u32) (bitcast v86)) - (let (v89 i1) (lte v87 v88)) - (let (v90 i32) (sext v89)) - (let (v91 i1) (neq v90 0)) - (condbr v91 (block 8 v85 v92 v95 v165 v169) (block 9))) + (let (v85 i64) (const.i64 99)) + (let (v86 u64) (bitcast v84)) + (let (v87 u64) (bitcast v85)) + (let (v88 i1) (gt v86 v87)) + (let (v89 i32) (sext v88)) + (let (v90 i1) (neq v89 0)) + (condbr v90 (block 9) (block 10))) (block 3 (let (v18 i32) (const.i32 39)) @@ -6010,7 +5922,7 @@ (let (v43 i32) (const.i32 1)) (let (v44 u32) (bitcast v43)) (let (v45 i32) (shl.wrapping v42 v44)) - (let (v46 i32) (const.i32 1049014)) + (let (v46 i32) (const.i32 1049010)) (let (v47 i32) (add.wrapping v45 v46)) (let (v48 u32) (bitcast v47)) (let (v49 (ptr u16)) (inttoptr v48)) @@ -6031,7 +5943,7 @@ (let (v63 i32) (const.i32 1)) (let (v64 u32) (bitcast v63)) (let (v65 i32) (shl.wrapping v62 v64)) - (let (v66 i32) (const.i32 1049014)) + (let (v66 i32) (const.i32 1049010)) (let (v67 i32) (add.wrapping v65 v66)) (let (v68 u32) (bitcast v67)) (let (v69 (ptr u16)) (inttoptr v68)) @@ -6070,7 +5982,7 @@ (let (v129 i1) (lt v127 v128)) (let (v130 i32) (sext v129)) (let (v131 i1) (neq v130 0)) - (condbr v131 (block 11) (block 12))) + (condbr v131 (block 12) (block 13))) (block 9 (let (v93 i32) (const.i32 9)) @@ -6094,7 +6006,7 @@ (let (v112 i32) (const.i32 1)) (let (v113 u32) (bitcast v112)) (let (v114 i32) (shl.wrapping v111 v113)) - (let (v115 i32) (const.i32 1049014)) + (let (v115 i32) (const.i32 1049010)) (let (v116 i32) (add.wrapping v114 v115)) (let (v117 u32) (bitcast v116)) (let (v118 (ptr u16)) (inttoptr v117)) @@ -6108,6 +6020,10 @@ (br (block 8 v106 v92 v97 v165 v169))) (block 10 + (let (v91 i32) (trunc v84)) + (br (block 8 v91 v92 v95 v165 v169))) + + (block 11 (param v163 i32) (param v167 i32) (param v173 i32) @@ -6126,7 +6042,7 @@ (store v183 v182) (br (block 1 v180))) - (block 11 + (block 12 (let (v152 i32) (const.i32 9)) (let (v153 i32) (add.wrapping v132 v152)) (let (v154 i32) (const.i32 -1)) @@ -6139,9 +6055,9 @@ (let (v161 u32) (bitcast v156)) (let (v162 (ptr u8)) (inttoptr v161)) (store v162 v160) - (br (block 10 v164 v168 v132 v155))) + (br (block 11 v164 v168 v132 v155))) - (block 12 + (block 13 (let (v133 i32) (const.i32 9)) (let (v134 i32) (add.wrapping v132 v133)) (let (v136 i32) (const.i32 -2)) @@ -6150,7 +6066,7 @@ (let (v139 i32) (const.i32 1)) (let (v140 u32) (bitcast v139)) (let (v141 i32) (shl.wrapping v125 v140)) - (let (v142 i32) (const.i32 1049014)) + (let (v142 i32) (const.i32 1049010)) (let (v143 i32) (add.wrapping v141 v142)) (let (v144 u32) (bitcast v143)) (let (v145 (ptr u16)) (inttoptr v144)) @@ -6161,7 +6077,7 @@ (let (v150 u32) (bitcast v138)) (let (v151 (ptr u16)) (inttoptr v150)) (store v151 v149) - (br (block 10 v164 v168 v132 v137))) + (br (block 11 v164 v168 v132 v137))) ) (func (export #core::fmt::num::::fmt) @@ -6246,7 +6162,7 @@ (block 5 (let (v65 i32) (const.i32 1)) - (let (v66 i32) (const.i32 1049012)) + (let (v66 i32) (const.i32 1049008)) (let (v67 i32) (const.i32 2)) (let (v68 i32) (add.wrapping v15 v40)) (let (v69 i32) (const.i32 128)) @@ -6262,7 +6178,7 @@ (block 6 (let (v62 i32) (const.i32 128)) - (let (v63 i32) (const.i32 1048996)) + (let (v63 i32) (const.i32 1048992)) (call #core::slice::index::slice_start_index_len_fail v55 v62 v63) (unreachable)) ) @@ -6349,7 +6265,7 @@ (block 5 (let (v65 i32) (const.i32 1)) - (let (v66 i32) (const.i32 1049012)) + (let (v66 i32) (const.i32 1049008)) (let (v67 i32) (const.i32 2)) (let (v68 i32) (add.wrapping v15 v40)) (let (v69 i32) (const.i32 128)) @@ -6365,7 +6281,7 @@ (block 6 (let (v62 i32) (const.i32 128)) - (let (v63 i32) (const.i32 1048996)) + (let (v63 i32) (const.i32 1048992)) (call #core::slice::index::slice_start_index_len_fail v55 v62 v63) (unreachable)) ) @@ -6373,7 +6289,7 @@ (func (export #cabi_realloc) (param i32) (param i32) (param i32) (param i32) (result i32) (block 0 (param v0 i32) (param v1 i32) (param v2 i32) (param v3 i32) - (let (v5 i32) (call #cabi_realloc_wit_bindgen_0_28_0 v0 v1 v2 v3)) + (let (v5 i32) (call #wit_bindgen_rt::cabi_realloc v0 v1 v2 v3)) (br (block 1 v5))) (block 1 (param v4 i32) 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 37807d4c4..2a2c61e42 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 @@ -88,13 +88,13 @@ i32.const 8 i32.add local.get 1 - i32.const 1048620 + i32.const 1048621 i32.const 9 call $core::fmt::Formatter::debug_struct local.get 2 i32.const 8 i32.add - i32.const 1048596 + i32.const 1048616 i32.const 5 local.get 0 i32.const 1048632 @@ -135,9 +135,7 @@ local.get 1 call $core::fmt::num::::fmt ) - (func $core::ptr::drop_in_place (;8;) (type 2) (param i32)) - (func $core::ptr::drop_in_place<&basic_wallet_p2id_note::bindings::miden::base::core_types::AccountId> (;9;) (type 2) (param i32)) - (func $core::panicking::assert_failed (;10;) (type 7) (param i32 i32 i32) + (func $core::panicking::assert_failed (;8;) (type 7) (param i32 i32 i32) (local i32) global.get $__stack_pointer i32.const 16 @@ -160,16 +158,16 @@ i32.add i32.const 1048576 local.get 2 - i32.const 1048676 + i32.const 1048696 call $core::panicking::assert_failed_inner unreachable ) - (func $rust_begin_unwind (;11;) (type 2) (param i32) + (func $rust_begin_unwind (;9;) (type 2) (param i32) loop ;; label = @1 br 0 (;@1;) end ) - (func $::fmt (;12;) (type 1) (param i32 i32) (result i32) + (func $::fmt (;10;) (type 1) (param i32 i32) (result i32) (local i32) global.get $__stack_pointer i32.const 16 @@ -180,16 +178,16 @@ i32.const 8 i32.add local.get 1 - i32.const 1048592 + i32.const 1048596 i32.const 4 call $core::fmt::Formatter::debug_struct local.get 2 i32.const 8 i32.add - i32.const 1048596 + i32.const 1048616 i32.const 5 local.get 0 - i32.const 1048604 + i32.const 1048600 call $core::fmt::builders::DebugStruct::field call $core::fmt::builders::DebugStruct::finish local.set 1 @@ -199,16 +197,17 @@ global.set $__stack_pointer local.get 1 ) - (func $__rust_alloc (;13;) (type 1) (param i32 i32) (result i32) - i32.const 1049284 + (func $basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports (;11;) (type 6)) + (func $__rust_alloc (;12;) (type 1) (param i32 i32) (result i32) + i32.const 1049280 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;14;) (type 8) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;13;) (type 8) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1049284 + i32.const 1049280 local.get 2 local.get 3 call $::alloc @@ -224,7 +223,7 @@ i32.lt_u select memory.copy - i32.const 1049284 + i32.const 1049280 local.get 0 local.get 2 local.get 1 @@ -232,7 +231,7 @@ end local.get 4 ) - (func $miden:base/note-script@1.0.0#note-script (;15;) (type 6) + (func $miden:base/note-script@1.0.0#note-script (;14;) (type 6) (local i32 i32 i32 i64 i64 i32 i32 i32 i32) global.get $__stack_pointer i32.const 48 @@ -311,7 +310,7 @@ i32.ne br_if 0 (;@4;) end - i32.const 1049284 + i32.const 1049280 local.get 6 i32.const 8 local.get 5 @@ -319,7 +318,7 @@ i32.shl call $::dealloc end - i32.const 1049284 + i32.const 1049280 local.get 2 i32.const 8 local.get 1 @@ -334,7 +333,7 @@ end i32.const 0 i32.const 0 - i32.const 1048660 + i32.const 1048680 call $core::panicking::panic_bounds_check unreachable end @@ -353,54 +352,49 @@ call $core::panicking::assert_failed unreachable ) - (func $cabi_realloc_wit_bindgen_0_28_0 (;16;) (type 8) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;15;) (type 8) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 - block ;; label = @4 - local.get 1 - br_if 0 (;@4;) - local.get 3 - i32.eqz - br_if 2 (;@2;) - i32.const 0 - i32.load8_u offset=1049288 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@3;) - end - local.get 0 local.get 1 - local.get 2 + br_if 0 (;@3;) + local.get 3 + i32.eqz + br_if 2 (;@1;) + i32.const 0 + i32.load8_u offset=1049284 + drop local.get 3 - call $__rust_realloc + local.get 2 + call $__rust_alloc local.set 2 + br 1 (;@2;) end + local.get 0 + local.get 1 local.get 2 - i32.eqz - br_if 1 (;@1;) + local.get 3 + call $__rust_realloc + local.set 2 end local.get 2 - return + br_if 0 (;@1;) + unreachable end - unreachable - unreachable + local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;17;) (type 6) + (func $wit_bindgen_rt::run_ctors_once (;16;) (type 6) block ;; label = @1 i32.const 0 - i32.load8_u offset=1049289 + i32.load8_u offset=1049285 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1049289 + i32.store8 offset=1049285 end ) - (func $wee_alloc::alloc_first_fit (;18;) (type 0) (param i32 i32 i32) (result i32) + (func $wee_alloc::alloc_first_fit (;17;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 2 @@ -705,7 +699,7 @@ end i32.const 0 ) - (func $::alloc (;19;) (type 0) (param i32 i32 i32) (result i32) + (func $::alloc (;18;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32) global.get $__stack_pointer i32.const 16 @@ -809,7 +803,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;20;) (type 9) (param i32 i32 i32 i32) + (func $::dealloc (;19;) (type 9) (param i32 i32 i32 i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 local.get 1 @@ -839,39 +833,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -952,18 +929,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -982,9 +969,7 @@ i32.store end ) - (func $core::ptr::drop_in_place (;21;) (type 2) (param i32)) - (func $core::ptr::drop_in_place (;22;) (type 2) (param i32)) - (func $core::panicking::panic_fmt (;23;) (type 10) (param i32 i32) + (func $core::panicking::panic_fmt (;20;) (type 10) (param i32 i32) (local i32) global.get $__stack_pointer i32.const 32 @@ -992,6 +977,22 @@ local.tee 2 global.set $__stack_pointer local.get 2 + i32.const 16 + i32.add + local.get 0 + i32.const 16 + i32.add + i64.load align=4 + i64.store + local.get 2 + i32.const 8 + i32.add + local.get 0 + i32.const 8 + i32.add + i64.load align=4 + i64.store + local.get 2 i32.const 1 i32.store16 offset=28 local.get 2 @@ -999,27 +1000,65 @@ i32.store offset=24 local.get 2 local.get 0 - i32.store offset=20 - local.get 2 - i32.const 1048696 - i32.store offset=16 - local.get 2 - i32.const 1 - i32.store offset=12 + i64.load align=4 + i64.store local.get 2 - i32.const 12 - i32.add call $rust_begin_unwind unreachable ) - (func $core::slice::index::slice_start_index_len_fail (;24;) (type 7) (param i32 i32 i32) + (func $core::slice::index::slice_start_index_len_fail (;21;) (type 7) (param i32 i32 i32) + (local i32 i64) + global.get $__stack_pointer + i32.const 48 + i32.sub + local.tee 3 + global.set $__stack_pointer + local.get 3 local.get 0 + i32.store + local.get 3 local.get 1 + i32.store offset=4 + local.get 3 + i32.const 2 + i32.store offset=12 + local.get 3 + i32.const 1049264 + i32.store offset=8 + local.get 3 + i64.const 2 + i64.store offset=20 align=4 + local.get 3 + i32.const 6 + i64.extend_i32_u + i64.const 32 + i64.shl + local.tee 4 + local.get 3 + i32.const 4 + i32.add + i64.extend_i32_u + i64.or + i64.store offset=40 + local.get 3 + local.get 4 + local.get 3 + i64.extend_i32_u + i64.or + i64.store offset=32 + local.get 3 + local.get 3 + i32.const 32 + i32.add + i32.store offset=16 + local.get 3 + i32.const 8 + i32.add local.get 2 - call $core::slice::index::slice_start_index_len_fail_rt + call $core::panicking::panic_fmt unreachable ) - (func $core::panicking::panic_bounds_check (;25;) (type 7) (param i32 i32 i32) + (func $core::panicking::panic_bounds_check (;22;) (type 7) (param i32 i32 i32) (local i32 i64) global.get $__stack_pointer i32.const 48 @@ -1036,13 +1075,13 @@ i32.const 2 i32.store offset=12 local.get 3 - i32.const 1048764 + i32.const 1048768 i32.store offset=8 local.get 3 i64.const 2 i64.store offset=20 align=4 local.get 3 - i32.const 7 + i32.const 6 i64.extend_i32_u i64.const 32 i64.shl @@ -1071,20 +1110,27 @@ call $core::panicking::panic_fmt unreachable ) - (func $core::fmt::Formatter::pad (;26;) (type 0) (param i32 i32 i32) (result i32) + (func $core::fmt::Formatter::pad (;23;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32) + local.get 0 + i32.load offset=8 + local.set 3 block ;; label = @1 - local.get 0 - i32.load - local.tee 3 - local.get 0 - i32.load offset=8 - local.tee 4 - i32.or - i32.eqz - br_if 0 (;@1;) block ;; label = @2 - local.get 4 + local.get 0 + i32.load + local.tee 4 + br_if 0 (;@2;) + local.get 3 + i32.const 1 + i32.and + i32.eqz + br_if 1 (;@1;) + end + block ;; label = @2 + local.get 3 + i32.const 1 + i32.and i32.eqz br_if 0 (;@2;) local.get 1 @@ -1109,19 +1155,19 @@ local.set 8 loop ;; label = @4 local.get 8 - local.tee 4 + local.tee 3 local.get 5 i32.eq br_if 2 (;@2;) block ;; label = @5 block ;; label = @6 - local.get 4 + local.get 3 i32.load8_s local.tee 8 i32.const -1 i32.le_s br_if 0 (;@6;) - local.get 4 + local.get 3 i32.const 1 i32.add local.set 8 @@ -1132,7 +1178,7 @@ i32.const -32 i32.ge_u br_if 0 (;@6;) - local.get 4 + local.get 3 i32.const 2 i32.add local.set 8 @@ -1143,50 +1189,21 @@ i32.const -16 i32.ge_u br_if 0 (;@6;) - local.get 4 + local.get 3 i32.const 3 i32.add local.set 8 br 1 (;@5;) end - local.get 4 - i32.load8_u offset=2 - i32.const 63 - i32.and - i32.const 6 - i32.shl - local.get 4 - i32.load8_u offset=1 - i32.const 63 - i32.and - i32.const 12 - i32.shl - i32.or - local.get 4 - i32.load8_u offset=3 - i32.const 63 - i32.and - i32.or - local.get 8 - i32.const 255 - i32.and - i32.const 18 - i32.shl - i32.const 1835008 - i32.and - i32.or - i32.const 1114112 - i32.eq - br_if 3 (;@2;) - local.get 4 + local.get 3 i32.const 4 i32.add local.set 8 end - local.get 7 - local.get 4 - i32.sub local.get 8 + local.get 3 + i32.sub + local.get 7 i32.add local.set 7 local.get 6 @@ -1203,76 +1220,60 @@ block ;; label = @3 local.get 8 i32.load8_s - local.tee 4 + local.tee 3 i32.const -1 i32.gt_s br_if 0 (;@3;) - local.get 4 + local.get 3 i32.const -32 i32.lt_u - br_if 0 (;@3;) - local.get 4 - i32.const -16 - i32.lt_u - br_if 0 (;@3;) - local.get 8 - i32.load8_u offset=2 - i32.const 63 - i32.and - i32.const 6 - i32.shl - local.get 8 - i32.load8_u offset=1 - i32.const 63 - i32.and - i32.const 12 - i32.shl - i32.or - local.get 8 - i32.load8_u offset=3 - i32.const 63 - i32.and - i32.or - local.get 4 - i32.const 255 - i32.and - i32.const 18 - i32.shl - i32.const 1835008 - i32.and - i32.or - i32.const 1114112 - i32.eq - br_if 1 (;@2;) + drop end block ;; label = @3 - local.get 7 - i32.eqz - br_if 0 (;@3;) block ;; label = @4 local.get 7 - local.get 2 - i32.lt_u + i32.eqz br_if 0 (;@4;) - local.get 7 - local.get 2 - i32.eq - br_if 1 (;@3;) - br 2 (;@2;) + block ;; label = @5 + local.get 7 + local.get 2 + i32.ge_u + br_if 0 (;@5;) + local.get 1 + local.get 7 + i32.add + i32.load8_s + i32.const -65 + i32.gt_s + br_if 1 (;@4;) + i32.const 0 + local.set 3 + br 2 (;@3;) + end + local.get 7 + local.get 2 + i32.eq + br_if 0 (;@4;) + i32.const 0 + local.set 3 + br 1 (;@3;) end local.get 1 - local.get 7 - i32.add - i32.load8_s - i32.const -64 - i32.lt_s - br_if 1 (;@2;) + local.set 3 end local.get 7 + local.get 2 + local.get 3 + select local.set 2 + local.get 3 + local.get 1 + local.get 3 + select + local.set 1 end block ;; label = @2 - local.get 3 + local.get 4 br_if 0 (;@2;) local.get 0 i32.load offset=20 @@ -1286,7 +1287,7 @@ end local.get 0 i32.load offset=4 - local.set 3 + local.set 4 block ;; label = @2 block ;; label = @3 local.get 2 @@ -1296,14 +1297,14 @@ local.get 1 local.get 2 call $core::str::count::do_count_chars - local.set 4 + local.set 3 br 1 (;@2;) end block ;; label = @3 local.get 2 br_if 0 (;@3;) i32.const 0 - local.set 4 + local.set 3 br 1 (;@2;) end local.get 2 @@ -1317,7 +1318,7 @@ i32.ge_u br_if 0 (;@4;) i32.const 0 - local.set 4 + local.set 3 i32.const 0 local.set 7 br 1 (;@3;) @@ -1327,11 +1328,11 @@ i32.and local.set 5 i32.const 0 - local.set 4 + local.set 3 i32.const 0 local.set 7 loop ;; label = @4 - local.get 4 + local.get 3 local.get 1 local.get 7 i32.add @@ -1361,7 +1362,7 @@ i32.const -65 i32.gt_s i32.add - local.set 4 + local.set 3 local.get 5 local.get 7 i32.const 4 @@ -1379,13 +1380,13 @@ i32.add local.set 8 loop ;; label = @3 - local.get 4 + local.get 3 local.get 8 i32.load8_s i32.const -65 i32.gt_s i32.add - local.set 4 + local.set 3 local.get 8 i32.const 1 i32.add @@ -1399,16 +1400,16 @@ end block ;; label = @2 block ;; label = @3 - local.get 3 local.get 4 + local.get 3 i32.le_u br_if 0 (;@3;) - local.get 3 local.get 4 + local.get 3 i32.sub local.set 5 i32.const 0 - local.set 4 + local.set 3 block ;; label = @4 block ;; label = @5 block ;; label = @6 @@ -1417,7 +1418,7 @@ br_table 2 (;@4;) 0 (;@6;) 1 (;@5;) 2 (;@4;) 2 (;@4;) end local.get 5 - local.set 4 + local.set 3 i32.const 0 local.set 5 br 1 (;@4;) @@ -1425,7 +1426,7 @@ local.get 5 i32.const 1 i32.shr_u - local.set 4 + local.set 3 local.get 5 i32.const 1 i32.add @@ -1433,10 +1434,10 @@ i32.shr_u local.set 5 end - local.get 4 + local.get 3 i32.const 1 i32.add - local.set 4 + local.set 3 local.get 0 i32.load offset=16 local.set 6 @@ -1447,10 +1448,10 @@ i32.load offset=20 local.set 7 loop ;; label = @4 - local.get 4 + local.get 3 i32.const -1 i32.add - local.tee 4 + local.tee 3 i32.eqz br_if 2 (;@2;) local.get 7 @@ -1474,8 +1475,6 @@ call_indirect (type 0) return end - i32.const 1 - local.set 4 block ;; label = @2 local.get 7 local.get 1 @@ -1483,43 +1482,41 @@ local.get 8 i32.load offset=12 call_indirect (type 0) + i32.eqz br_if 0 (;@2;) - i32.const 0 - local.set 4 + i32.const 1 + return + end + i32.const 0 + local.set 3 + loop ;; label = @2 block ;; label = @3 - loop ;; label = @4 - block ;; label = @5 - local.get 5 - local.get 4 - i32.ne - br_if 0 (;@5;) - local.get 5 - local.set 4 - br 2 (;@3;) - end - local.get 4 - i32.const 1 - i32.add - local.set 4 - local.get 7 - local.get 6 - local.get 8 - i32.load offset=16 - call_indirect (type 1) - i32.eqz - br_if 0 (;@4;) - end - local.get 4 - i32.const -1 - i32.add - local.set 4 + local.get 5 + local.get 3 + i32.ne + br_if 0 (;@3;) + local.get 5 + local.get 5 + i32.lt_u + return end - local.get 4 - local.get 5 - i32.lt_u - local.set 4 + local.get 3 + i32.const 1 + i32.add + local.set 3 + local.get 7 + local.get 6 + local.get 8 + i32.load offset=16 + call_indirect (type 1) + i32.eqz + br_if 0 (;@2;) end - local.get 4 + local.get 3 + i32.const -1 + i32.add + local.get 5 + i32.lt_u return end local.get 0 @@ -1531,14 +1528,14 @@ i32.load offset=12 call_indirect (type 0) ) - (func $core::fmt::num::imp::::fmt (;27;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::imp::::fmt (;24;) (type 1) (param i32 i32) (result i32) local.get 0 i64.load32_u i32.const 1 local.get 1 call $core::fmt::num::imp::fmt_u64 ) - (func $core::fmt::write (;28;) (type 0) (param i32 i32 i32) (result i32) + (func $core::fmt::write (;25;) (type 0) (param i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) global.get $__stack_pointer i32.const 48 @@ -1856,15 +1853,7 @@ global.set $__stack_pointer local.get 1 ) - (func $::type_id (;29;) (type 10) (param i32 i32) - local.get 0 - i64.const 5799598635382251841 - i64.store offset=8 - local.get 0 - i64.const 3885382061309546557 - i64.store - ) - (func $core::fmt::builders::DebugStruct::field (;30;) (type 11) (param i32 i32 i32 i32 i32) (result i32) + (func $core::fmt::builders::DebugStruct::field (;26;) (type 11) (param i32 i32 i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i64) global.get $__stack_pointer i32.const 64 @@ -1893,10 +1882,10 @@ local.set 6 local.get 8 i32.load offset=20 - i32.const 1048959 - i32.const 1048956 + i32.const 1048963 + i32.const 1048960 local.get 7 - i32.const 255 + i32.const 1 i32.and local.tee 7 select @@ -1909,8 +1898,6 @@ i32.load offset=12 call_indirect (type 0) br_if 1 (;@1;) - i32.const 1 - local.set 6 local.get 8 i32.load offset=20 local.get 1 @@ -1920,11 +1907,9 @@ i32.load offset=12 call_indirect (type 0) br_if 1 (;@1;) - i32.const 1 - local.set 6 local.get 8 i32.load offset=20 - i32.const 1048924 + i32.const 1048928 i32.const 2 local.get 8 i32.load offset=24 @@ -1939,16 +1924,16 @@ local.set 6 br 1 (;@1;) end + i32.const 1 + local.set 6 block ;; label = @2 local.get 7 - i32.const 255 + i32.const 1 i32.and br_if 0 (;@2;) - i32.const 1 - local.set 6 local.get 8 i32.load offset=20 - i32.const 1048961 + i32.const 1048965 i32.const 3 local.get 8 i32.load offset=24 @@ -1969,7 +1954,7 @@ i64.load offset=20 align=4 i64.store offset=12 align=4 local.get 5 - i32.const 1048928 + i32.const 1048932 i32.store offset=52 local.get 5 local.get 5 @@ -2012,7 +1997,7 @@ local.get 5 i32.const 12 i32.add - i32.const 1048924 + i32.const 1048928 i32.const 2 call $::write_str br_if 0 (;@1;) @@ -2026,7 +2011,7 @@ br_if 0 (;@1;) local.get 5 i32.load offset=48 - i32.const 1048964 + i32.const 1048968 i32.const 2 local.get 5 i32.load offset=52 @@ -2046,7 +2031,7 @@ global.set $__stack_pointer local.get 0 ) - (func $<&T as core::fmt::Display>::fmt (;31;) (type 1) (param i32 i32) (result i32) + (func $<&T as core::fmt::Display>::fmt (;27;) (type 1) (param i32 i32) (result i32) local.get 1 local.get 0 i32.load @@ -2054,7 +2039,7 @@ i32.load offset=4 call $core::fmt::Formatter::pad ) - (func $core::panicking::assert_failed_inner (;32;) (type 12) (param i32 i32 i32 i32 i32 i32 i32) + (func $core::panicking::assert_failed_inner (;28;) (type 12) (param i32 i32 i32 i32 i32 i32 i32) (local i32 i64) global.get $__stack_pointer i32.const 112 @@ -2083,21 +2068,21 @@ br_table 0 (;@4;) 1 (;@3;) 2 (;@2;) 0 (;@4;) end local.get 7 - i32.const 1048780 + i32.const 1048784 i32.store offset=24 i32.const 2 local.set 2 br 2 (;@1;) end local.get 7 - i32.const 1048782 + i32.const 1048786 i32.store offset=24 i32.const 2 local.set 2 br 1 (;@1;) end local.get 7 - i32.const 1048784 + i32.const 1048788 i32.store offset=24 i32.const 7 local.set 2 @@ -2113,13 +2098,13 @@ i32.const 3 i32.store offset=92 local.get 7 - i32.const 1048840 + i32.const 1048844 i32.store offset=88 local.get 7 i64.const 3 i64.store offset=100 align=4 local.get 7 - i32.const 8 + i32.const 7 i64.extend_i32_u i64.const 32 i64.shl @@ -2139,7 +2124,7 @@ i64.or i64.store offset=64 local.get 7 - i32.const 9 + i32.const 8 i64.extend_i32_u i64.const 32 i64.shl @@ -2189,13 +2174,13 @@ i32.const 4 i32.store offset=92 local.get 7 - i32.const 1048892 + i32.const 1048896 i32.store offset=88 local.get 7 i64.const 4 i64.store offset=100 align=4 local.get 7 - i32.const 8 + i32.const 7 i64.extend_i32_u i64.const 32 i64.shl @@ -2215,7 +2200,7 @@ i64.or i64.store offset=72 local.get 7 - i32.const 10 + i32.const 9 i64.extend_i32_u i64.const 32 i64.shl @@ -2226,7 +2211,7 @@ i64.or i64.store offset=64 local.get 7 - i32.const 9 + i32.const 8 i64.extend_i32_u i64.const 32 i64.shl @@ -2248,7 +2233,7 @@ call $core::panicking::panic_fmt unreachable ) - (func $<&T as core::fmt::Debug>::fmt (;33;) (type 1) (param i32 i32) (result i32) + (func $<&T as core::fmt::Debug>::fmt (;29;) (type 1) (param i32 i32) (result i32) local.get 0 i32.load local.get 1 @@ -2257,7 +2242,7 @@ i32.load offset=12 call_indirect (type 1) ) - (func $::fmt (;34;) (type 1) (param i32 i32) (result i32) + (func $::fmt (;30;) (type 1) (param i32 i32) (result i32) local.get 1 i32.load offset=20 local.get 1 @@ -2265,8 +2250,8 @@ local.get 0 call $core::fmt::write ) - (func $::write_str (;35;) (type 0) (param i32 i32 i32) (result i32) - (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) + (func $::write_str (;31;) (type 0) (param i32 i32 i32) (result i32) + (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32 i32) local.get 1 i32.const -1 i32.add @@ -2284,286 +2269,288 @@ local.set 7 i32.const 0 local.set 8 - loop ;; label = @1 - block ;; label = @2 + i32.const 0 + local.set 9 + i32.const 0 + local.set 10 + block ;; label = @1 + loop ;; label = @2 + local.get 10 + i32.const 1 + i32.and + br_if 1 (;@1;) block ;; label = @3 - local.get 7 - local.get 2 - i32.gt_u - br_if 0 (;@3;) - loop ;; label = @4 - local.get 1 - local.get 7 - i32.add - local.set 9 - block ;; label = @5 + block ;; label = @4 + local.get 9 + local.get 2 + i32.gt_u + br_if 0 (;@4;) + loop ;; label = @5 + local.get 1 + local.get 9 + i32.add + local.set 11 block ;; label = @6 block ;; label = @7 - local.get 2 - local.get 7 - i32.sub - local.tee 10 - i32.const 8 - i32.lt_u - br_if 0 (;@7;) block ;; label = @8 block ;; label = @9 - local.get 9 - i32.const 3 - i32.add - i32.const -4 - i32.and - local.tee 11 + local.get 2 local.get 9 i32.sub local.tee 12 - i32.eqz + i32.const 7 + i32.gt_u br_if 0 (;@9;) - i32.const 0 - local.set 0 - loop ;; label = @10 - local.get 9 - local.get 0 + local.get 2 + local.get 9 + i32.ne + br_if 1 (;@8;) + local.get 2 + local.set 9 + br 5 (;@4;) + end + block ;; label = @9 + block ;; label = @10 + local.get 11 + i32.const 3 i32.add - i32.load8_u - i32.const 10 - i32.eq - br_if 5 (;@5;) + i32.const -4 + i32.and + local.tee 13 + local.get 11 + i32.sub + local.tee 14 + i32.eqz + br_if 0 (;@10;) + i32.const 0 + local.set 0 + loop ;; label = @11 + local.get 11 + local.get 0 + i32.add + i32.load8_u + i32.const 10 + i32.eq + br_if 5 (;@6;) + local.get 14 + local.get 0 + i32.const 1 + i32.add + local.tee 0 + i32.ne + br_if 0 (;@11;) + end + local.get 14 local.get 12 - local.get 0 - i32.const 1 + i32.const -8 i32.add - local.tee 0 - i32.ne - br_if 0 (;@10;) + local.tee 15 + i32.le_u + br_if 1 (;@9;) + br 3 (;@7;) end local.get 12 - local.get 10 i32.const -8 i32.add - local.tee 13 + local.set 15 + end + loop ;; label = @9 + i32.const 16843008 + local.get 13 + i32.load + local.tee 0 + i32.const 168430090 + i32.xor + i32.sub + local.get 0 + i32.or + i32.const 16843008 + local.get 13 + i32.const 4 + i32.add + i32.load + local.tee 0 + i32.const 168430090 + i32.xor + i32.sub + local.get 0 + i32.or + i32.and + i32.const -2139062144 + i32.and + i32.const -2139062144 + i32.ne + br_if 2 (;@7;) + local.get 13 + i32.const 8 + i32.add + local.set 13 + local.get 14 + i32.const 8 + i32.add + local.tee 14 + local.get 15 i32.le_u - br_if 1 (;@8;) - br 3 (;@6;) + br_if 0 (;@9;) + br 2 (;@7;) end - local.get 10 - i32.const -8 - i32.add - local.set 13 end + i32.const 0 + local.set 0 loop ;; label = @8 local.get 11 - i32.const 4 - i32.add - i32.load - local.tee 0 - i32.const 168430090 - i32.xor - i32.const -16843009 - i32.add local.get 0 - i32.const -1 - i32.xor - i32.and - local.get 11 - i32.load - local.tee 0 - i32.const 168430090 - i32.xor - i32.const -16843009 i32.add - local.get 0 - i32.const -1 - i32.xor - i32.and - i32.or - i32.const -2139062144 - i32.and + i32.load8_u + i32.const 10 + i32.eq br_if 2 (;@6;) - local.get 11 - i32.const 8 - i32.add - local.set 11 local.get 12 - i32.const 8 + local.get 0 + i32.const 1 i32.add - local.tee 12 - local.get 13 - i32.le_u + local.tee 0 + i32.ne br_if 0 (;@8;) - br 2 (;@6;) end + local.get 2 + local.set 9 + br 3 (;@4;) end block ;; label = @7 - local.get 2 - local.get 7 + local.get 14 + local.get 12 i32.ne br_if 0 (;@7;) local.get 2 - local.set 7 - br 4 (;@3;) + local.set 9 + br 3 (;@4;) end - i32.const 0 - local.set 0 loop ;; label = @7 - local.get 9 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - br_if 2 (;@5;) - local.get 10 - local.get 0 + block ;; label = @8 + local.get 11 + local.get 14 + i32.add + i32.load8_u + i32.const 10 + i32.ne + br_if 0 (;@8;) + local.get 14 + local.set 0 + br 2 (;@6;) + end + local.get 12 + local.get 14 i32.const 1 i32.add - local.tee 0 + local.tee 14 i32.ne br_if 0 (;@7;) end local.get 2 - local.set 7 - br 3 (;@3;) + local.set 9 + br 2 (;@4;) end - block ;; label = @6 - local.get 10 - local.get 12 - i32.ne - br_if 0 (;@6;) - local.get 2 - local.set 7 - br 3 (;@3;) - end - loop ;; label = @6 - block ;; label = @7 - local.get 9 - local.get 12 - i32.add - i32.load8_u - i32.const 10 - i32.ne - br_if 0 (;@7;) - local.get 12 - local.set 0 - br 2 (;@5;) - end - local.get 10 - local.get 12 - i32.const 1 + local.get 0 + local.get 9 + i32.add + local.tee 14 + i32.const 1 + i32.add + local.set 9 + block ;; label = @6 + local.get 14 + local.get 2 + i32.ge_u + br_if 0 (;@6;) + local.get 11 + local.get 0 i32.add - local.tee 12 + i32.load8_u + i32.const 10 i32.ne br_if 0 (;@6;) + local.get 9 + local.set 11 + local.get 9 + local.set 0 + br 3 (;@3;) end - local.get 2 - local.set 7 - br 2 (;@3;) - end - local.get 0 - local.get 7 - i32.add - local.tee 12 - i32.const 1 - i32.add - local.set 7 - block ;; label = @5 - local.get 12 - local.get 2 - i32.ge_u - br_if 0 (;@5;) local.get 9 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.ne + local.get 2 + i32.le_u br_if 0 (;@5;) - i32.const 0 - local.set 9 - local.get 7 - local.set 11 - local.get 7 - local.set 0 - br 3 (;@2;) end - local.get 7 - local.get 2 - i32.le_u + end + i32.const 1 + local.set 10 + local.get 8 + local.set 11 + local.get 2 + local.set 0 + local.get 8 + local.get 2 + i32.eq + br_if 2 (;@1;) + end + block ;; label = @3 + block ;; label = @4 + local.get 6 + i32.load8_u + i32.eqz br_if 0 (;@4;) + local.get 5 + i32.const 1048956 + i32.const 4 + local.get 4 + i32.load offset=12 + call_indirect (type 0) + br_if 1 (;@3;) end + local.get 0 + local.get 8 + i32.sub + local.set 13 + i32.const 0 + local.set 14 + block ;; label = @4 + local.get 0 + local.get 8 + i32.eq + br_if 0 (;@4;) + local.get 3 + local.get 0 + i32.add + i32.load8_u + i32.const 10 + i32.eq + local.set 14 + end + local.get 1 + local.get 8 + i32.add + local.set 0 + local.get 6 + local.get 14 + i32.store8 + local.get 11 + local.set 8 + local.get 5 + local.get 0 + local.get 13 + local.get 4 + i32.load offset=12 + call_indirect (type 0) + i32.eqz + br_if 1 (;@2;) end - i32.const 1 - local.set 9 - local.get 8 - local.set 11 - local.get 2 - local.set 0 - local.get 8 - local.get 2 - i32.ne - br_if 0 (;@2;) - i32.const 0 - return - end - block ;; label = @2 - local.get 6 - i32.load8_u - i32.eqz - br_if 0 (;@2;) - local.get 5 - i32.const 1048952 - i32.const 4 - local.get 4 - i32.load offset=12 - call_indirect (type 0) - i32.eqz - br_if 0 (;@2;) - i32.const 1 - return - end - local.get 0 - local.get 8 - i32.sub - local.set 10 - i32.const 0 - local.set 12 - block ;; label = @2 - local.get 0 - local.get 8 - i32.eq - br_if 0 (;@2;) - local.get 3 - local.get 0 - i32.add - i32.load8_u - i32.const 10 - i32.eq - local.set 12 end - local.get 1 - local.get 8 - i32.add - local.set 0 - local.get 6 - local.get 12 - i32.store8 - local.get 11 - local.set 8 - local.get 5 - local.get 0 - local.get 10 - local.get 4 - i32.load offset=12 - call_indirect (type 0) - local.tee 0 - local.get 9 - i32.or - i32.eqz - br_if 0 (;@1;) + i32.const 1 + local.set 7 end - local.get 0 + local.get 7 ) - (func $::write_char (;36;) (type 1) (param i32 i32) (result i32) + (func $::write_char (;32;) (type 1) (param i32 i32) (result i32) (local i32 i32) local.get 0 i32.load offset=4 @@ -2579,7 +2566,7 @@ i32.eqz br_if 0 (;@1;) local.get 3 - i32.const 1048952 + i32.const 1048956 i32.const 4 local.get 2 i32.load offset=12 @@ -2600,67 +2587,62 @@ i32.load offset=16 call_indirect (type 1) ) - (func $core::fmt::builders::DebugStruct::finish (;37;) (type 13) (param i32) (result i32) + (func $core::fmt::builders::DebugStruct::finish (;33;) (type 13) (param i32) (result i32) (local i32 i32) local.get 0 i32.load8_u offset=4 - local.set 1 + local.tee 1 + local.set 2 block ;; label = @1 local.get 0 i32.load8_u offset=5 + i32.eqz br_if 0 (;@1;) - local.get 1 - i32.const 255 - i32.and - i32.const 0 - i32.ne - return - end - i32.const 1 - local.set 2 - block ;; label = @1 - local.get 1 - i32.const 255 - i32.and - br_if 0 (;@1;) + i32.const 1 + local.set 2 block ;; label = @2 - local.get 0 - i32.load - local.tee 1 - i32.load8_u offset=28 - i32.const 4 + local.get 1 + i32.const 1 i32.and br_if 0 (;@2;) - local.get 0 - local.get 1 + block ;; label = @3 + local.get 0 + i32.load + local.tee 2 + i32.load8_u offset=28 + i32.const 4 + i32.and + br_if 0 (;@3;) + local.get 2 + i32.load offset=20 + i32.const 1048971 + i32.const 2 + local.get 2 + i32.load offset=24 + i32.load offset=12 + call_indirect (type 0) + local.set 2 + br 1 (;@2;) + end + local.get 2 i32.load offset=20 - i32.const 1048967 - i32.const 2 - local.get 1 + i32.const 1048970 + i32.const 1 + local.get 2 i32.load offset=24 i32.load offset=12 call_indirect (type 0) - local.tee 1 - i32.store8 offset=4 - local.get 1 - return + local.set 2 end - local.get 1 - i32.load offset=20 - i32.const 1048966 - i32.const 1 - local.get 1 - i32.load offset=24 - i32.load offset=12 - call_indirect (type 0) - local.set 2 + local.get 0 + local.get 2 + i32.store8 offset=4 end - local.get 0 - local.get 2 - i32.store8 offset=4 local.get 2 + i32.const 1 + i32.and ) - (func $core::fmt::Formatter::pad_integral (;38;) (type 14) (param i32 i32 i32 i32 i32 i32) (result i32) + (func $core::fmt::Formatter::pad_integral (;34;) (type 14) (param i32 i32 i32 i32 i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 block ;; label = @2 @@ -2818,135 +2800,144 @@ local.set 6 end block ;; label = @1 + local.get 0 + i32.load + br_if 0 (;@1;) block ;; label = @2 - local.get 0 - i32.load - br_if 0 (;@2;) - i32.const 1 - local.set 1 - local.get 0 - i32.load offset=20 - local.tee 12 - local.get 0 - i32.load offset=24 - local.tee 10 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - br_if 1 (;@1;) - local.get 12 - local.get 4 - local.get 5 - local.get 10 - i32.load offset=12 - call_indirect (type 0) - return - end - block ;; label = @2 - local.get 0 - i32.load offset=4 - local.tee 9 - local.get 6 - i32.gt_u - br_if 0 (;@2;) - i32.const 1 - local.set 1 local.get 0 i32.load offset=20 - local.tee 12 + local.tee 1 local.get 0 i32.load offset=24 - local.tee 10 + local.tee 12 local.get 8 local.get 2 local.get 3 call $core::fmt::Formatter::pad_integral::write_prefix - br_if 1 (;@1;) - local.get 12 - local.get 4 - local.get 5 - local.get 10 - i32.load offset=12 - call_indirect (type 0) - return - end - block ;; label = @2 - local.get 7 - i32.const 8 - i32.and i32.eqz br_if 0 (;@2;) - local.get 0 - i32.load offset=16 - local.set 11 - local.get 0 - i32.const 48 - i32.store offset=16 - local.get 0 - i32.load8_u offset=32 - local.set 7 - i32.const 1 - local.set 1 - local.get 0 i32.const 1 - i32.store8 offset=32 - local.get 0 - i32.load offset=20 - local.tee 12 - local.get 0 - i32.load offset=24 - local.tee 10 - local.get 8 - local.get 2 - local.get 3 - call $core::fmt::Formatter::pad_integral::write_prefix - br_if 1 (;@1;) - local.get 9 - local.get 6 - i32.sub - i32.const 1 - i32.add - local.set 1 + return + end + local.get 1 + local.get 4 + local.get 5 + local.get 12 + i32.load offset=12 + call_indirect (type 0) + return + end + block ;; label = @1 + block ;; label = @2 block ;; label = @3 - loop ;; label = @4 - local.get 1 - i32.const -1 - i32.add + block ;; label = @4 + local.get 0 + i32.load offset=4 + local.tee 1 + local.get 6 + i32.gt_u + br_if 0 (;@4;) + local.get 0 + i32.load offset=20 local.tee 1 + local.get 0 + i32.load offset=24 + local.tee 12 + local.get 8 + local.get 2 + local.get 3 + call $core::fmt::Formatter::pad_integral::write_prefix i32.eqz br_if 1 (;@3;) + i32.const 1 + return + end + local.get 7 + i32.const 8 + i32.and + i32.eqz + br_if 1 (;@2;) + local.get 0 + i32.load offset=16 + local.set 9 + local.get 0 + i32.const 48 + i32.store offset=16 + local.get 0 + i32.load8_u offset=32 + local.set 7 + i32.const 1 + local.set 11 + local.get 0 + i32.const 1 + i32.store8 offset=32 + local.get 0 + i32.load offset=20 + local.tee 12 + local.get 0 + i32.load offset=24 + local.tee 10 + local.get 8 + local.get 2 + local.get 3 + call $core::fmt::Formatter::pad_integral::write_prefix + br_if 2 (;@1;) + local.get 1 + local.get 6 + i32.sub + i32.const 1 + i32.add + local.set 1 + block ;; label = @4 + loop ;; label = @5 + local.get 1 + i32.const -1 + i32.add + local.tee 1 + i32.eqz + br_if 1 (;@4;) + local.get 12 + i32.const 48 + local.get 10 + i32.load offset=16 + call_indirect (type 1) + i32.eqz + br_if 0 (;@5;) + end + i32.const 1 + return + end + block ;; label = @4 local.get 12 - i32.const 48 + local.get 4 + local.get 5 local.get 10 - i32.load offset=16 - call_indirect (type 1) + i32.load offset=12 + call_indirect (type 0) i32.eqz br_if 0 (;@4;) + i32.const 1 + return end - i32.const 1 + local.get 0 + local.get 7 + i32.store8 offset=32 + local.get 0 + local.get 9 + i32.store offset=16 + i32.const 0 return end - i32.const 1 - local.set 1 - local.get 12 + local.get 1 local.get 4 local.get 5 - local.get 10 + local.get 12 i32.load offset=12 call_indirect (type 0) - br_if 1 (;@1;) - local.get 0 - local.get 7 - i32.store8 offset=32 - local.get 0 - local.get 11 - i32.store offset=16 - i32.const 0 - local.set 1 + local.set 11 br 1 (;@1;) end - local.get 9 + local.get 1 local.get 6 i32.sub local.set 6 @@ -3008,7 +2999,7 @@ return end i32.const 1 - local.set 1 + local.set 11 local.get 10 local.get 12 local.get 8 @@ -3055,15 +3046,15 @@ i32.lt_u return end - local.get 1 + local.get 11 ) - (func $core::fmt::Write::write_fmt (;39;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::Write::write_fmt (;35;) (type 1) (param i32 i32) (result i32) local.get 0 - i32.const 1048928 + i32.const 1048932 local.get 1 call $core::fmt::write ) - (func $core::str::count::do_count_chars (;40;) (type 1) (param i32 i32) (result i32) + (func $core::str::count::do_count_chars (;36;) (type 1) (param i32 i32) (result i32) (local i32 i32 i32 i32 i32 i32 i32 i32) block ;; label = @1 block ;; label = @2 @@ -3542,30 +3533,26 @@ end local.get 8 ) - (func $core::fmt::Formatter::pad_integral::write_prefix (;41;) (type 11) (param i32 i32 i32 i32 i32) (result i32) - (local i32) + (func $core::fmt::Formatter::pad_integral::write_prefix (;37;) (type 11) (param i32 i32 i32 i32 i32) (result i32) block ;; label = @1 - block ;; label = @2 - block ;; label = @3 - local.get 2 - i32.const 1114112 - i32.eq - br_if 0 (;@3;) - i32.const 1 - local.set 5 - local.get 0 - local.get 2 - local.get 1 - i32.load offset=16 - call_indirect (type 1) - br_if 1 (;@2;) - end - local.get 3 - br_if 1 (;@1;) - i32.const 0 - local.set 5 - end - local.get 5 + local.get 2 + i32.const 1114112 + i32.eq + br_if 0 (;@1;) + local.get 0 + local.get 2 + local.get 1 + i32.load offset=16 + call_indirect (type 1) + i32.eqz + br_if 0 (;@1;) + i32.const 1 + return + end + block ;; label = @1 + local.get 3 + br_if 0 (;@1;) + i32.const 0 return end local.get 0 @@ -3575,7 +3562,7 @@ i32.load offset=12 call_indirect (type 0) ) - (func $core::fmt::Formatter::debug_struct (;42;) (type 9) (param i32 i32 i32 i32) + (func $core::fmt::Formatter::debug_struct (;38;) (type 9) (param i32 i32 i32 i32) local.get 1 i32.load offset=20 local.get 2 @@ -3595,66 +3582,14 @@ local.get 1 i32.store ) - (func $core::slice::index::slice_start_index_len_fail_rt (;43;) (type 7) (param i32 i32 i32) - (local i32 i64) - global.get $__stack_pointer - i32.const 48 - i32.sub - local.tee 3 - global.set $__stack_pointer - local.get 3 - local.get 1 - i32.store offset=4 - local.get 3 - local.get 0 - i32.store - local.get 3 - i32.const 2 - i32.store offset=12 - local.get 3 - i32.const 1049268 - i32.store offset=8 - local.get 3 - i64.const 2 - i64.store offset=20 align=4 - local.get 3 - i32.const 7 - i64.extend_i32_u - i64.const 32 - i64.shl - local.tee 4 - local.get 3 - i32.const 4 - i32.add - i64.extend_i32_u - i64.or - i64.store offset=40 - local.get 3 - local.get 4 - local.get 3 - i64.extend_i32_u - i64.or - i64.store offset=32 - local.get 3 - local.get 3 - i32.const 32 - i32.add - i32.store offset=16 - local.get 3 - i32.const 8 - i32.add - local.get 2 - call $core::panicking::panic_fmt - unreachable - ) - (func $core::fmt::num::imp::::fmt (;44;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::imp::::fmt (;39;) (type 1) (param i32 i32) (result i32) local.get 0 i64.load i32.const 1 local.get 1 call $core::fmt::num::imp::fmt_u64 ) - (func $core::fmt::num::imp::fmt_u64 (;45;) (type 15) (param i64 i32 i32) (result i32) + (func $core::fmt::num::imp::fmt_u64 (;40;) (type 15) (param i64 i32 i32) (result i32) (local i32 i32 i64 i32 i32 i32) global.get $__stack_pointer i32.const 48 @@ -3701,7 +3636,7 @@ local.tee 8 i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3717,7 +3652,7 @@ i32.and i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3736,12 +3671,16 @@ end end block ;; label = @1 - local.get 5 - i32.wrap_i64 - local.tee 6 - i32.const 99 - i32.le_u - br_if 0 (;@1;) + block ;; label = @2 + local.get 5 + i64.const 99 + i64.gt_u + br_if 0 (;@2;) + local.get 5 + i32.wrap_i64 + local.set 6 + br 1 (;@1;) + end local.get 3 i32.const 9 i32.add @@ -3766,7 +3705,7 @@ i32.and i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3788,7 +3727,7 @@ local.get 6 i32.const 1 i32.shl - i32.const 1049014 + i32.const 1049010 i32.add i32.load16_u align=1 i32.store16 align=1 @@ -3827,7 +3766,7 @@ global.set $__stack_pointer local.get 4 ) - (func $core::fmt::num::::fmt (;46;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::::fmt (;41;) (type 1) (param i32 i32) (result i32) (local i32 i64 i32) global.get $__stack_pointer i32.const 128 @@ -3886,13 +3825,13 @@ br_if 0 (;@1;) local.get 4 i32.const 128 - i32.const 1048996 + i32.const 1048992 call $core::slice::index::slice_start_index_len_fail unreachable end local.get 1 i32.const 1 - i32.const 1049012 + i32.const 1049008 i32.const 2 local.get 2 local.get 0 @@ -3910,7 +3849,7 @@ global.set $__stack_pointer local.get 0 ) - (func $core::fmt::num::::fmt (;47;) (type 1) (param i32 i32) (result i32) + (func $core::fmt::num::::fmt (;42;) (type 1) (param i32 i32) (result i32) (local i32 i64 i32) global.get $__stack_pointer i32.const 128 @@ -3969,13 +3908,13 @@ br_if 0 (;@1;) local.get 4 i32.const 128 - i32.const 1048996 + i32.const 1048992 call $core::slice::index::slice_start_index_len_fail unreachable end local.get 1 i32.const 1 - i32.const 1049012 + i32.const 1049008 i32.const 2 local.get 2 local.get 0 @@ -3993,22 +3932,22 @@ global.set $__stack_pointer local.get 0 ) - (func $cabi_realloc (;48;) (type 8) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;43;) (type 8) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 - call $cabi_realloc_wit_bindgen_0_28_0 + call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 17 17 funcref) + (table (;0;) 13 13 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:base/note-script@1.0.0#note-script" (func $miden:base/note-script@1.0.0#note-script)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $cabi_realloc_wit_bindgen_0_28_0)) (export "cabi_realloc" (func $cabi_realloc)) - (elem (;0;) (i32.const 1) func $core::ptr::drop_in_place<&basic_wallet_p2id_note::bindings::miden::base::core_types::AccountId> $<&T as core::fmt::Debug>::fmt $core::ptr::drop_in_place $core::fmt::num::::fmt $::fmt $cabi_realloc $core::fmt::num::imp::::fmt $<&T as core::fmt::Debug>::fmt $<&T as core::fmt::Display>::fmt $::fmt $core::ptr::drop_in_place $::type_id $core::ptr::drop_in_place $::write_str $::write_char $core::fmt::Write::write_fmt) - (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\04\00\00\00\04\00\00\00\02\00\00\00Feltinner\00\00\00\03\00\00\00\08\00\00\00\08\00\00\00\04\00\00\00AccountId\00\00\00\03\00\00\00\08\00\00\00\08\00\00\00\05\00\00\00src/lib.rs\00\00H\00\10\00\0a\00\00\00!\00\00\00,\00\00\00H\00\10\00\0a\00\00\00$\00\00\00\09\00\00\00\06\00\00\00\0b\00\00\00\00\00\00\00\01\00\00\00\0c\00\00\00index out of bounds: the len is but the index is \00\00\88\00\10\00 \00\00\00\a8\00\10\00\12\00\00\00==!=matchesassertion `left right` failed\0a left: \0a right: \00\d7\00\10\00\10\00\00\00\e7\00\10\00\17\00\00\00\fe\00\10\00\09\00\00\00 right` failed: \0a left: \00\00\00\d7\00\10\00\10\00\00\00 \01\10\00\10\00\00\000\01\10\00\09\00\00\00\fe\00\10\00\09\00\00\00: \00\00\0d\00\00\00\0c\00\00\00\04\00\00\00\0e\00\00\00\0f\00\00\00\10\00\00\00 { , {\0a,\0a} }library/core/src/fmt/num.rs\89\01\10\00\1b\00\00\00i\00\00\00\17\00\00\000x00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899range start index out of range for slice of length \00\00~\02\10\00\12\00\00\00\90\02\10\00\22\00\00\00") + (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) + (elem (;0;) (i32.const 1) func $<&T as core::fmt::Debug>::fmt $basic_wallet_p2id_note::bindings::__link_custom_section_describing_imports $core::fmt::num::::fmt $::fmt $cabi_realloc $core::fmt::num::imp::::fmt $<&T as core::fmt::Debug>::fmt $<&T as core::fmt::Display>::fmt $::fmt $::write_str $::write_char $core::fmt::Write::write_fmt) + (data $.rodata (;0;) (i32.const 1048576) "\00\00\00\00\04\00\00\00\04\00\00\00\01\00\00\00\02\00\00\00Felt\00\00\00\00\08\00\00\00\08\00\00\00\03\00\00\00innerAccountId\00\00\00\00\00\00\08\00\00\00\08\00\00\00\04\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00\02\00\00\00src/lib.rs\00\00\5c\00\10\00\0a\00\00\00!\00\00\00,\00\00\00\5c\00\10\00\0a\00\00\00$\00\00\00\09\00\00\00\05\00\00\00index out of bounds: the len is but the index is \00\00\8c\00\10\00 \00\00\00\ac\00\10\00\12\00\00\00==!=matchesassertion `left right` failed\0a left: \0a right: \00\db\00\10\00\10\00\00\00\eb\00\10\00\17\00\00\00\02\01\10\00\09\00\00\00 right` failed: \0a left: \00\00\00\db\00\10\00\10\00\00\00$\01\10\00\10\00\00\004\01\10\00\09\00\00\00\02\01\10\00\09\00\00\00: \00\00\00\00\00\00\0c\00\00\00\04\00\00\00\0a\00\00\00\0b\00\00\00\0c\00\00\00 { , {\0a,\0a} }core/src/fmt/num.rs\8d\01\10\00\13\00\00\00f\00\00\00\17\00\00\000x00010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899range start index out of range for slice of length \00\00z\02\10\00\12\00\00\00\8c\02\10\00\22\00\00\00") ) (core module (;1;) (type (;0;) (func (param i32))) 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 6d205f879..1c738a7ab 100644 --- a/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat +++ b/tests/integration/expected/wit_sdk_basic_wallet/miden_sdk.wat @@ -17,16 +17,17 @@ br 0 (;@1;) end ) - (func $__rust_alloc (;2;) (type 2) (param i32 i32) (result i32) - i32.const 1048660 + (func $miden_sdk::bindings::__link_custom_section_describing_imports (;2;) (type 0)) + (func $__rust_alloc (;3;) (type 2) (param i32 i32) (result i32) + i32.const 1048652 local.get 1 local.get 0 call $::alloc ) - (func $__rust_realloc (;3;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $__rust_realloc (;4;) (type 3) (param i32 i32 i32 i32) (result i32) (local i32) block ;; label = @1 - i32.const 1048660 + i32.const 1048652 local.get 2 local.get 3 call $::alloc @@ -42,7 +43,7 @@ i32.lt_u select memory.copy - i32.const 1048660 + i32.const 1048652 local.get 0 local.get 2 local.get 1 @@ -50,74 +51,69 @@ end local.get 4 ) - (func $miden:base/core-types@1.0.0#account-id-from-felt (;4;) (type 4) (param i64) (result i64) + (func $miden:base/core-types@1.0.0#account-id-from-felt (;5;) (type 4) (param i64) (result i64) call $wit_bindgen_rt::run_ctors_once local.get 0 ) - (func $miden:base/types@1.0.0#from-core-asset (;5;) (type 5) (param i64 i64 i64 i64) (result i32) + (func $miden:base/types@1.0.0#from-core-asset (;6;) (type 5) (param i64 i64 i64 i64) (result i32) call $wit_bindgen_rt::run_ctors_once - i32.const 1048576 + i32.const 1048584 i32.const 19 - i32.const 1048608 + i32.const 1048616 call $core::panicking::panic unreachable ) - (func $miden:base/types@1.0.0#to-core-asset (;6;) (type 6) (param i32 i64 i64 i64 i64) (result i32) + (func $miden:base/types@1.0.0#to-core-asset (;7;) (type 6) (param i32 i64 i64 i64 i64) (result i32) call $wit_bindgen_rt::run_ctors_once - i32.const 1048576 + i32.const 1048584 i32.const 19 - i32.const 1048624 + i32.const 1048632 call $core::panicking::panic unreachable ) - (func $cabi_realloc_wit_bindgen_0_28_0 (;7;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $wit_bindgen_rt::cabi_realloc (;8;) (type 3) (param i32 i32 i32 i32) (result i32) block ;; label = @1 block ;; label = @2 block ;; label = @3 - block ;; label = @4 - local.get 1 - br_if 0 (;@4;) - local.get 3 - i32.eqz - br_if 2 (;@2;) - i32.const 0 - i32.load8_u offset=1048664 - drop - local.get 3 - local.get 2 - call $__rust_alloc - local.set 2 - br 1 (;@3;) - end - local.get 0 local.get 1 - local.get 2 + br_if 0 (;@3;) + local.get 3 + i32.eqz + br_if 2 (;@1;) + i32.const 0 + i32.load8_u offset=1048656 + drop local.get 3 - call $__rust_realloc + local.get 2 + call $__rust_alloc local.set 2 + br 1 (;@2;) end + local.get 0 + local.get 1 local.get 2 - i32.eqz - br_if 1 (;@1;) + local.get 3 + call $__rust_realloc + local.set 2 end local.get 2 - return + br_if 0 (;@1;) + unreachable end - unreachable - unreachable + local.get 2 ) - (func $wit_bindgen_rt::run_ctors_once (;8;) (type 0) + (func $wit_bindgen_rt::run_ctors_once (;9;) (type 0) block ;; label = @1 i32.const 0 - i32.load8_u offset=1048665 + i32.load8_u offset=1048657 br_if 0 (;@1;) call $__wasm_call_ctors i32.const 0 i32.const 1 - i32.store8 offset=1048665 + i32.store8 offset=1048657 end ) - (func $wee_alloc::alloc_first_fit (;9;) (type 7) (param i32 i32 i32) (result i32) + (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 @@ -422,7 +418,7 @@ end i32.const 0 ) - (func $::alloc (;10;) (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 @@ -526,7 +522,7 @@ global.set $__stack_pointer local.get 2 ) - (func $::dealloc (;11;) (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 @@ -556,39 +552,22 @@ block ;; label = @3 block ;; label = @4 block ;; label = @5 - block ;; label = @6 - block ;; label = @7 - local.get 3 - i32.const 4 - i32.add - local.tee 7 - i32.load - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 0 (;@7;) - local.get 8 - i32.load - local.tee 9 - i32.const 1 - i32.and - i32.eqz - br_if 1 (;@6;) - end - local.get 5 - i32.const -4 - i32.and - local.tee 8 - i32.eqz - br_if 3 (;@3;) - local.get 5 - i32.const 2 - i32.and - i32.eqz - br_if 1 (;@5;) - br 3 (;@3;) - end + local.get 1 + i32.const -4 + i32.add + local.tee 7 + i32.load + i32.const -4 + i32.and + local.tee 8 + i32.eqz + br_if 0 (;@5;) + local.get 8 + i32.load + local.tee 9 + i32.const 1 + i32.and + br_if 0 (;@5;) block ;; label = @6 block ;; label = @7 block ;; label = @8 @@ -669,18 +648,28 @@ i32.store br 1 (;@4;) end - local.get 8 + local.get 5 + i32.const 2 + i32.and + br_if 1 (;@3;) + local.get 5 + i32.const -4 + i32.and + local.tee 5 + i32.eqz + br_if 1 (;@3;) + local.get 5 i32.load8_u i32.const 1 i32.and br_if 1 (;@3;) local.get 1 - local.get 8 + local.get 5 i32.load offset=8 i32.const -4 i32.and i32.store - local.get 8 + local.get 5 local.get 3 i32.const 1 i32.or @@ -699,7 +688,6 @@ i32.store end ) - (func $core::ptr::drop_in_place (;12;) (type 1) (param i32)) (func $core::panicking::panic_fmt (;13;) (type 9) (param i32 i32) (local i32) global.get $__stack_pointer @@ -708,6 +696,22 @@ local.tee 2 global.set $__stack_pointer local.get 2 + i32.const 16 + i32.add + local.get 0 + i32.const 16 + i32.add + i64.load align=4 + i64.store + local.get 2 + i32.const 8 + i32.add + local.get 0 + i32.const 8 + i32.add + i64.load align=4 + i64.store + local.get 2 i32.const 1 i32.store16 offset=28 local.get 2 @@ -715,16 +719,9 @@ i32.store offset=24 local.get 2 local.get 0 - i32.store offset=20 - local.get 2 - i32.const 1048644 - i32.store offset=16 - local.get 2 - i32.const 1 - i32.store offset=12 + i64.load align=4 + i64.store local.get 2 - i32.const 12 - i32.add call $rust_begin_unwind unreachable ) @@ -760,32 +757,24 @@ call $core::panicking::panic_fmt unreachable ) - (func $::type_id (;15;) (type 9) (param i32 i32) - local.get 0 - i64.const 5799598635382251841 - i64.store offset=8 - local.get 0 - i64.const 3885382061309546557 - i64.store - ) - (func $cabi_realloc (;16;) (type 3) (param i32 i32 i32 i32) (result i32) + (func $cabi_realloc (;15;) (type 3) (param i32 i32 i32 i32) (result i32) local.get 0 local.get 1 local.get 2 local.get 3 - call $cabi_realloc_wit_bindgen_0_28_0 + call $wit_bindgen_rt::cabi_realloc ) - (table (;0;) 4 4 funcref) + (table (;0;) 3 3 funcref) (memory (;0;) 17) (global $__stack_pointer (;0;) (mut i32) i32.const 1048576) (export "memory" (memory 0)) (export "miden:base/core-types@1.0.0#account-id-from-felt" (func $miden:base/core-types@1.0.0#account-id-from-felt)) (export "miden:base/types@1.0.0#from-core-asset" (func $miden:base/types@1.0.0#from-core-asset)) (export "miden:base/types@1.0.0#to-core-asset" (func $miden:base/types@1.0.0#to-core-asset)) - (export "cabi_realloc_wit_bindgen_0_28_0" (func $cabi_realloc_wit_bindgen_0_28_0)) (export "cabi_realloc" (func $cabi_realloc)) - (elem (;0;) (i32.const 1) func $cabi_realloc $core::ptr::drop_in_place $::type_id) - (data $.rodata (;0;) (i32.const 1048576) "not yet implementedsrc/lib.rs\00\00\00\13\00\10\00\0a\00\00\00!\00\00\00\09\00\00\00\13\00\10\00\0a\00\00\00%\00\00\00\09\00\00\00\01\00\00\00\02\00\00\00\00\00\00\00\01\00\00\00\03\00\00\00") + (export "cabi_realloc_wit_bindgen_0_28_0" (func $wit_bindgen_rt::cabi_realloc)) + (elem (;0;) (i32.const 1) func $miden_sdk::bindings::__link_custom_section_describing_imports $cabi_realloc) + (data $.rodata (;0;) (i32.const 1048576) "\01\00\00\00\01\00\00\00not yet implementedsrc/lib.rs\00\00\00\1b\00\10\00\0a\00\00\00!\00\00\00\09\00\00\00\1b\00\10\00\0a\00\00\00%\00\00\00\09\00\00\00\02\00\00\00") ) (core instance (;0;) (instantiate 0)) (alias core export 0 "memory" (core memory (;0;))) 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 b4a93b30f..c4b431fa0 100644 --- a/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock +++ b/tests/rust-apps-wasm/rust-sdk/account-test/Cargo.lock @@ -552,7 +552,7 @@ dependencies = [ [[package]] name = "miden-base-sys" -version = "0.0.4" +version = "0.0.6" dependencies = [ "miden-assembly", "miden-stdlib-sys", @@ -650,7 +650,7 @@ dependencies = [ [[package]] name = "miden-sdk" -version = "0.0.4" +version = "0.0.6" dependencies = [ "miden-base-sys", "miden-sdk-alloc", @@ -667,11 +667,11 @@ dependencies = [ [[package]] name = "miden-sdk-alloc" -version = "0.0.4" +version = "0.0.6" [[package]] name = "miden-stdlib-sys" -version = "0.0.4" +version = "0.0.6" [[package]] name = "miden-thiserror" 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 9477639c2..c81aa3024 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,5 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: #[allow(dead_code)] pub mod miden { #[allow(dead_code)] @@ -8,26 +6,26 @@ pub mod miden { pub mod core_types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + 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 + /// 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. + /// 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 { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Felt").field("inner", &self.inner).finish() } } @@ -35,19 +33,16 @@ pub mod miden { 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: + /// 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: + /// - 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. + /// - 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)] @@ -55,19 +50,24 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for AccountId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + 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) + /// 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 { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Recipient").field("inner", &self.inner).finish() } } @@ -77,55 +77,52 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Tag { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + 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: + /// 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 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. + /// 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 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. + /// 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. + /// 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 + /// - 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]. + /// - 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 + /// 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)] @@ -133,7 +130,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for CoreAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("CoreAsset").field("inner", &self.inner).finish() } } @@ -144,7 +144,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Nonce { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Nonce").field("inner", &self.inner).finish() } } @@ -155,7 +158,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for AccountHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountHash").field("inner", &self.inner).finish() } } @@ -166,7 +172,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for BlockHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("BlockHash").field("inner", &self.inner).finish() } } @@ -177,7 +186,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageValue").field("inner", &self.inner).finish() } } @@ -188,7 +200,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageRoot { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageRoot").field("inner", &self.inner).finish() } } @@ -199,8 +214,13 @@ pub mod miden { 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() + 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 @@ -210,8 +230,13 @@ pub mod miden { 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() + 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 @@ -221,7 +246,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for NoteId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("NoteId").field("inner", &self.inner).finish() } } @@ -230,14 +258,12 @@ pub mod miden { 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!() @@ -249,14 +275,11 @@ pub mod miden { } } } - #[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; + 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; @@ -265,10 +288,8 @@ pub mod miden { 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; + 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 { @@ -279,7 +300,6 @@ pub mod miden { #[link_name = "get-id"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -302,7 +322,6 @@ pub mod miden { #[link_name = "get-nonce"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -329,7 +348,6 @@ pub mod miden { #[link_name = "get-initial-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -341,10 +359,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -363,7 +389,6 @@ pub mod miden { #[link_name = "get-current-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -375,10 +400,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -388,16 +421,15 @@ pub mod miden { /// 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; - + 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!() @@ -412,8 +444,9 @@ pub mod miden { #[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 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")] @@ -421,7 +454,6 @@ pub mod miden { #[link_name = "get-item"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -433,10 +465,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -444,29 +484,47 @@ pub mod miden { #[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) { + 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::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 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); + 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!() @@ -534,18 +592,24 @@ pub mod miden { 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; - + 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!() @@ -565,24 +629,26 @@ pub mod miden { /// 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; - + 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 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -592,21 +658,28 @@ pub mod miden { /// 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 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::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!() @@ -631,13 +704,22 @@ pub mod miden { #[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 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::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")] @@ -645,7 +727,6 @@ pub mod miden { #[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!() @@ -663,9 +744,15 @@ pub mod miden { 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: 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, }, @@ -680,13 +767,22 @@ pub mod miden { #[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 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::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")] @@ -694,7 +790,6 @@ pub mod miden { #[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!() @@ -712,9 +807,15 @@ pub mod miden { 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: 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, }, @@ -736,7 +837,6 @@ pub mod miden { #[link_name = "get-vault-commitment"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -748,23 +848,28 @@ pub mod miden { 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 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } } } - #[allow(dead_code, clippy::all)] pub mod tx { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + 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; @@ -774,8 +879,7 @@ pub mod miden { 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. + /// 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")] @@ -784,13 +888,14 @@ pub mod miden { #[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 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -807,7 +912,6 @@ pub mod miden { #[link_name = "get-block-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -819,10 +923,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -842,7 +954,6 @@ pub mod miden { #[link_name = "get-input-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -853,10 +964,18 @@ pub mod miden { 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 }, + 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, + }, ) } } @@ -875,7 +994,6 @@ pub mod miden { #[link_name = "get-output-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -886,10 +1004,18 @@ pub mod miden { 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 }, + 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, + }, ) } } @@ -899,30 +1025,50 @@ pub mod miden { /// 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 { + 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 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 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; - + 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" { @@ -939,7 +1085,6 @@ pub mod miden { _: i64, ) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i64, @@ -985,9 +1130,7 @@ pub mod exports { 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; + 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; @@ -1000,26 +1143,23 @@ pub mod exports { 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, - }, - ), - }, - ); + #[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)] @@ -1034,8 +1174,7 @@ pub mod exports { arg7: i64, arg8: i64, ) { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[cfg(target_arch = "wasm32")] _rt::run_ctors_once(); T::send_asset( super::super::super::super::miden::base::core_types::CoreAsset { inner: ( @@ -1081,20 +1220,21 @@ pub mod exports { fn send_asset(core_asset: CoreAsset, tag: Tag, recipient: Recipient); } #[doc(hidden)] - - macro_rules! __export_miden_basic_wallet_basic_wallet_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:basic-wallet/basic-wallet@1.0.0#receive-asset"] - unsafe extern "C" fn export_receive_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,) { - $($path_to_types)*::_export_receive_asset_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - #[export_name = "miden:basic-wallet/basic-wallet@1.0.0#send-asset"] - unsafe extern "C" fn export_send_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,arg4: i64,arg5: i64,arg6: i64,arg7: i64,arg8: i64,) { - $($path_to_types)*::_export_send_asset_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) - } - };); - } + macro_rules! __export_miden_basic_wallet_basic_wallet_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:basic-wallet/basic-wallet@1.0.0#receive-asset"] unsafe + extern "C" fn export_receive_asset(arg0 : i64, arg1 : i64, arg2 : + i64, arg3 : i64,) { $($path_to_types)*:: + _export_receive_asset_cabi::<$ty > (arg0, arg1, arg2, arg3) } + #[export_name = + "miden:basic-wallet/basic-wallet@1.0.0#send-asset"] unsafe extern + "C" fn export_send_asset(arg0 : i64, arg1 : i64, arg2 : i64, arg3 + : i64, arg4 : i64, arg5 : i64, arg6 : i64, arg7 : i64, arg8 : + i64,) { $($path_to_types)*:: _export_send_asset_cabi::<$ty > + (arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8) } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_basic_wallet_basic_wallet_1_0_0_cabi; } @@ -1102,28 +1242,23 @@ pub mod exports { } } mod _rt { - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { @@ -1141,13 +1276,11 @@ mod _rt { 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. /// @@ -1166,18 +1299,21 @@ mod _rt { /// ``` #[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); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::miden::basic_wallet::basic_wallet::__export_miden_basic_wallet_basic_wallet_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: + exports::miden::basic_wallet::basic_wallet); + }; } #[doc(inline)] pub(crate) use __export_basic_wallet_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:basic-wallet-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.30.0:basic-wallet-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2072] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x8f\x0f\x01A\x02\x01\ @@ -1230,11 +1366,9 @@ put-notes-hash\x01\x1e\x01@\x03\x05asset\x03\x03tag\x05\x09recipient\x07\0\x1b\x 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"; - +wit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] 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/bindings.rs b/tests/rust-apps-wasm/wit-sdk/p2id-note/src/bindings.rs index 1e6fc85c2..45bff2b7d 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,6 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: -// * additional derives ["PartialEq"] #[allow(dead_code)] pub mod miden { #[allow(dead_code)] @@ -9,26 +6,26 @@ pub mod miden { pub mod core_types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + 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 + /// 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. + /// 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 { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Felt").field("inner", &self.inner).finish() } } @@ -36,19 +33,16 @@ pub mod miden { 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: + /// 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: + /// - 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. + /// - 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)] @@ -56,19 +50,24 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for AccountId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + 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) + /// 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 { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Recipient").field("inner", &self.inner).finish() } } @@ -78,55 +77,52 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Tag { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + 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: + /// 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 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. + /// 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 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. + /// 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. + /// 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 + /// - 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]. + /// - 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 + /// 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)] @@ -134,7 +130,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for CoreAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("CoreAsset").field("inner", &self.inner).finish() } } @@ -145,7 +144,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for Nonce { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Nonce").field("inner", &self.inner).finish() } } @@ -156,7 +158,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for AccountHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("AccountHash").field("inner", &self.inner).finish() } } @@ -167,7 +172,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for BlockHash { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("BlockHash").field("inner", &self.inner).finish() } } @@ -178,7 +186,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageValue { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageValue").field("inner", &self.inner).finish() } } @@ -189,7 +200,10 @@ pub mod miden { pub inner: Word, } impl ::core::fmt::Debug for StorageRoot { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("StorageRoot").field("inner", &self.inner).finish() } } @@ -200,8 +214,13 @@ pub mod miden { 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() + 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 @@ -211,8 +230,13 @@ pub mod miden { 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() + 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 @@ -222,7 +246,10 @@ pub mod miden { pub inner: Felt, } impl ::core::fmt::Debug for NoteId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("NoteId").field("inner", &self.inner).finish() } } @@ -231,14 +258,12 @@ pub mod miden { 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!() @@ -250,14 +275,11 @@ pub mod miden { } } } - #[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; + 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; @@ -267,8 +289,7 @@ pub mod miden { 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. + /// 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")] @@ -277,13 +298,14 @@ pub mod miden { #[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 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -300,7 +322,6 @@ pub mod miden { #[link_name = "get-block-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -312,10 +333,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -335,7 +364,6 @@ pub mod miden { #[link_name = "get-input-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -346,10 +374,18 @@ pub mod miden { 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 }, + 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, + }, ) } } @@ -368,7 +404,6 @@ pub mod miden { #[link_name = "get-output-notes-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -379,10 +414,18 @@ pub mod miden { 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 }, + 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, + }, ) } } @@ -392,30 +435,50 @@ pub mod miden { /// 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 { + 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 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 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; - + 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" { @@ -432,7 +495,6 @@ pub mod miden { _: i64, ) -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i64, @@ -466,14 +528,11 @@ pub mod miden { } } } - #[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; + 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; @@ -482,10 +541,8 @@ pub mod miden { 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; + 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 { @@ -496,7 +553,6 @@ pub mod miden { #[link_name = "get-id"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -519,7 +575,6 @@ pub mod miden { #[link_name = "get-nonce"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -546,7 +601,6 @@ pub mod miden { #[link_name = "get-initial-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -558,10 +612,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -580,7 +642,6 @@ pub mod miden { #[link_name = "get-current-hash"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -592,10 +653,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -605,16 +674,15 @@ pub mod miden { /// 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; - + 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!() @@ -629,8 +697,9 @@ pub mod miden { #[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 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")] @@ -638,7 +707,6 @@ pub mod miden { #[link_name = "get-item"] fn wit_import(_: i64, _: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: i64, _: *mut u8) { unreachable!() @@ -650,10 +718,18 @@ pub mod miden { 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 }, + 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, + }, ), } } @@ -661,29 +737,47 @@ pub mod miden { #[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) { + 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::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 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); + 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!() @@ -751,18 +845,24 @@ pub mod miden { 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; - + 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!() @@ -782,24 +882,26 @@ pub mod miden { /// 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; - + 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 } + super::super::super::miden::base::core_types::Felt { + inner: ret as u64, + } } } #[allow(unused_unsafe, clippy::all)] @@ -809,21 +911,28 @@ pub mod miden { /// 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 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::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!() @@ -848,13 +957,22 @@ pub mod miden { #[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 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::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")] @@ -862,7 +980,6 @@ pub mod miden { #[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!() @@ -880,9 +997,15 @@ pub mod miden { 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: 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, }, @@ -897,13 +1020,22 @@ pub mod miden { #[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 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::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")] @@ -911,7 +1043,6 @@ pub mod miden { #[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!() @@ -929,9 +1060,15 @@ pub mod miden { 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: 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, }, @@ -953,7 +1090,6 @@ pub mod miden { #[link_name = "get-vault-commitment"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -965,23 +1101,28 @@ pub mod miden { 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 }, + super::super::super::miden::base::core_types::Felt { + inner: l1 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l2 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l3 as u64, + }, + super::super::super::miden::base::core_types::Felt { + inner: l4 as u64, + }, ), } } } } - #[allow(dead_code, clippy::all)] pub mod note { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + 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; @@ -1000,7 +1141,6 @@ pub mod miden { #[link_name = "get-inputs"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -1026,7 +1166,6 @@ pub mod miden { #[link_name = "get-assets"] fn wit_import(_: *mut u8); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import(_: *mut u8) { unreachable!() @@ -1048,7 +1187,6 @@ pub mod miden { #[link_name = "get-sender"] fn wit_import() -> i64; } - #[cfg(not(target_arch = "wasm32"))] fn wit_import() -> i64 { unreachable!() @@ -1069,9 +1207,7 @@ pub mod miden { pub mod basic_wallet { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::__link_custom_section_describing_imports; + 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; @@ -1079,21 +1215,28 @@ pub mod miden { #[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 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::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!() @@ -1109,28 +1252,44 @@ pub mod miden { #[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 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 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; - + 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" { @@ -1147,7 +1306,6 @@ pub mod miden { _: i64, ); } - #[cfg(not(target_arch = "wasm32"))] fn wit_import( _: i64, @@ -1188,31 +1346,26 @@ pub mod exports { 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; + 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(); + #[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>() - } - };); - } + macro_rules! __export_miden_base_note_script_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:base/note-script@1.0.0#note-script"] unsafe extern "C" fn + export_note_script() { $($path_to_types)*:: + _export_note_script_cabi::<$ty > () } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_base_note_script_1_0_0_cabi; } @@ -1220,28 +1373,23 @@ pub mod exports { } } mod _rt { - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { @@ -1260,14 +1408,12 @@ mod _rt { } } 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. /// @@ -1286,18 +1432,20 @@ mod _rt { /// ``` #[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); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::miden::base::note_script::__export_miden_base_note_script_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::miden::base::note_script); + }; } #[doc(inline)] pub(crate) use __export_notes_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:notes-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.30.0:notes-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2434] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x80\x12\x01A\x02\x01\ @@ -1360,11 +1508,9 @@ set\x01\x01\0\x04\0\x0dreceive-asset\x01\x06\x01@\x03\x0acore-asset\x01\x03tag\x 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"; - +\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] 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/bindings.rs b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs index e5a194d17..fc063acda 100644 --- a/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs +++ b/tests/rust-apps-wasm/wit-sdk/sdk/src/bindings.rs @@ -1,5 +1,3 @@ -// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! -// Options used: #[allow(dead_code)] pub mod exports { #[allow(dead_code)] @@ -10,26 +8,26 @@ pub mod exports { 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; + 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 + /// 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. + /// 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 { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("Felt").field("inner", &self.inner).finish() } } @@ -37,19 +35,16 @@ pub mod exports { 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: + /// 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: + /// - 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. + /// - 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)] @@ -57,72 +52,72 @@ pub mod exports { pub inner: Felt, } impl ::core::fmt::Debug for AccountId { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + 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: + /// 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 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. + /// 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 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. + /// 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 + /// 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 + /// - 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]. + /// - 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. + /// 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 { + 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(); + 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; @@ -133,33 +128,27 @@ pub mod exports { fn account_id_from_felt(felt: Felt) -> AccountId; } #[doc(hidden)] - - macro_rules! __export_miden_base_core_types_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:base/core-types@1.0.0#account-id-from-felt"] - unsafe extern "C" fn export_account_id_from_felt(arg0: i64,) -> i64 { - $($path_to_types)*::_export_account_id_from_felt_cabi::<$ty>(arg0) - } - };); - } + macro_rules! __export_miden_base_core_types_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:base/core-types@1.0.0#account-id-from-felt"] unsafe extern + "C" fn export_account_id_from_felt(arg0 : i64,) -> i64 { + $($path_to_types)*:: _export_account_id_from_felt_cabi::<$ty > + (arg0) } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_base_core_types_1_0_0_cabi; } - #[allow(dead_code, clippy::all)] pub mod types { #[used] #[doc(hidden)] - #[cfg(target_arch = "wasm32")] - static __FORCE_SECTION_REF: fn() = - super::super::super::super::__link_custom_section_describing_imports; + 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 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; + pub type CoreAsset = super::super::super::super::exports::miden::base::core_types::CoreAsset; /// A fungible asset #[repr(C)] #[derive(Clone, Copy)] @@ -170,7 +159,10 @@ pub mod exports { pub amount: u64, } impl ::core::fmt::Debug for FungibleAsset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { f.debug_struct("FungibleAsset") .field("asset", &self.asset) .field("amount", &self.amount) @@ -179,10 +171,9 @@ pub mod exports { } /// 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 + /// 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)] @@ -190,8 +181,13 @@ pub mod exports { 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() + 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. @@ -201,7 +197,10 @@ pub mod exports { NonFungible(NonFungibleAsset), } impl ::core::fmt::Debug for Asset { - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + fn fmt( + &self, + f: &mut ::core::fmt::Formatter<'_>, + ) -> ::core::fmt::Result { match self { Asset::Fungible(e) => { f.debug_tuple("Asset::Fungible").field(e).finish() @@ -220,29 +219,34 @@ pub mod exports { 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, - }), - }); + #[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; + 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); } @@ -250,13 +254,21 @@ pub mod exports { *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; + 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; + 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; + 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; + let super::super::super::super::exports::miden::base::core_types::Felt { + inner: inner10, + } = t6_3; *ptr1.add(32).cast::() = _rt::as_i64(inner10); } } @@ -271,33 +283,37 @@ pub mod exports { arg3: i64, arg4: i64, ) -> *mut u8 { - #[cfg(target_arch = "wasm32")] - _rt::run_ctors_once(); + #[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, - }; + 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, - }), - }; + 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) } }; @@ -332,57 +348,53 @@ pub mod exports { fn to_core_asset(asset: Asset) -> CoreAsset; } #[doc(hidden)] - - macro_rules! __export_miden_base_types_1_0_0_cabi{ - ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - - #[export_name = "miden:base/types@1.0.0#from-core-asset"] - unsafe extern "C" fn export_from_core_asset(arg0: i64,arg1: i64,arg2: i64,arg3: i64,) -> *mut u8 { - $($path_to_types)*::_export_from_core_asset_cabi::<$ty>(arg0, arg1, arg2, arg3) - } - #[export_name = "miden:base/types@1.0.0#to-core-asset"] - unsafe extern "C" fn export_to_core_asset(arg0: i32,arg1: i64,arg2: i64,arg3: i64,arg4: i64,) -> *mut u8 { - $($path_to_types)*::_export_to_core_asset_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4) - } - };); - } + macro_rules! __export_miden_base_types_1_0_0_cabi { + ($ty:ident with_types_in $($path_to_types:tt)*) => { + const _ : () = { #[export_name = + "miden:base/types@1.0.0#from-core-asset"] unsafe extern "C" fn + export_from_core_asset(arg0 : i64, arg1 : i64, arg2 : i64, arg3 : + i64,) -> * mut u8 { $($path_to_types)*:: + _export_from_core_asset_cabi::<$ty > (arg0, arg1, arg2, arg3) } + #[export_name = "miden:base/types@1.0.0#to-core-asset"] unsafe + extern "C" fn export_to_core_asset(arg0 : i32, arg1 : i64, arg2 : + i64, arg3 : i64, arg4 : i64,) -> * mut u8 { $($path_to_types)*:: + _export_to_core_asset_cabi::<$ty > (arg0, arg1, arg2, arg3, arg4) + } }; + }; + } #[doc(hidden)] pub(crate) use __export_miden_base_types_1_0_0_cabi; #[repr(align(8))] struct _RetArea([::core::mem::MaybeUninit; 40]); - static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 40]); + static mut _RET_AREA: _RetArea = _RetArea( + [::core::mem::MaybeUninit::uninit(); 40], + ); } } } } mod _rt { - #[cfg(target_arch = "wasm32")] pub fn run_ctors_once() { wit_bindgen_rt::run_ctors_once(); } - pub fn as_i64(t: T) -> i64 { t.as_i64() } - pub trait AsI64 { fn as_i64(self) -> i64; } - impl<'a, T: Copy + AsI64> AsI64 for &'a T { fn as_i64(self) -> i64 { (*self).as_i64() } } - impl AsI64 for i64 { #[inline] fn as_i64(self) -> i64 { self as i64 } } - impl AsI64 for u64 { #[inline] fn as_i64(self) -> i64 { @@ -390,7 +402,6 @@ mod _rt { } } } - /// Generates `#[no_mangle]` functions to export the specified type as the /// root implementation of all generated traits. /// @@ -409,19 +420,23 @@ mod _rt { /// ``` #[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); - ) + ($ty:ident) => { + self::export!($ty with_types_in self); + }; + ($ty:ident with_types_in $($path_to_types_root:tt)*) => { + $($path_to_types_root)*:: + exports::miden::base::core_types::__export_miden_base_core_types_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::miden::base::core_types); + $($path_to_types_root)*:: + exports::miden::base::types::__export_miden_base_types_1_0_0_cabi!($ty + with_types_in $($path_to_types_root)*:: exports::miden::base::types); + }; } #[doc(inline)] pub(crate) use __export_base_world_impl as export; - #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.25.0:base-world:encoded world"] +#[link_section = "component-type:wit-bindgen:0.30.0:base-world:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 922] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x99\x06\x01A\x02\x01\ @@ -445,11 +460,9 @@ gible\x01\x0b\0\x04\0\x05asset\x03\0\x0c\x01@\x01\x0acore-asset\x07\0\x0d\x04\0\ 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"; - +\x0dwit-component\x070.215.0\x10wit-bindgen-rust\x060.30.0"; #[inline(never)] #[doc(hidden)] -#[cfg(target_arch = "wasm32")] pub fn __link_custom_section_describing_imports() { wit_bindgen_rt::maybe_link_cabi_realloc(); }