Reading an Entry at Run Time

Status: implemented

const entry = (a, b) => {
    const x = Object.getOwnPropertyDescriptor(a, b);
    return x?.enumerable ? x.value : undefined;
};
const hasEntry = (a, b) => {
    const x = Object.getOwnPropertyDescriptor(a, b);
    return x?.enumerable === true;
};
const escapes = { n: "\n", t: "\t" };
export default (...c) => hasEntry(escapes, c[0]) ? entry(escapes, c[0]) : c[0];

A key computed at run time is read by the entry helper and tested by the hasEntry helper: the two functions above, written in a module under any three names each, or imported from fjs/types/object/entry, which spells them once. entry(a, b) is the value of the enumerable own property b names of a — a member of an object, an element of an array or of a string — and undefined where there is none: a length, which an array, a string and a function own without enumerating it; a function's name, which the language keeps unobservable (functions); anything of a number, a boolean or a bigint; and a name a prototype would give the value in JavaScript, since the descriptor is the value's own. hasEntry(a, b) is the presence, true where there is one, an entry holding undefined included, so that { x: undefined } and {} come apart, and false where there is none. The key is converted as Object.getOwnPropertyDescriptor converts it, so entry(a, 0) and entry(a, "0") read one element and an object key converts through its own toString; a null or undefined a is an error, as reading a property of one is, and so is a key whose conversion fails.

The pair composes as reads do: entry(a, b) ?? d is the value or a default, as a[k] ?? d is, the default taken for an entry holding undefined too; where that entry must keep its undefined, hasEntry(a, b) ? entry(a, b) : d reads twice and keeps it; and keys.filter(k => hasEntry(a, k)) is the keys present, in key order. Presence with a constant key is the operator "k" in a (in), the same question for a key written in the source, as a.k is the read; hasEntry is its computed-key spelling, with one difference the pair keeps on purpose: a.length and "length" in a read the length an array and a function own without enumerating it, where the helpers list what Object.entries lists, the enumerable entries, and answer undefined and false for it. Object.hasOwn and a.hasOwnProperty(b) are not in the language, each asking a different question — a non-enumerable own property, or the prototype chain.

The helpers are exactly what they spell. The compiler recognizes each function whole — its two parameters, the const the descriptor binds and the return, under any three distinct names a module may bind, so no keyword and no reserved global, the keys in either spelling, the semicolons where JavaScript inserts them — where Object is the reserved global no scope binds (built-in static functions); a function that departs from either by a step is an ordinary function, in which Object is refused at the word as everywhere but Object.is. The body that returned the option, x?.enumerable ? [x.value] : [], is such a departure now. Each is a function like any other once recognized: a value, of length 2, capturing nothing, a fresh identity wherever it is written as every arrow is, passed as a value — [a, b].map(entry) — and converting to its text as any function does (function source). Its EDAG is the node ['entry'] or ['hasEntry'], the helper as a value, and a read of a computed key is a call of it, ['()', ['entry'], [a, b]] (fjs/edag); the graph outputs write the node back as the helper, the FunctionalScript one under names of its own, the Rust one as a function the VM answers natively. Value outputs can evaluate calls to the helpers; selecting a helper itself is refused as a function value.

The node is the language's one read of a property by a name it computes: Object is no value a module can name, and its namespace admits is and entries alone, the second listing every entry rather than reading one (built-in static functions), and a[i] stays unread (property access). Where a program knows its index to be a number, the spelling is a[Number(i)] (property access); a[+i], where no bigint can reach it, is property-accessor's still, and entry is the read for a key of any type.

Why two helpers

The language first answered both questions with one helper, the option [value] or [], chosen for one scan per question: value, presence, or a default that respects an entry holding undefined, each one call, where the pair spends two scans on the third. That argument held until the runtime's dispatcher, dot, was written in the language (runtime-members, DESIGN.md §13), and the language designer decided for the pair:

  • The common read has no tail. entry(a, b) is the value, as a[k] is, where the option made every read entry(a, b)[0].
  • Nothing is built on a member call. dot reads the receiver and then the member table, and with the option each read built a one-element array to carry one bit, on the path of every compiled a.map(f); with the pair, hasEntry(self, key) ? entry(self, key) then the body, it allocates nothing.
  • The shape is in the source, not in a rule. A backend could print the option's presence test without the array, but that is a substitution keyed on a body's text, which §13 says is a sign the source should expose the shape instead. hasEntry is the shape.
  • The floor is simpler. The core of the runtime may not use what it defines, and with the option it read [0] of entry's answer, a property read, to get at the value. With the pair presence is a boolean and the value is the value.

The price: two scans where presence and value are both wanted on a receiver that owns the key, each one lookup, against the option's one lookup and one allocation — which of the two is dearer is not measured, and the decision does not rest on it; an own undefined invisible to entry alone, which hasEntry tells apart, as JavaScript's in and Object.hasOwn callers do; and two recognized bodies, two nodes and two native answers on each executor where the option had one of each. The option stays available as an ordinary function over the two, hasEntry(a, b) ? [entry(a, b)] : [], for a caller that wants it. The decision was recorded in spec/todo/2345-has-entry.md, its three tasks done by #3037, #3038 and #3031.

Examples

The compiler demo offers the programs entries in module.f.js, each with its real output.

The demo on this page runs sample.f.js, this page's example as a function of one number — reading an entry at run time: one that exists, and one that does not — with every output fjs compile makes of it: the expression graph (EDAG), the Rust and the WebAssembly that Rust builds to. Its Run button calls the default export with 0 and 1, as JavaScript and as WebAssembly, and shows what each call returned or threw.

const entry = (a, b) => {
    const x = Object.getOwnPropertyDescriptor(a, b);
    return x?.enumerable ? x.value : undefined;
};
const escapes = { n: "newline", t: "tab" };
export default (...c) => entry(escapes, ["n", "x"][Number(c[0])]);

Reference

Demo

In FunctionalScript

fjs compile accepts this module, and it runs as JavaScript and as WebAssembly alike.

A FunctionalScript module and what fjs compile makes of it: the expression graph it lowers to, the Rust it compiles to on the NaNVM runtime, and the WebAssembly that Rust builds to. Run calls its default export with 0, then 1, first as the JavaScript it already is and then as WebAssembly, and shows what each call returned or threw and how long one call takes, timed over 1000 calls.

FunctionalScript source:

/**
 * The example of [`README.md`](./README.md) (Reading an Entry at Run Time)
 * as a function of one number, for the page's WASM demo: reading an entry at
 * run time: one that exists, and one that does not.
 *
 * @module
 */

/** @type {(a: object, b: string) => unknown} */
const entry = (a, b) => {
    const x = Object.getOwnPropertyDescriptor(a, b);
    return x?.enumerable ? x.value : undefined;
};
const escapes = { n: "newline", t: "tab" };
/** @type {(...a: readonly number[]) => unknown} */
export default (...c) => entry(escapes, ["n", "x"][Number(c[0])]);

Expression graph (EDAG) that fjs compile lowers it to:

=>lengthframe 0frame 1body0entry{}(){}nt"newline""tab"()callee...frame 0[][]01frame 1..objidx[]01"n""x"Numberoperand.objidxrest0

The same graph, as fjs compile writes it to a .edag.data.js file:

export default ["{}",[[":","default",["=>",0,[["entry"],["{}",[[":","n","newline"],[":","t","tab"]]]],["()",["frame",0],[["frame",1],[".",["[]",["n","x"]],["Number",[".",["rest"],0]]]]]]]]];

Rust that fjs compile writes from it, on the NaNVM runtime:

// @generated by `fjs compile`. Do not edit: recompile the source module instead.

use nanvm_lib::vm::unstable::{f64_any, string_any, string_key};
use nanvm_lib::vm::{Any, Array, IStaticFunction, ToAny, ToArray, ToObject};

#[rustfmt::skip]
#[allow(clippy::if_same_then_else)]
pub fn module<A: IStaticFunction>(_runtime: Any<A>) -> Result<Any<A>, Any<A>> {
    let _b0: Any<A> = A::static_function(|_self, _args| Any::entry(_args.argument(0), _args.argument(1)), 2, Array::default(), Some("($0,$1)=>{const $2=Object.getOwnPropertyDescriptor($0,$1);return $2?.enumerable?$2.value:undefined;}")).to_any();
    let _b1: Any<A> = [(string_key("n"), string_any("newline")), (string_key("t"), string_any("tab"))].to_object().to_any();
    Ok([(string_key("default"), A::static_function(|_self, _args| {
        let _b468: Any<A> = _args.rest(0).to_any();
        Any::call(A::frame(_self)[0].clone(), [A::frame(_self)[1].clone(), (Any::dot([string_any("n"), string_any("x")].to_array().to_any(), (Any::number((Any::dot(_b468.clone(), f64_any(0x0000000000000000)).end())?))?).end())?].to_array().to_any())
    }, 0, [_b0.clone(), _b1.clone()].to_array(), Some("(...$2)=>$0($1,[\"n\",\"x\"][Number($2[0])])")).to_any())].to_object().to_any())
}

WebAssembly text (WAT) of the functions compiled from this source, without the NaNVM runtime:

  (func $nanvm_demos::samples::entries::module::<nanvm_lib::naive::Naive> (;420;) (type 1) (param i32 i32)
    (local i32 i32 i32 i32 i32 i32 i32 i32 i32 i64)
    global.get $__stack_pointer
    i32.const 176
    i32.sub
    local.tee 2
    global.set $__stack_pointer
    local.get 2
    i32.const 0
    i32.store8 offset=152
    local.get 2
    i32.const 32
    i32.add
    local.get 2
    i32.const 152
    i32.add
    call $"<core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::iter::sources::empty::Empty<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, core::result::Result<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, ()>::Ok>, core::result::Result<core::convert::Infallible, ()>> as alloc::rc::ToRcSlice<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>::to_rc_slice"
    local.get 2
    local.get 2
    i32.load offset=36
    local.tee 3
    i32.store offset=76
    local.get 2
    local.get 2
    i32.load offset=32
    local.tee 4
    i32.store offset=72
    block ;; label = @1
      block ;; label = @2
        local.get 2
        i32.load8_u offset=152
        i32.const 1
        i32.ne
        br_if 0 (;@2;)
        local.get 4
        local.get 4
        i32.load
        i32.const -1
        i32.add
        local.tee 0
        i32.store
        local.get 0
        br_if 1 (;@1;)
        local.get 2
        i32.const 72
        i32.add
        call $"<alloc::rc::Rc<[nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>]>>::drop_slow"
        br 1 (;@1;)
      end
      local.get 4
      i32.eqz
      br_if 0 (;@1;)
      local.get 2
      i32.const 82
      i32.const 2
      local.get 4
      local.get 3
      i32.const 1061211
      i32.const 100
      call $"<nanvm_lib::naive::Naive as nanvm_lib::vm::internal::IVm>::static_function"
      local.tee 3
      i32.store offset=44
      local.get 2
      i32.const 7
      i32.store8 offset=40
      local.get 2
      i32.const 0
      i32.store16 offset=64
      local.get 2
      i32.const 1061312
      i32.store offset=60
      local.get 2
      i32.const 1061311
      i32.store offset=56
      local.get 2
      i32.const 72
      i32.add
      local.get 2
      i32.const 56
      i32.add
      call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
      block ;; label = @2
        block ;; label = @3
          block ;; label = @4
            block ;; label = @5
              block ;; label = @6
                block ;; label = @7
                  block ;; label = @8
                    block ;; label = @9
                      block ;; label = @10
                        local.get 2
                        i32.load8_u offset=72
                        local.tee 4
                        i32.const 255
                        i32.ne
                        br_if 0 (;@10;)
                        local.get 2
                        i32.load offset=80
                        local.set 4
                        local.get 2
                        i32.load offset=76
                        local.set 5
                        local.get 2
                        i32.const 0
                        i32.store16 offset=64
                        local.get 2
                        i32.const 1061319
                        i32.store offset=60
                        local.get 2
                        i32.const 1061312
                        i32.store offset=56
                        local.get 2
                        i32.const 72
                        i32.add
                        local.get 2
                        i32.const 56
                        i32.add
                        call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
                        local.get 2
                        i32.load8_u offset=72
                        local.tee 6
                        i32.const 255
                        i32.ne
                        br_if 1 (;@9;)
                        local.get 2
                        i32.load offset=80
                        local.set 6
                        local.get 2
                        i32.load offset=76
                        local.set 7
                        local.get 2
                        i32.const 0
                        i32.store16 offset=64
                        local.get 2
                        i32.const 1061320
                        i32.store offset=60
                        local.get 2
                        i32.const 1061319
                        i32.store offset=56
                        local.get 2
                        i32.const 72
                        i32.add
                        local.get 2
                        i32.const 56
                        i32.add
                        call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
                        local.get 2
                        i32.load8_u offset=72
                        local.tee 8
                        i32.const 255
                        i32.ne
                        br_if 2 (;@8;)
                        local.get 2
                        i32.load offset=80
                        local.set 8
                        local.get 2
                        i32.load offset=76
                        local.set 9
                        local.get 2
                        i32.const 0
                        i32.store16 offset=64
                        local.get 2
                        i32.const 1061323
                        i32.store offset=60
                        local.get 2
                        i32.const 1061320
                        i32.store offset=56
                        local.get 2
                        i32.const 72
                        i32.add
                        local.get 2
                        i32.const 56
                        i32.add
                        call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
                        local.get 2
                        i32.load8_u offset=72
                        local.tee 10
                        i32.const 255
                        i32.ne
                        br_if 3 (;@7;)
                        local.get 2
                        i64.load offset=76 align=4
                        local.set 11
                        local.get 2
                        i32.const 0
                        i32.store8 offset=56
                        local.get 2
                        local.get 11
                        i64.store offset=116 align=4
                        local.get 2
                        i32.const 3
                        i32.store8 offset=112
                        local.get 2
                        local.get 8
                        i32.store offset=108
                        local.get 2
                        local.get 9
                        i32.store offset=104
                        local.get 2
                        local.get 6
                        i32.store offset=96
                        local.get 2
                        local.get 7
                        i32.store offset=92
                        local.get 2
                        i32.const 3
                        i32.store8 offset=88
                        local.get 2
                        local.get 4
                        i32.store offset=84
                        local.get 2
                        local.get 5
                        i32.store offset=80
                        local.get 2
                        i64.const 8589934592
                        i64.store offset=72
                        local.get 2
                        local.get 2
                        i32.const 56
                        i32.add
                        i32.store offset=128
                        local.get 2
                        i32.const 24
                        i32.add
                        local.get 2
                        i32.const 72
                        i32.add
                        call $"<core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::array::iter::IntoIter<(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>), 2>, core::result::Result<(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>), ()>::Ok>, core::result::Result<core::convert::Infallible, ()>> as alloc::rc::ToRcSlice<(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>)>>::to_rc_slice"
                        local.get 2
                        local.get 2
                        i32.load offset=28
                        local.tee 5
                        i32.store offset=156
                        local.get 2
                        local.get 2
                        i32.load offset=24
                        local.tee 4
                        i32.store offset=152
                        block ;; label = @11
                          local.get 2
                          i32.load8_u offset=56
                          i32.const 1
                          i32.ne
                          br_if 0 (;@11;)
                          local.get 4
                          local.get 4
                          i32.load
                          i32.const -1
                          i32.add
                          local.tee 0
                          i32.store
                          local.get 0
                          br_if 9 (;@2;)
                          local.get 2
                          i32.const 152
                          i32.add
                          call $"<alloc::rc::Rc<[(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>)]>>::drop_slow"
                          br 9 (;@2;)
                        end
                        local.get 4
                        i32.eqz
                        br_if 8 (;@2;)
                        local.get 2
                        local.get 5
                        i32.store offset=64
                        local.get 2
                        local.get 4
                        i32.store offset=60
                        local.get 2
                        i32.const 5
                        i32.store8 offset=56
                        local.get 2
                        i32.const 0
                        i32.store16 offset=148
                        local.get 2
                        i32.const 1061143
                        i32.store offset=144
                        local.get 2
                        i32.const 1061136
                        i32.store offset=140
                        local.get 2
                        i32.const 72
                        i32.add
                        local.get 2
                        i32.const 140
                        i32.add
                        call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
                        local.get 2
                        i32.load8_u offset=72
                        local.tee 6
                        i32.const 255
                        i32.ne
                        br_if 4 (;@6;)
                        local.get 2
                        i32.load offset=80
                        local.set 7
                        local.get 2
                        i32.load offset=76
                        local.set 8
                        local.get 3
                        local.get 3
                        i32.load
                        i32.const 1
                        i32.add
                        local.tee 6
                        i32.store
                        local.get 6
                        i32.eqz
                        br_if 5 (;@5;)
                        local.get 4
                        local.get 4
                        i32.load
                        i32.const 1
                        i32.add
                        local.tee 6
                        i32.store
                        local.get 6
                        i32.eqz
                        br_if 5 (;@5;)
                        local.get 2
                        i32.const 0
                        i32.store8 offset=140
                        local.get 2
                        local.get 5
                        i64.extend_i32_u
                        i64.store offset=104
                        local.get 2
                        local.get 4
                        i32.store offset=100
                        local.get 2
                        i32.const 5
                        i32.store8 offset=96
                        local.get 2
                        i64.const 0
                        i64.store offset=88
                        local.get 2
                        local.get 3
                        i32.store offset=84
                        local.get 2
                        i32.const 7
                        i32.store8 offset=80
                        local.get 2
                        i64.const 8589934592
                        i64.store offset=72
                        local.get 2
                        local.get 2
                        i32.const 140
                        i32.add
                        i32.store offset=112
                        local.get 2
                        i32.const 16
                        i32.add
                        local.get 2
                        i32.const 72
                        i32.add
                        call $"<core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::array::iter::IntoIter<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, 2>, core::result::Result<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, ()>::Ok>, core::result::Result<core::convert::Infallible, ()>> as alloc::rc::ToRcSlice<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>::to_rc_slice"
                        local.get 2
                        local.get 2
                        i32.load offset=20
                        local.tee 3
                        i32.store offset=156
                        local.get 2
                        local.get 2
                        i32.load offset=16
                        local.tee 4
                        i32.store offset=152
                        block ;; label = @11
                          local.get 2
                          i32.load8_u offset=140
                          i32.const 1
                          i32.ne
                          br_if 0 (;@11;)
                          local.get 4
                          local.get 4
                          i32.load
                          i32.const -1
                          i32.add
                          local.tee 0
                          i32.store
                          local.get 0
                          br_if 8 (;@3;)
                          local.get 2
                          i32.const 152
                          i32.add
                          call $"<alloc::rc::Rc<[nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>]>>::drop_slow"
                          br 8 (;@3;)
                        end
                        local.get 4
                        i32.eqz
                        br_if 7 (;@3;)
                        i32.const 83
                        i32.const 0
                        local.get 4
                        local.get 3
                        i32.const 1061323
                        i32.const 40
                        call $"<nanvm_lib::naive::Naive as nanvm_lib::vm::internal::IVm>::static_function"
                        local.set 4
                        local.get 2
                        i32.const 0
                        i32.store8 offset=140
                        local.get 2
                        local.get 4
                        i32.store offset=92
                        local.get 2
                        i32.const 7
                        i32.store8 offset=88
                        local.get 2
                        local.get 7
                        i32.store offset=84
                        local.get 2
                        local.get 8
                        i32.store offset=80
                        local.get 2
                        i64.const 4294967296
                        i64.store offset=72
                        local.get 2
                        local.get 2
                        i32.const 140
                        i32.add
                        i32.store offset=104
                        local.get 2
                        i32.const 8
                        i32.add
                        local.get 2
                        i32.const 72
                        i32.add
                        call $"<core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::array::iter::IntoIter<(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>), 1>, core::result::Result<(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>), ()>::Ok>, core::result::Result<core::convert::Infallible, ()>> as alloc::rc::ToRcSlice<(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>)>>::to_rc_slice"
                        local.get 2
                        local.get 2
                        i32.load offset=12
                        local.tee 3
                        i32.store offset=156
                        local.get 2
                        local.get 2
                        i32.load offset=8
                        local.tee 4
                        i32.store offset=152
                        block ;; label = @11
                          local.get 2
                          i32.load8_u offset=140
                          i32.const 1
                          i32.ne
                          br_if 0 (;@11;)
                          local.get 4
                          local.get 4
                          i32.load
                          i32.const -1
                          i32.add
                          local.tee 0
                          i32.store
                          local.get 0
                          br_if 7 (;@4;)
                          local.get 2
                          i32.const 152
                          i32.add
                          call $"<alloc::rc::Rc<[(nanvm_lib::vm::string::String<nanvm_lib::naive::Naive>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>)]>>::drop_slow"
                          br 7 (;@4;)
                        end
                        local.get 4
                        i32.eqz
                        br_if 6 (;@4;)
                        local.get 0
                        local.get 3
                        i32.store offset=16
                        local.get 0
                        local.get 4
                        i32.store offset=12
                        local.get 0
                        i32.const 5
                        i32.store8 offset=8
                        local.get 0
                        i64.const 0
                        i64.store
                        local.get 2
                        i32.const 56
                        i32.add
                        call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                        local.get 2
                        i32.const 40
                        i32.add
                        call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                        local.get 1
                        call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                        local.get 2
                        i32.const 176
                        i32.add
                        global.set $__stack_pointer
                        return
                      end
                      local.get 2
                      local.get 2
                      i32.load8_u offset=75
                      i32.store8 offset=155
                      local.get 2
                      local.get 2
                      i32.load16_u offset=73 align=1
                      i32.store16 offset=153 align=1
                      local.get 2
                      local.get 2
                      i32.load offset=84
                      i32.store offset=164
                      local.get 2
                      local.get 2
                      i64.load offset=76 align=4
                      i64.store offset=156 align=4
                      local.get 2
                      local.get 4
                      i32.store8 offset=152
                      i32.const 1057960
                      i32.const 43
                      local.get 2
                      i32.const 152
                      i32.add
                      i32.const 1057944
                      i32.const 1058004
                      call $core::result::unwrap_failed
                      unreachable
                    end
                    local.get 2
                    local.get 2
                    i32.load8_u offset=75
                    i32.store8 offset=155
                    local.get 2
                    local.get 2
                    i32.load16_u offset=73 align=1
                    i32.store16 offset=153 align=1
                    local.get 2
                    local.get 2
                    i32.load offset=84
                    i32.store offset=164
                    local.get 2
                    local.get 2
                    i64.load offset=76 align=4
                    i64.store offset=156 align=4
                    local.get 2
                    local.get 6
                    i32.store8 offset=152
                    i32.const 1057960
                    i32.const 43
                    local.get 2
                    i32.const 152
                    i32.add
                    i32.const 1057944
                    i32.const 1058004
                    call $core::result::unwrap_failed
                    unreachable
                  end
                  local.get 2
                  local.get 2
                  i32.load8_u offset=75
                  i32.store8 offset=155
                  local.get 2
                  local.get 2
                  i32.load16_u offset=73 align=1
                  i32.store16 offset=153 align=1
                  local.get 2
                  local.get 2
                  i32.load offset=84
                  i32.store offset=164
                  local.get 2
                  local.get 2
                  i64.load offset=76 align=4
                  i64.store offset=156 align=4
                  local.get 2
                  local.get 8
                  i32.store8 offset=152
                  i32.const 1057960
                  i32.const 43
                  local.get 2
                  i32.const 152
                  i32.add
                  i32.const 1057944
                  i32.const 1058004
                  call $core::result::unwrap_failed
                  unreachable
                end
                local.get 2
                local.get 2
                i32.load8_u offset=75
                i32.store8 offset=155
                local.get 2
                local.get 2
                i32.load16_u offset=73 align=1
                i32.store16 offset=153 align=1
                local.get 2
                local.get 2
                i32.load offset=84
                i32.store offset=164
                local.get 2
                local.get 2
                i64.load offset=76 align=4
                i64.store offset=156 align=4
                local.get 2
                local.get 10
                i32.store8 offset=152
                i32.const 1057960
                i32.const 43
                local.get 2
                i32.const 152
                i32.add
                i32.const 1057944
                i32.const 1058004
                call $core::result::unwrap_failed
                unreachable
              end
              local.get 2
              local.get 2
              i32.load8_u offset=75
              i32.store8 offset=155
              local.get 2
              local.get 2
              i32.load16_u offset=73 align=1
              i32.store16 offset=153 align=1
              local.get 2
              local.get 2
              i32.load offset=84
              i32.store offset=164
              local.get 2
              local.get 2
              i64.load offset=76 align=4
              i64.store offset=156 align=4
              local.get 2
              local.get 6
              i32.store8 offset=152
              i32.const 1057960
              i32.const 43
              local.get 2
              i32.const 152
              i32.add
              i32.const 1057944
              i32.const 1058004
              call $core::result::unwrap_failed
            end
            unreachable
          end
          i32.const 1064316
          i32.const 43
          local.get 2
          i32.const 175
          i32.add
          i32.const 1064300
          i32.const 1064360
          call $core::result::unwrap_failed
          unreachable
        end
        i32.const 1064316
        i32.const 43
        local.get 2
        i32.const 175
        i32.add
        i32.const 1064300
        i32.const 1064360
        call $core::result::unwrap_failed
        unreachable
      end
      i32.const 1064316
      i32.const 43
      local.get 2
      i32.const 175
      i32.add
      i32.const 1064300
      i32.const 1064360
      call $core::result::unwrap_failed
      unreachable
    end
    i32.const 1064316
    i32.const 43
    local.get 2
    i32.const 175
    i32.add
    i32.const 1064300
    i32.const 1064360
    call $core::result::unwrap_failed
    unreachable
  )
  (func $"<nanvm_demos::samples::entries::module<nanvm_lib::naive::Naive>::{closure#0} as core::ops::function::FnOnce<(&nanvm_lib::naive::function::Function, nanvm_lib::vm::array::Array<nanvm_lib::naive::Naive>)>>::call_once" (;421;) (type 4) (param i32 i32 i32 i32)
    (local i32 i32 i64 i32)
    global.get $__stack_pointer
    i32.const 80
    i32.sub
    local.tee 4
    global.set $__stack_pointer
    local.get 4
    local.get 3
    i32.store offset=4
    local.get 4
    local.get 2
    i32.store
    local.get 4
    i32.const 40
    i32.add
    local.get 4
    i32.const 0
    call $<nanvm_lib::vm::array::Array<nanvm_lib::naive::Naive>>::present
    block ;; label = @1
      block ;; label = @2
        local.get 4
        i32.load8_u offset=40
        i32.const 255
        i32.eq
        br_if 0 (;@2;)
        local.get 4
        local.get 4
        i64.load offset=48
        i64.store offset=16
        local.get 4
        local.get 4
        i64.load offset=40
        i64.store offset=8
        br 1 (;@1;)
      end
      local.get 4
      i32.const 256
      i32.store16 offset=8
    end
    local.get 4
    i32.const 40
    i32.add
    local.get 4
    i32.const 1
    call $<nanvm_lib::vm::array::Array<nanvm_lib::naive::Naive>>::present
    block ;; label = @1
      block ;; label = @2
        local.get 4
        i32.load8_u offset=40
        i32.const 255
        i32.eq
        br_if 0 (;@2;)
        local.get 4
        local.get 4
        i64.load offset=48
        i64.store offset=32
        local.get 4
        local.get 4
        i64.load offset=40
        i64.store offset=24
        br 1 (;@1;)
      end
      local.get 4
      i32.const 256
      i32.store16 offset=24
    end
    local.get 4
    i32.const 66
    i32.add
    local.set 5
    local.get 4
    i32.const 56
    i32.add
    local.get 4
    i32.const 8
    i32.add
    local.get 4
    i32.const 24
    i32.add
    call $<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::own_entry
    i64.const 1
    local.set 6
    local.get 4
    i32.load8_u offset=65
    local.set 7
    local.get 4
    i32.load8_u offset=64
    local.set 3
    block ;; label = @1
      block ;; label = @2
        local.get 4
        i64.load offset=56
        i64.const 1
        i64.ne
        br_if 0 (;@2;)
        local.get 0
        local.get 7
        i32.store8 offset=9
        local.get 0
        local.get 3
        i32.store8 offset=8
        local.get 0
        local.get 5
        i64.load align=2
        i64.store offset=10 align=2
        local.get 0
        local.get 5
        i64.load offset=6 align=2
        i64.store offset=16 align=2
        br 1 (;@1;)
      end
      block ;; label = @2
        block ;; label = @3
          local.get 3
          i32.const 255
          i32.and
          i32.const 255
          i32.ne
          br_if 0 (;@3;)
          i32.const 0
          local.set 3
          i32.const 1
          local.set 7
          br 1 (;@2;)
        end
        local.get 4
        local.get 5
        i64.load offset=6 align=2
        i64.store offset=46 align=2
        local.get 4
        local.get 5
        i64.load align=2
        i64.store offset=40
      end
      local.get 0
      local.get 7
      i32.store8 offset=9
      local.get 0
      local.get 3
      i32.store8 offset=8
      local.get 0
      local.get 4
      i64.load offset=40
      i64.store offset=10 align=2
      local.get 0
      local.get 4
      i64.load offset=46 align=2
      i64.store offset=16 align=2
      i64.const 0
      local.set 6
    end
    local.get 0
    local.get 6
    i64.store
    local.get 2
    local.get 2
    i32.load
    i32.const -1
    i32.add
    local.tee 0
    i32.store
    block ;; label = @1
      local.get 0
      br_if 0 (;@1;)
      local.get 4
      call $"<alloc::rc::Rc<[nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>]>>::drop_slow"
    end
    local.get 4
    i32.const 80
    i32.add
    global.set $__stack_pointer
  )
  (func $"<nanvm_demos::samples::entries::module<nanvm_lib::naive::Naive>::{closure#1} as core::ops::function::FnOnce<(&nanvm_lib::naive::function::Function, nanvm_lib::vm::array::Array<nanvm_lib::naive::Naive>)>>::call_once" (;422;) (type 4) (param i32 i32 i32 i32)
    (local i32 i32 i32 i32 i64 i32)
    global.get $__stack_pointer
    i32.const 304
    i32.sub
    local.tee 4
    global.set $__stack_pointer
    local.get 1
    i32.load
    local.set 1
    local.get 4
    local.get 3
    i32.store offset=28
    local.get 4
    local.get 2
    i32.store offset=24
    local.get 2
    local.get 2
    i32.load
    i32.const 1
    i32.add
    local.tee 5
    i32.store
    block ;; label = @1
      local.get 5
      i32.eqz
      br_if 0 (;@1;)
      local.get 4
      local.get 3
      i32.store offset=40
      local.get 4
      local.get 2
      i32.store offset=36
      local.get 4
      i32.const 6
      i32.store8 offset=32
      block ;; label = @2
        block ;; label = @3
          block ;; label = @4
            local.get 1
            i32.load offset=16
            i32.eqz
            br_if 0 (;@4;)
            block ;; label = @5
              block ;; label = @6
                block ;; label = @7
                  block ;; label = @8
                    block ;; label = @9
                      block ;; label = @10
                        block ;; label = @11
                          block ;; label = @12
                            local.get 1
                            i32.load offset=12
                            local.tee 6
                            i32.load8_u offset=8
                            local.tee 7
                            br_table 6 (;@6;) 6 (;@6;) 0 (;@12;) 1 (;@11;) 2 (;@10;) 3 (;@9;) 4 (;@8;) 5 (;@7;) 6 (;@6;)
                          end
                          local.get 6
                          i64.load offset=16
                          local.set 8
                          br 9 (;@2;)
                        end
                        local.get 6
                        i32.load offset=12
                        local.tee 5
                        local.get 5
                        i32.load
                        i32.const 1
                        i32.add
                        local.tee 9
                        i32.store
                        local.get 9
                        i32.eqz
                        br_if 9 (;@1;)
                        br 7 (;@3;)
                      end
                      local.get 6
                      i32.load offset=12
                      local.tee 5
                      local.get 5
                      i32.load
                      i32.const 1
                      i32.add
                      local.tee 9
                      i32.store
                      local.get 9
                      i32.eqz
                      br_if 8 (;@1;)
                      local.get 6
                      i64.load8_u offset=20
                      i64.const 32
                      i64.shl
                      local.get 6
                      i64.load32_u offset=16
                      i64.or
                      local.set 8
                      br 7 (;@2;)
                    end
                    local.get 6
                    i32.load offset=12
                    local.tee 5
                    local.get 5
                    i32.load
                    i32.const 1
                    i32.add
                    local.tee 9
                    i32.store
                    local.get 9
                    br_if 5 (;@3;)
                    br 7 (;@1;)
                  end
                  local.get 6
                  i32.load offset=12
                  local.tee 5
                  local.get 5
                  i32.load
                  i32.const 1
                  i32.add
                  local.tee 9
                  i32.store
                  local.get 9
                  br_if 4 (;@3;)
                  br 6 (;@1;)
                end
                local.get 6
                i32.load offset=12
                local.tee 5
                local.get 5
                i32.load
                i32.const 1
                i32.add
                local.tee 6
                i32.store
                local.get 6
                i32.eqz
                br_if 5 (;@1;)
                br 1 (;@5;)
              end
              local.get 6
              i32.load8_u offset=9
              local.set 6
            end
            br 2 (;@2;)
          end
          i32.const 0
          i32.const 0
          i32.const 1069140
          call $core::panicking::panic_bounds_check
          unreachable
        end
        local.get 6
        i64.load32_u offset=16
        local.set 8
      end
      local.get 4
      local.get 8
      i64.store offset=56
      local.get 4
      local.get 5
      i32.store offset=52
      local.get 4
      local.get 6
      i32.store8 offset=49
      local.get 4
      local.get 7
      i32.store8 offset=48
      block ;; label = @2
        block ;; label = @3
          block ;; label = @4
            local.get 1
            i32.load offset=16
            local.tee 5
            i32.const 1
            i32.le_u
            br_if 0 (;@4;)
            block ;; label = @5
              block ;; label = @6
                block ;; label = @7
                  block ;; label = @8
                    block ;; label = @9
                      block ;; label = @10
                        block ;; label = @11
                          block ;; label = @12
                            local.get 1
                            i32.load offset=12
                            local.tee 1
                            i32.load8_u offset=24
                            local.tee 6
                            br_table 6 (;@6;) 6 (;@6;) 0 (;@12;) 1 (;@11;) 2 (;@10;) 3 (;@9;) 4 (;@8;) 5 (;@7;) 6 (;@6;)
                          end
                          local.get 1
                          i64.load offset=32
                          local.set 8
                          br 9 (;@2;)
                        end
                        local.get 1
                        i32.load offset=28
                        local.tee 5
                        local.get 5
                        i32.load
                        i32.const 1
                        i32.add
                        local.tee 7
                        i32.store
                        local.get 7
                        i32.eqz
                        br_if 9 (;@1;)
                        br 7 (;@3;)
                      end
                      local.get 1
                      i32.load offset=28
                      local.tee 5
                      local.get 5
                      i32.load
                      i32.const 1
                      i32.add
                      local.tee 7
                      i32.store
                      local.get 7
                      i32.eqz
                      br_if 8 (;@1;)
                      local.get 1
                      i64.load8_u offset=36
                      i64.const 32
                      i64.shl
                      local.get 1
                      i64.load32_u offset=32
                      i64.or
                      local.set 8
                      br 7 (;@2;)
                    end
                    local.get 1
                    i32.load offset=28
                    local.tee 5
                    local.get 5
                    i32.load
                    i32.const 1
                    i32.add
                    local.tee 7
                    i32.store
                    local.get 7
                    i32.eqz
                    br_if 7 (;@1;)
                    br 5 (;@3;)
                  end
                  local.get 1
                  i32.load offset=28
                  local.tee 5
                  local.get 5
                  i32.load
                  i32.const 1
                  i32.add
                  local.tee 7
                  i32.store
                  local.get 7
                  i32.eqz
                  br_if 6 (;@1;)
                  br 4 (;@3;)
                end
                local.get 1
                i32.load offset=28
                local.tee 5
                local.get 5
                i32.load
                i32.const 1
                i32.add
                local.tee 1
                i32.store
                local.get 1
                i32.eqz
                br_if 5 (;@1;)
                br 1 (;@5;)
              end
              local.get 1
              i32.load8_u offset=25
              local.set 1
            end
            br 2 (;@2;)
          end
          i32.const 1
          local.get 5
          i32.const 1069140
          call $core::panicking::panic_bounds_check
          unreachable
        end
        local.get 1
        i64.load32_u offset=32
        local.set 8
      end
      local.get 4
      local.get 8
      i64.store offset=104
      local.get 4
      local.get 5
      i32.store offset=100
      local.get 4
      local.get 1
      i32.store8 offset=97
      local.get 4
      local.get 6
      i32.store8 offset=96
      local.get 4
      i32.const 0
      i32.store16 offset=176
      local.get 4
      i32.const 1061312
      i32.store offset=172
      local.get 4
      i32.const 1061311
      i32.store offset=168
      local.get 4
      i32.const 248
      i32.add
      local.get 4
      i32.const 168
      i32.add
      call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
      block ;; label = @2
        block ;; label = @3
          block ;; label = @4
            block ;; label = @5
              local.get 4
              i32.load8_u offset=248
              local.tee 1
              i32.const 255
              i32.ne
              br_if 0 (;@5;)
              local.get 4
              i32.load offset=256
              local.set 1
              local.get 4
              i32.load offset=252
              local.set 5
              local.get 4
              i32.const 0
              i32.store16 offset=176
              local.get 4
              i32.const 1063193
              i32.store offset=172
              local.get 4
              i32.const 1063192
              i32.store offset=168
              local.get 4
              i32.const 248
              i32.add
              local.get 4
              i32.const 168
              i32.add
              call $"core::iter::adapters::try_process::<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>, u16, core::result::Result<core::convert::Infallible, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>, <core::result::Result<alloc::rc::Rc<[u16]>, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>> as core::iter::traits::collect::FromIterator<core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>>::from_iter<core::iter::adapters::map::Map<core::str::iter::EncodeUtf16, core::result::Result<u16, nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::Ok>>::{closure#0}, alloc::rc::Rc<[u16]>>"
              local.get 4
              i32.load8_u offset=248
              local.tee 6
              i32.const 255
              i32.ne
              br_if 1 (;@4;)
              local.get 4
              i64.load offset=252 align=4
              local.set 8
              local.get 4
              i32.const 0
              i32.store8 offset=168
              local.get 4
              local.get 8
              i64.store offset=276 align=4
              local.get 4
              i32.const 3
              i32.store8 offset=272
              local.get 4
              local.get 1
              i32.store offset=264
              local.get 4
              local.get 5
              i32.store offset=260
              local.get 4
              i32.const 3
              i32.store8 offset=256
              local.get 4
              i64.const 8589934592
              i64.store offset=248
              local.get 4
              local.get 4
              i32.const 168
              i32.add
              i32.store offset=288
              local.get 4
              i32.const 16
              i32.add
              local.get 4
              i32.const 248
              i32.add
              call $"<core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::array::iter::IntoIter<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, 2>, core::result::Result<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, ()>::Ok>, core::result::Result<core::convert::Infallible, ()>> as alloc::rc::ToRcSlice<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>::to_rc_slice"
              local.get 4
              local.get 4
              i32.load offset=20
              local.tee 5
              i32.store offset=204
              local.get 4
              local.get 4
              i32.load offset=16
              local.tee 1
              i32.store offset=200
              block ;; label = @6
                local.get 4
                i32.load8_u offset=168
                i32.const 1
                i32.ne
                br_if 0 (;@6;)
                local.get 1
                local.get 1
                i32.load
                i32.const -1
                i32.add
                local.tee 2
                i32.store
                local.get 2
                br_if 4 (;@2;)
                local.get 4
                i32.const 200
                i32.add
                call $"<alloc::rc::Rc<[nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>]>>::drop_slow"
                br 4 (;@2;)
              end
              local.get 1
              i32.eqz
              br_if 3 (;@2;)
              local.get 4
              local.get 5
              i32.store offset=240
              local.get 4
              local.get 1
              i32.store offset=236
              local.get 4
              i32.const 6
              i32.store8 offset=232
              local.get 2
              local.get 2
              i32.load
              i32.const 1
              i32.add
              local.tee 1
              i32.store
              local.get 1
              i32.eqz
              br_if 4 (;@1;)
              local.get 4
              local.get 2
              i32.store offset=204
              local.get 4
              i32.const 6
              i32.store8 offset=200
              local.get 4
              local.get 3
              i64.extend_i32_u
              i64.store offset=208
              local.get 4
              i64.const 0
              i64.store offset=256
              local.get 4
              i32.const 2
              i32.store8 offset=248
              local.get 4
              i32.const 168
              i32.add
              local.get 4
              i32.const 200
              i32.add
              local.get 4
              i32.const 248
              i32.add
              call $<nanvm_lib::vm::lambda::member::Member<nanvm_lib::naive::Naive>>::new
              block ;; label = @6
                block ;; label = @7
                  block ;; label = @8
                    block ;; label = @9
                      block ;; label = @10
                        local.get 4
                        i32.load8_u offset=168
                        i32.const 255
                        i32.ne
                        br_if 0 (;@10;)
                        local.get 0
                        local.get 4
                        i64.load offset=184
                        i64.store offset=16
                        local.get 0
                        local.get 4
                        i64.load offset=176
                        i64.store offset=8
                        local.get 0
                        i64.const 1
                        i64.store
                        local.get 4
                        i32.const 232
                        i32.add
                        call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                        br 1 (;@9;)
                      end
                      local.get 4
                      local.get 4
                      i64.load offset=192
                      i64.store offset=272
                      local.get 4
                      local.get 4
                      i64.load offset=184
                      i64.store offset=264
                      local.get 4
                      local.get 4
                      i64.load offset=176
                      i64.store offset=256
                      local.get 4
                      local.get 4
                      i64.load offset=168
                      i64.store offset=248
                      local.get 4
                      i32.const 200
                      i32.add
                      local.get 4
                      i32.const 248
                      i32.add
                      call $<nanvm_lib::vm::lambda::member::Member<nanvm_lib::naive::Naive>>::own
                      block ;; label = @10
                        block ;; label = @11
                          local.get 4
                          i32.load8_u offset=200
                          i32.const 255
                          i32.eq
                          br_if 0 (;@11;)
                          local.get 4
                          local.get 4
                          i64.load offset=208
                          i64.store offset=144
                          local.get 4
                          local.get 4
                          i64.load offset=200
                          i64.store offset=136
                          br 1 (;@10;)
                        end
                        local.get 4
                        i32.const 256
                        i32.store16 offset=136
                      end
                      local.get 4
                      i32.const 120
                      i32.add
                      local.set 1
                      local.get 4
                      i32.const 248
                      i32.add
                      call $"#func693 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                      local.get 4
                      i32.const 264
                      i32.add
                      call $"#func693 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                      local.get 4
                      i32.const 112
                      i32.add
                      local.get 4
                      i32.const 136
                      i32.add
                      call $<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::number
                      block ;; label = @10
                        local.get 4
                        i64.load offset=112
                        i64.const 1
                        i64.ne
                        br_if 0 (;@10;)
                        local.get 0
                        i64.const 1
                        i64.store
                        local.get 0
                        local.get 1
                        i64.load offset=8
                        i64.store offset=16
                        local.get 0
                        local.get 1
                        i64.load
                        i64.store offset=8
                        local.get 4
                        i32.const 232
                        i32.add
                        call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                        br 1 (;@9;)
                      end
                      local.get 4
                      local.get 1
                      i64.load offset=8
                      i64.store offset=160
                      local.get 4
                      local.get 1
                      i64.load
                      i64.store offset=152
                      local.get 4
                      i32.const 200
                      i32.add
                      local.get 4
                      i32.const 232
                      i32.add
                      local.get 4
                      i32.const 152
                      i32.add
                      call $<nanvm_lib::vm::lambda::member::Member<nanvm_lib::naive::Naive>>::new
                      local.get 4
                      i32.load8_u offset=200
                      i32.const 255
                      i32.ne
                      br_if 1 (;@8;)
                      local.get 0
                      local.get 4
                      i64.load offset=216
                      i64.store offset=16
                      local.get 0
                      local.get 4
                      i64.load offset=208
                      i64.store offset=8
                      local.get 0
                      i64.const 1
                      i64.store
                    end
                    local.get 4
                    i32.const 96
                    i32.add
                    call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                    local.get 4
                    i32.const 48
                    i32.add
                    call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                    local.get 4
                    i32.const 32
                    i32.add
                    call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                    local.get 2
                    local.get 2
                    i32.load
                    i32.const -1
                    i32.add
                    local.tee 1
                    i32.store
                    local.get 1
                    i32.eqz
                    br_if 1 (;@7;)
                    br 2 (;@6;)
                  end
                  local.get 4
                  local.get 4
                  i64.load offset=224
                  i64.store offset=272
                  local.get 4
                  local.get 4
                  i64.load offset=216
                  i64.store offset=264
                  local.get 4
                  local.get 4
                  i64.load offset=208
                  i64.store offset=256
                  local.get 4
                  local.get 4
                  i64.load offset=200
                  i64.store offset=248
                  local.get 4
                  i32.const 232
                  i32.add
                  local.get 4
                  i32.const 248
                  i32.add
                  call $<nanvm_lib::vm::lambda::member::Member<nanvm_lib::naive::Naive>>::own
                  i32.const 1
                  local.set 1
                  i32.const 0
                  local.set 3
                  block ;; label = @8
                    local.get 4
                    i32.load8_u offset=232
                    local.tee 5
                    i32.const 255
                    i32.eq
                    br_if 0 (;@8;)
                    local.get 4
                    local.get 4
                    i64.load offset=234 align=2
                    i64.store offset=80
                    local.get 4
                    local.get 4
                    i64.load offset=240 align=2
                    i64.store offset=86 align=2
                    local.get 4
                    i32.load8_u offset=233
                    local.set 1
                    local.get 5
                    local.set 3
                  end
                  local.get 4
                  i32.const 248
                  i32.add
                  call $"#func693 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                  local.get 4
                  i32.const 264
                  i32.add
                  call $"#func693 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                  local.get 4
                  local.get 4
                  i64.load offset=104
                  i64.store offset=264
                  local.get 4
                  local.get 4
                  i64.load offset=96
                  i64.store offset=256
                  local.get 4
                  i32.const 0
                  i32.store8 offset=96
                  local.get 4
                  local.get 1
                  i32.store8 offset=273
                  local.get 4
                  local.get 3
                  i32.store8 offset=272
                  local.get 4
                  i64.const 8589934592
                  i64.store offset=248
                  local.get 4
                  local.get 4
                  i64.load offset=80
                  i64.store offset=274 align=2
                  local.get 4
                  local.get 4
                  i64.load offset=86 align=2
                  i64.store offset=280 align=2
                  local.get 4
                  local.get 4
                  i32.const 96
                  i32.add
                  i32.store offset=288
                  local.get 4
                  i32.const 8
                  i32.add
                  local.get 4
                  i32.const 248
                  i32.add
                  call $"<core::iter::adapters::GenericShunt<core::iter::adapters::map::Map<core::array::iter::IntoIter<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, 2>, core::result::Result<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>, ()>::Ok>, core::result::Result<core::convert::Infallible, ()>> as alloc::rc::ToRcSlice<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>>::to_rc_slice"
                  local.get 4
                  local.get 4
                  i32.load offset=12
                  local.tee 3
                  i32.store offset=236
                  local.get 4
                  local.get 4
                  i32.load offset=8
                  local.tee 1
                  i32.store offset=232
                  block ;; label = @8
                    local.get 4
                    i32.load8_u offset=96
                    i32.const 1
                    i32.ne
                    br_if 0 (;@8;)
                    local.get 1
                    local.get 1
                    i32.load
                    i32.const -1
                    i32.add
                    local.tee 2
                    i32.store
                    local.get 2
                    br_if 5 (;@3;)
                    local.get 4
                    i32.const 232
                    i32.add
                    call $"<alloc::rc::Rc<[nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>]>>::drop_slow"
                    br 5 (;@3;)
                  end
                  local.get 1
                  i32.eqz
                  br_if 4 (;@3;)
                  local.get 4
                  local.get 3
                  i32.store offset=72
                  local.get 4
                  local.get 1
                  i32.store offset=68
                  local.get 4
                  i32.const 6
                  i32.store8 offset=64
                  local.get 0
                  local.get 4
                  i32.const 48
                  i32.add
                  local.get 4
                  i32.const 64
                  i32.add
                  call $<nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>>::call
                  local.get 4
                  i32.const 32
                  i32.add
                  call $"#func416 core::ptr::drop_glue::<nanvm_lib::vm::unpacked::Unpacked<nanvm_lib::naive::Naive>>"
                  local.get 2
                  local.get 2
                  i32.load
                  i32.const -1
                  i32.add
                  local.tee 1
                  i32.store
                  local.get 1
                  br_if 1 (;@6;)
                end
                local.get 4
                i32.const 24
                i32.add
                call $"<alloc::rc::Rc<[nanvm_lib::vm::any::Any<nanvm_lib::naive::Naive>]>>::drop_slow"
              end
              local.get 4
              i32.const 304
              i32.add
              global.set $__stack_pointer
              return
            end
            local.get 4
            local.get 4
            i32.load8_u offset=251
            i32.store8 offset=203
            local.get 4
            local.get 4
            i32.load16_u offset=249 align=1
            i32.store16 offset=201 align=1
            local.get 4
            local.get 4
            i32.load offset=260
            i32.store offset=212
            local.get 4
            local.get 4
            i64.load offset=252 align=4
            i64.store offset=204 align=4
            local.get 4
            local.get 1
            i32.store8 offset=200
            i32.const 1057960
            i32.const 43
            local.get 4
            i32.const 200
            i32.add
            i32.const 1057944
            i32.const 1058004
            call $core::result::unwrap_failed
            unreachable
          end
          local.get 4
          local.get 4
          i32.load8_u offset=251
          i32.store8 offset=203
          local.get 4
          local.get 4
          i32.load16_u offset=249 align=1
          i32.store16 offset=201 align=1
          local.get 4
          local.get 4
          i32.load offset=260
          i32.store offset=212
          local.get 4
          local.get 4
          i64.load offset=252 align=4
          i64.store offset=204 align=4
          local.get 4
          local.get 6
          i32.store8 offset=200
          i32.const 1057960
          i32.const 43
          local.get 4
          i32.const 200
          i32.add
          i32.const 1057944
          i32.const 1058004
          call $core::result::unwrap_failed
          unreachable
        end
        i32.const 1064316
        i32.const 43
        local.get 4
        i32.const 303
        i32.add
        i32.const 1064300
        i32.const 1064360
        call $core::result::unwrap_failed
        unreachable
      end
      i32.const 1064316
      i32.const 43
      local.get 4
      i32.const 303
      i32.add
      i32.const 1064300
      i32.const 1064360
      call $core::result::unwrap_failed
      unreachable
    end
    unreachable
  )

Emergent Testing

Idle. Press Run to start the suite.

  • ./proof.f.mjs